Web Service created from Function Module with output tables
Hello,
I created a web service from a custom function module. This Function module has some export parameters and one table.
The table parameter returns a list of data for selection.
When I execute the function module, everything is returned fine.
When I call the web service, the export parameters are returned but the table is empty.
Has anyone encountered that kind of issue?
Thanks!
Laurent
Please check the following few things while testing the WS:
- Test the WS with WS Navigator (accessible from transaction WSADMIN or http://<server host>:<port>/wsnavigator/enterwsdl.html).
- While doing the test, give the exact no. of digit if there is some input parameter (with 0 padding if necessary).
- Make sure the "SKIP" check box against the table parameter is NOT checked.
Regards
Nilay
Similar Messages
-
Test web service for a function module
Hello,
I have created web service for a functiona module. I can see the same service in SE80 in Enterprise Services.
How do I test this service?
I can see the URL in WSDL tab but when I try to execute it give me following error,
What has happened?
URL http://emhbssap15.domain.local:8027/sap/bc/srt/wsdl/sdef_service_name/wsdl11/ws_policy/document call was terminated because the corresponding service is not available.
Note
The termination occurred in system BDV with error code 403 and for the reason Forbidden.
The selected virtual host was 0 .
What can I do?
Please select a valid URL.
If you do not yet have a user ID, contact your system administrator.
ErrorCode:ICF-NF-http-c:000-u:SAPSYS-l:E-i:EMHBSSAP15_BDV_27-v:0-s:403-r:Forbidden
HTTP 403 - Forbidden
Your SAP Internet Communication Framework Team
The URL I am trying is
http://emhbssap15.domainname:8027/sap/bc/srt/wsdl/sdef_servicename/wsdl11/ws_policy/document?sap-client=400
Can anyone help me?
Regards,,,
Sunil Joyous
Edited by: Sunil Joyous on Dec 2, 2009 1:52 PMThanks Venu for your input.
Unfortunetly we do not have Java stack on our development system. You said we can test it by SOAP UI tool. Where do I see the WSDL file for the service?
I used WSDL from SE80 --> Service --> WSDL tab, but SOAP UI does not accept this format ?
What are the other ways I can test this web service? I think about SAP PI, importing RFC & creating web service or creating ABAP proxies... Which is the best way to go forward in case you do not have Java stck.
Regards,,,
Sunil Joyous -
Invoke web service created from workshop
Hi,
I am trying to write a stand alone java client to connect to web service created
from workshop( please see the attached wsdl file), but can't get it work. Did
somebody know why. Here is my java client code :
import java.net.URL;
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.Service;
import javax.xml.rpc.Call;
import javax.xml.namespace.QName;
import weblogic.webservice.context.WebServiceContext;
import weblogic.webservice.context.WebServiceSession;
import weblogic.webservice.context.WebServiceHeader;
public class OrderTestClient {
public static void main(String[] args) {
try {
// Setup the global JAXM message factory
System.setProperty("javax.xml.soap.MessageFactory",
"weblogic.webservice.core.soap.MessageFactoryImpl");
// Setup the global JAX-RPC service factory
System.setProperty("javax.xml.rpc.ServiceFactory",
"weblogic.webservice.core.rpc.ServiceFactoryImpl");
// create service factory
ServiceFactory factory = ServiceFactory.newInstance();
// define qnames
//String targetNamespace = "http://localhost/orderweb";
String targetNamespace = "http://www.openuri.org/";
QName serviceName = new QName(targetNamespace, "newsmlorder");
QName portName = new QName(targetNamespace, "newsmlorderSoap");
//QName operationName = new QName("tns:newsmlorderSoap", "getUserAddress");
QName operationName = new QNam("http://localhost:7021/orderweb/", "getUserAddress");
URL wsdlLocation = new URL("http://localhost:7021/orderweb/newsmlorder.jws?WSDL");
// create service
Service service = factory.createService(wsdlLocation, serviceName);
// create call
Call call = service.createCall(portName, operationName);
WebServiceContext wsContext = WebServiceContext.currentContext();
WebServiceSession session =(WebServiceSession)wsContext.getSession();
System.out.println(" Session : " + session.toString() );
System.out.println(" == step 11 ===");
// invoke the remote web service
System.out.println(" == step 12 ===");
String result = (String) call.invoke(new Object[] {"testPing"});
System.out.println("test result : " + result);
catch (Exception e) {
System.out.println("test result : " + e.getMessage());
[order.wsdl]Hi,
I did not get any error, however the service call is always return null even though
I hard code return String, so I knew it failed.
I tried your following code and it worked. You mention that I have to download
proxy.jar from workshop overview page, but I can't find it. Would you please tell
me where to find the download menu in workshop.
If I want to build a dynamic stand alone client to invoke service created from
workshop ( my original approach), what should I do?
I am trying to use workshop to handle multipart soap message (soap message with
attachments), could you please send me a example ?
Very appreciate your help!
Thanks again.
Lina
Vimala Ranganathan" <[email protected]> wrote:
>
>
>
Hi Lina,
Are you getting any errors?
Did you happen to try with a static client? Is that working?
(For static client you have to download the proxy jar from the workshop
overview
page and have it in the classpath)
I have attacjhed the proxy jar and here is a sample client. Let me know
how this
goes.
public class Test
public static void main(String [] args)
Newsmlorder_Impl m_proxyImpl = null;
NewsmlorderSoap m_proxy = null;
try
m_proxyImpl = new Newsmlorder_Impl();
catch (IOException ex)
System.out.println("Error getting proxy");
ex.printStackTrace();
m_proxy = m_proxyImpl.getnewsmlorderSoap();
GetUserAddress p = m_proxy.getUserAddress();
Thanks a lot,
Vimala Ranganathan
"Lina Li" <[email protected]> wrote:
Hi,
I am trying to write a stand alone java client to connect to web service
created
from workshop( please see the attached wsdl file), but can't get itwork.
Did
somebody know why. Here is my java client code :
import java.net.URL;
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.Service;
import javax.xml.rpc.Call;
import javax.xml.namespace.QName;
import weblogic.webservice.context.WebServiceContext;
import weblogic.webservice.context.WebServiceSession;
import weblogic.webservice.context.WebServiceHeader;
public class OrderTestClient {
public static void main(String[] args) {
try {
// Setup the global JAXM message factory
System.setProperty("javax.xml.soap.MessageFactory",
"weblogic.webservice.core.soap.MessageFactoryImpl");
// Setup the global JAX-RPC service factory
System.setProperty("javax.xml.rpc.ServiceFactory",
"weblogic.webservice.core.rpc.ServiceFactoryImpl");
// create service factory
ServiceFactory factory = ServiceFactory.newInstance();
// define qnames
//String targetNamespace = "http://localhost/orderweb";
String targetNamespace = "http://www.openuri.org/";
QName serviceName = new QName(targetNamespace, "newsmlorder");
QName portName = new QName(targetNamespace, "newsmlorderSoap");
//QName operationName = new QName("tns:newsmlorderSoap","getUserAddress");
QName operationName = new QNam("http://localhost:7021/orderweb/",
"getUserAddress");
URL wsdlLocation = new URL("http://localhost:7021/orderweb/newsmlorder.jws?WSDL");
// create service
Service service = factory.createService(wsdlLocation, serviceName);
// create call
Call call = service.createCall(portName, operationName);
WebServiceContext wsContext = WebServiceContext.currentContext();
WebServiceSession session =(WebServiceSession)wsContext.getSession();
System.out.println(" Session : " + session.toString() );
System.out.println(" == step 11 ===");
// invoke the remote web service
System.out.println(" == step 12 ===");
String result = (String) call.invoke(new Object[] {"testPing"});
System.out.println("test result : " + result);
catch (Exception e) {
System.out.println("test result : " + e.getMessage()); -
Adding Faults to Web Services created from JCDs
Is anyone aware of a way to add faults, other than the default JavaException, to the service definition of a web service created from a JCD?
Hi
You could use se80 and click "Repository Information system"->Enterprise Services->
Service Definitions->search your WebService Defition->Delete it. -
Can we change WSDL file created from Function Module wizard??
Hi everybody!
I have created a web service from function module using SAP wizard.
Now the consumer side want me to change <wsp:UsingPolicy wsdl:required="true"/>
Is this possible???
If so how?????
Thank u in advance!!Hi Muhammad!
As soon as you open WSDL for selected binding in the URL are of you explorer change the ws_policy with "standard" . Then simply save the wsdl and send it to the other party.
Hope this helps! -
How to create ENQUEUE function module for s567 table
Hi Experts,
Anyone Plz tell the steps how to create a ENQUEUE function module for the table s567.
Its somewht urgent, plz help me.
<REMOVED BY MODERATOR>
Mohana
Edited by: Alvaro Tejada Galindo on Mar 10, 2008 4:21 PMHi,
You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
Technicaly:
When you create a lock object System automatically creat two function module.
1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
You have to use these function module in your program.
Hope this will give a basic idea.
Regards
Sudheer -
Is possible to compare a web service like a function module ?
Hello all,
I'm new in ABAP web service ( not java, not PI ). I have to create a web service to send some file
from sap system towards external system and I'm learing some documentation.
To send a file with web service I need to create an interface with Internet Comunication Manager and
when this interface is created,
how can I send my file with web service ? I need to create a FM or other object ?
tks a lot,
bye.a fm is accessible via ws
-
Programatically calling Web Service DataControl from App Module
Hey,
I've been following the 4GL ADF tutorial recently but have a question regarding initiating a web service call instead of using an entity object. The tutorial I am using is located at:
http://www.oracle.com/technology/products/adf/learnadf.html
On Page 102 - Adding Custom Methods to the Application Module there is a little piece of code to transfer some data from a transient view object into an entity object. The code is
public void createNewServiceRequestFromGlobals() {
ServiceRequestImpl sr =
(ServiceRequestImpl)getDBTransaction().createEntityInstance(ServiceReques
tImpl.getDefinitionObject(),null);
Row globalsRow = getGlobals().first();
sr.setProblemDescription((String)globalsRow.getAttribute("ProblemDescript
ion"));
sr.setProdId((Number)globalsRow.getAttribute("ProductId"));
getDBTransaction().commit();
What I would really like to be able to do is use a web service datacontrol instead of the entity object. Can anyone point me in the right direction?
Thanks,
MarkI have the same problem
1. I have a data control what is a web service client to URL https:
2. JDev 11g build a model
3. I need to call this data control from java class
4. My java class simply must call a method of the web service, this method I see in the DAta Control, with the parameter and just return the String,
5. this is not a Web Application, is swing, I not have a Context
method in WS
public String ConsultaPlaca(String arg1);
How I can implement this?
Just in Java Class, not in page JSP. the java class is a library of other Java class, I need to build a file .jar -
Error when workflow created from Function Module
Hi All,
I am trying to implement leave module workflow for one of my requirement.
when i create a leave from PTARQ transaction workflow it is being triggered, but when i tried to do the same from a custom function Module using the same FMs used in PTARQ, workflow initiated but stopped at initial stage( at switch branch )
i went to SWI1 transaction and executed it manually, it end up with error saying ' Error when starting a SWITCH branch'
what should i do to move it forward.
Thanks,
Krish.Hi Kishore,
For leave workflow, SAP has the separate frame work. They called the FM SAP_WAPI_START_WORKFLOW and pass all necessary data's to Process the leave workflow.
Its not advisable to overwrite the standard behavior. Please check your 'REQ' workflow container in the log. There will be a no data or Some data's might be Missed.
Before Call the FM, make sure that all data's are passed to the Table parameter, SImple_Container.
The reason for the Error in your workflow is, there is no data stored in REQ.STATUS container.
please check the Workflow log.
Thanks. -
Detele Web Services created from BAPIs
Hello,
I just created some Web Services from some BAPIs using the wizard. I would like to rebuild these WSs, but first of all I should delete them.
I can see them with transaction WSCONFIG, but I can't find a way to delete them.
Can you tell me how to completely delete them?
Yours,
jmiturbeHi
You could use se80 and click "Repository Information system"->Enterprise Services->
Service Definitions->search your WebService Defition->Delete it. -
Generic Extraction By Using function Module with Three Table fields?
Hi,
I need to bring the data from three tables by using function module.
Tables: VBAK, VBAP, VBUK.
Fields are: VBELN, ERDAT, NETWR, WEARK, POSNR, MATNR, FKART, FKTYP.
i referred some of the documents in SDN, it explained by using two table fields.
Please help me.hi, the below pseudo code should help you on creating the logic. It's based on the how to paper. So i just used the parts of intrest. You need to copy the rest form the document. Please notice that this is pseudo code. if you just copy/paste, it will not work.
IF s_counter_datapakid = 0.
OPEN CURSOR WITH HOLD s_cursor FOR
SELECT fields FROM table1 WHERE condition
ENDIF. "First data package ?
* Fetch records into interface table.
* named E_T_'Name of extract structure'.
FETCH NEXT CURSOR s_cursor
INTO TABLE e_t_data
PACKAGE SIZE s_s_if-maxsize.
IF sy-subrc EQ 0.
SELECT fields FROM table2 WHERE condition into itab2 for all entries in e_t_data
SELECT fields FROM table3 WHERE condition into itab3 for all entries in e_t_data
loop at e_t_data
read itab2. move corresponding fields to e_t_data
read itab3. move corresponding fields to e_t_data
collect e_t_data.
endif.
IF sy-subrc <> 0.
CLOSE CURSOR s_cursor.
RAISE no_more_data.
ENDIF.
s_counter_datapakid = s_counter_datapakid + 1.
ENDIF. "Initialization mode or data extraction ? -
How to creat web service for a function module?
who can provide me some resource on the topic.
thanks
Johnney.Hi John,
http://help.sap.com/saphelp_nw04/helpdata/en/e9/ae1b9a5d2cef4ea4b579f19d902871/content.htm
Reward Points if Useful
All the Best
Gokul -
Error creating a web service client from th WSDL document (soamanager)
Hello everyone,
we have generate with the wizard a web-service using the function module BAPI_CONTROL_RECIPE_GET_LIST. Then we have generated with SOAMANAGER the end point. As test, we have used a web-service explorer of Eclispe and we can retrieve without problems the data.
Then we wanted to generate the web-servcie client with Eclipse Galileo (3.5.0) wiith the server GlassFish v2.1 Java EE 5 we first installed the WSIT jars, in order to support WS-RM protocol
We have started the generation based on the document obtainend within the soamanager under the "Open WSDL document for selected binding" link.
We have tried it several times and we always got the following error is:
IWAB0399E Error in generating Java from WSDL: WSDLException (at /wsdl:definitions/wsdl:portType/wsp:Policy):
faultCode=INVALID_WSDL: Encountered unexpected element 'Policy'.: <br>
WSDLException (at /wsdl:definitions/wsdl:portType/wsp:Policy): faultCode=INVALID_WSDL: Encountered unexpected element 'Policy'.:
at com.ibm.wsdl.util.xml.DOMUtils.throwWSDLException(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parsePortType(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:516)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
at java.lang.Thread.run(Unknown Source)
Do you know if we took the right document in order to generate the web-service client? Do we need to have some specifics settings in the configurations of th endpoint? (provider security, transport settings, etc...?)
If needed, or if someone would be nice enough to try to generate it on its side, I can post here the whole wsdl document, but due to its length, I first wait your comments.
Thanks a lot in advance for your feed-back
best regards
Pierre-André
addtions:
maybe this should have been better posted within the forum Service-Oriented Architecture than standards?
I forgot to mention the following threads, which seems to me to be somehow in this direction. But I do not get really how I could use them, or how is is releated.
Edited by: Pierre-andre Jacquod on Sep 23, 2009 4:02 PMHi,
I am facing the same issue while generating the client java class from IBM RAD 6.0.
Here is the error I am getting.
WSDLException (at /wsdl:definitions/wsdl:portType/wsp:Policy): faultCode=INVALID_WSDL: Encountered unexpected element 'Policy'.:
[java] at com.ibm.wsdl.util.xml.DOMUtils.throwWSDLException(Unknown Source)
[java] at com.ibm.wsdl.xml.WSDLReaderImpl.parsePortType(Unknown Source)
[java] at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
[java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
[java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
[java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
[java] at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:516)
[java] at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
[java] at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
[java] at java.lang.Thread.run(Thread.java:571)
Please guide me to resolve this issue.
Thanks & Regards,
Vijay -
How to create Function Module with TABLE parameter (for internal table)
Hi Guys,
I am trying to create a function module by using TABLE parameter. I have to pass an internal table to this function module for processing.
But it saying : TABLES parameters are obsolete!
And I am not going further.
Please suggest any work arround.
ThanksHi,
create a table type in SE11..
Then use that in your function module importing/exporting/changing parameter for passing internal tables..
Thanks,
Naren -
How can create a function module for currency and quantity fields
hi,
i want to create a function module with some fields.when i activated it give some errors for
netpr,menge,wemng fields(currency, quantity fields).error is it asks for reference fields.
please send me solution for it.
sreenu.Hi Sreenu,
While creating CURRENCY/QUANTITY fields in the DataBase Table, you have to enter a REFERENCE TABLE and a REFERENCE FIELD to the field.
For that, after entering the field name and the data type in the correcponding columns, you have to place the cursor on the data type of the required field and click the CURRENCY/QUANTITY FIELDS tab. You will find two columns called REFERENCE TABLE and a REFERENCE FIELD.
you have to enter a reference table in which a currency/quantity field is used and a reference field which is a currency/quantity field in that table.
For Example, below is the table details.
FIELD DATATYPE LENGTH DEC.PLACES REF.TABLE REF.FIELD
1.SNO CHAR 5
2.AMOUNT CURR 10 2 T001 WAERS
3.NOS QUAN 5 KNA1 /VSO/R_PAL_UL
Here Field 2(AMOUNT) is a CURR field whose Ref. Table is T001 and Ref. Field is WAERS and Field 3(NOS) is a QUAN field whose Ref. Table is KNA1 and Ref. Field is /VSO/R_PAL_UL.
Hope this will help you.
Regards,
Vaitheeswaran
Maybe you are looking for
-
I am using currently gmail and the system just stops (often) when I do anything with it (that requires input ie. write or reply to email.) It sometimes just stops and if I see it fast enough and and wait for about 5 minutes it will catch up. Other ti
-
Can you have more than one alert at a time show up on the lock screen?
When i recieve a new message, this shows up as an alert on the lock screen when my phone is locked, as its supposed to. However, if a new alert comes through before i open the previous one, only the most recent one will appear on the lock screen. Is
-
Hi, I've configured a procedure for Import Proc.wherein i need to add the Freight, Ins, Basic customs, Ecess & SEcess on Basic Customs to be inventorised. When i receivr th goods in MKIGO, only Basic Customs component is getting inventorised but not
-
Premiere elements 11 won't load
Premiere element 11 will not load on my Windows 7 PC. Running the adobe premier elements11.exe file has no effect at all. Any help would be gratefully received!
-
Hi! So in school, I am required to write up a newspaper and conveniently I have a Late 2013 Retina 13.3" Macbook Pro. After playing around with the pages Newsletter templates, I decided to go with the first option. However I could not find any option