Parameter | Description |
---|---|
hoNode | The handle to an XML element node to be added as a SOAP Header. |
Procedure AddSoapHeaderNode Handle hoNode
Call: | Send AddSoapHeaderNode hoNode |
AddSoapHeaderNode is used to add SOAP headers to a method's SOAP response. This is a low level mechanism. It is expected that a developer using this method understands SOAP headers and understands how to work with XML objects. The above SOAP header could be created as follows: SOAP request headers may be processed by using the SoapHeaderRequestNode method.
The handle passed to this method must be a handle to an XML element object (cXMLDomElement). If an element node is not passed, an error will be generated.
Note that you do need to pass the actual SOAP <SOAP-ENV:Header
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<Transaction xmlns="some-URI">5</Transaction>
</SOAP-ENV:Header>
Get Create U_cXmlDomDocument to hoXml
Get CreateDocumentElementNS of hoXml "some-URI" "Transaction" to hoRoot
Set psText of hoRoot to "5"
Send AddSoapHeaderNode hoRoot
Send Destroy of hoXml
The following example demonstrates how to get all requested SOAP headers and return them as response SOAP headers.Get SoapHeaderRequestNode to hoXml // get the SOAP request header
If (hoXml) Begin
Get DocumentElement of hoXML to hoRoot // this will be <header>
// Get all SOAP request child nodes
Get FirstChild of hoRoot to hoNode
While hoNode
Send AddSoapHeaderNode hoNode // Add to response header
Get NextNode of hoNode to hoNode
Loop
Send Destroy of hoXml
End
See Also