15
SOAP and Web Services
Using SOAP and Web Services
Accessing SOAP Version Information
Acrobat 7.0 provides improved support for SOAP Version 1.1 and support for Version 1.2. To
encode the message using a specific version, assign one of the following values to the
request
method’s
cVersion
parameter:
SOAPVersion.version_1_1
(SOAP
Version 1.1) or
SOAPVersion.version_1_2
(SOAP Version 1.2). Its usage is shown in
the following example:
var response = SOAP.request ({
cURL: myURL,
oRequest: myRequest,
cVersion: SOAPVersion.version_1_2
});
Accessing SOAP Header Information
You may send SOAP header information to the web service using the
request
method’s
oReqHeader
parameter, and access the returned header information using the
oRespHeader
parameter. The
oReqHeader
is identical to the
oRequest
object, with
the addition of two attributes:
●
●
soapActor
: the SOAP actor that should interpret the header
soapMustUnderstand
: determines whether the SOAP actor must understand the
header contents
Their usage is shown in the following example:
// Set up the namespace to be used:
var myNamespace = "http://mydomain/methods/:";
// Create the oReqHeader parameter:
var sendHeader = {};
sendHeader[myNamespace + "testSession"] = {
soapType: "xsd:string",
soapValue: "Header Test String"
};
// Create the intially empty oRespHeader parameter:
var responseHeader = {};
responseHeader[myNamespace + "echoHeader"] = {};
// Exchange header information with the web service:
var response = SOAP.request({
cURL: myURL,
oRequest: {},
cAction: "http://mydomain/methods",
oReqHeader: sendHeader,
oRespHeader: responseHeader
});
254
Acrobat JavaScript Scripting Guide