SoapHeaderResponseNode - cClientWebService
Returns SOAP header response information passed from the web service as an XML object.
Type: Function
Return Data Type: Handle
Syntax
Function SoapHeaderResponseNode Returns Handle
Call Example
Get SoapHeaderResponseNode to HandleVariable
Description
The SoapHeaderResponseNode provides a low level mechanism for processing SOAP header information returned from a web service method. It is expected that a developer using this method understands SOAP headers and understands how to work with XML objects.
The object handle returned will be a handle to an XML document object (cXMLDomDocument) and represents the entire SOAP header XML node. The root node of this document will be the SOAP node and each child node should be an element node representing a header.
If a SOAP Header is not passed to the method, which is the norm, zero is returned.
It is the responsibility of the method to destroy the XML object.
<SOAP-ENV:Header
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<t:Transaction xmlns:t="some-URI-1">5</t:Transaction>
<UserId xmlns="some-URI-2">XXX</UserId>
<RetryCount xmlns="some-URI-2">2</RetryCount>
</SOAP-ENV:Header>
The following example processes all SOAP headers passed back from a web service invocation.
Procedure CallTheService
Handle hoXml hoRoot hoNode
String sName sReply
String sBase sNSURI sValue
// invoke the service
Get Value of oRequest to sName
Get wsSayHello of oWSTestService1 sName to sReply
Set value of oResponse to sReply
// process all SOAP response headers
Get SoapHeaderResponseNode of oWSTestService1 to hoXml
Set phoHeader to hoXml
If (hoXml) Begin
Get DocumentElement of hoXML to hoRoot // this is <Header>
// process all nodes within the SOAP header
Get FirstChild of hoRoot to hoNode
While hoNode
Get psNamespaceURI of hoNode to sNSURI
Get psBaseName of hoNode to sBase
Get psText of hoNode to sValue
Send ProceessThisHeader sNSURI sBase sValue
Get NextNode of hoNode to hoNode
Loop
Send Destroy of hoXml
End
End_Procedure
See Also
ClearSoapHeaders | AddSoapHeaderNode | SoapHeaderRequestNode
Return Value
Returns object handle of the XML object representing the SOAP header returned from the web service call. If no SOAP header exists, zero it returned.