I need to make a modification to a soap message some code is generating, and I need a hand.
The short explanation is as follows:
Here’s the SOAP Message:
SOAP Message 1
-
<SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”>
-
Bob Smith
1989-09-01
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
All I need to do is add a different namespace, in this case an empty string, to REC1, eg . The code that generates the message above is below. URI = http://dev.server/test. If I uncomment out the code (marked ****), and comment out the line above (####), I get message 2 with the namespace against each sub-node, as seen below.
Any thoughts?
Al
Code:
Set docProfile = dbThis.GetProfileDocument( conTestProfileDoc )
Set objDoc = CreateObject( “Msxml2.DOMDocument.6.0” )
’ — create a SOAP Envelope node
Set objEnvelope = objDoc.createNode( conXML_Node_Element, conSOAP_PREFIX & “:Envelope”, conURI )
’ — set encodingStyle attribute
objEnvelope.setAttribute “encodingStyle”, conENC
— set the new element as the “root” node of the DOM tree
Set objDoc.documentElement = objEnvelope
’ — create a SOAP Body node
Set objBody = objDoc.createNode( conXML_Node_Element, conSOAP_PREFIX & “:Body”, conSOAP_ENV_URI )
’ — make Body node a child of the Envelope node
objEnvelope.appendChild objBody
Set objNode = objDoc.createNode( conXML_Node_Element, “VerifyRecord”, conSOAP_Namespace )
objDoc.documentElement.lastChild.appendChild objNode
Set objREC1 = objDoc.createNode( conXML_Node_Element, “REC1”, conSOAP_Namespace)
‘Set objREC1 = objDoc.createNode( conXML_Node_Element, “REC1”, “”)
objNode.appendChild objREC1
Call AddNode( objDoc, objREC1, “Name”, strName)
Call AddNode( objDoc, objREC1, “DateOfBirth”, dtDOB)
Set objHttp = CreateObject( “Msxml2.ServerXMLHTTP.6.0” )
SOAP Message 2
-
<SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”>
-
Bob Smith
1998-09-01
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>