SOAP and Web Services
Using SOAP and Web Services
15
SOAP and Web Services Topics
Using a WSDL Proxy to Invoke a Web Service
Synchronous and Asynchronous Information Exchange
Using Document/Literal Encoding
Exchanging File Attachments and Binary Data
Converting Between String and ReadStream Information
Accessing SOAP Version Information
Accessing SOAP Header Information
Authentication
Error Handling
Using a WSDL Proxy to Invoke a Web Service
When connecting to a web service, your Acrobat JavaScript code may use a WSDL proxy
object to generate a SOAP envelope. The envelope contains a request for the server to run a
web method on behalf of the client. To obtain the WSDL proxy object, invoke the
SOAP
object’s
connect
method, which accepts a single parameter containing the HTTP or
HTTPS URL of the WSDL document.
The returned proxy object contains the web methods available in the web service
described by the WSDL document. If the web service uses SOAP/RPC encoding, the
parameters in the proxy object’s methods will match the order specified in the WSDL
document. If the web service uses document/literal encoding, the methods will accept a
single parameter describing the request message.
In the example shown below, a connection to a web service will be established, and its RPC-
encoded web methods will be invoked. Assume that
myURL
contains the address of the
WSDL document:
// Obtain the WSDL proxy object:
var myProxy = SOAP.connect(myURL);
// Invoke the echoString web service, which requires a string parameter:
var testString = "This is a test string.";
var result = myProxy.echoString(testString);
// Display the response in the console:
console.println("Result is " + result);
// Invoke the echoInteger web service, which requires an integer parameter:
// Since JavaScript does not support XSD-compliant integer values,
Acrobat JavaScript Scripting Guide
245