15
SOAP and Web Services
Using SOAP and Web Services
// We will create an integer object compliant with the XSD standard:
var myIntegerObject = {
soapType: "xsd:int",
soapValue: "10"
};
var result = myProxy.echoInteger(myIntegerObject);
// Display the response in the console:
console.println("Result is " + result);
Note that each call to a web method generates a SOAP envelope that is delivered to the
web service, and that the return value is extracted from the corresponding envelope
returned by the web service. Also, since XML relies on text, there is no problem sending a
string to the web service. In the case of integers, however, it is necessary to create an XSD-
compliant object to represent the integer value. Acrobat JavaScript does support some of
the standard data types specified in the XSD. These are shown below in
Table 15.2:
T
ABLE
15.2
XSD-Compliant Data Types Supported in JavaScript
JavaScript Type
Equivalent XSD-Compliant Type
String
Number
Date
Boolean
ReadStream
Array
xsd:string
xsd:float
xsd:dateTime
xsd:boolean
SOAP-ENC:base64
SOAP-ENC:Array
246
Acrobat JavaScript Scripting Guide