Skip to Content
0
Former Member
Oct 11, 2010 at 11:29 AM

Call ABAP Web Service with Java code only

304 Views

Hi all,

First of all, I am writing script in Adobe form but am not using the one in SAP.

I am trying to call the web service and process the result with script open (i.e. no dataconnection created), because I am trying to do that in a dialog.

I can call a non-SAP web service without problem, but I am not able to call a simple web service with only a single string input, anyone have any example?

Here is the SOAP for input:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sap-com:document:sap:rfc:functions">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:Z_RFC_GET_STAFF_BANK_INFO>
         <A_STAFF_ID>0123456</A_STAFF_ID>
      </urn:Z_RFC_GET_STAFF_BANK_INFO>
   </soapenv:Body>
</soapenv:Envelope>

Here is my code to call:

	var cURL = "http://some-host-name:port/sap/bc/srt/wsdl/bndg_DEDB492BB032E7F1B09F001CC4FBCEC9/wsdl11/allinone/ws_policy/document?sap-client=300";
	
	var response = SOAP.request(
	{
		cURL: cURL, 
		oRequest: {
			"urn:sap-com:document:sap:rfc:functions:Z_RFC_GET_STAFF_BANK_INFO": {
				A_STAFF_ID: "0123456"
				}
		}
	});

Regards

Bill