views:

18

answers:

0

I want to achieve the following XML:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  <s:Body>
    <GetStockOnSO xmlns="http://schneider-electric.com/OrderEntryService"&gt;
      <requestData xmlns:dc="http://schemas.datacontract.org/2004/07/Services.OrderEntry.DataContracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
        <dc:StockCode>60686</dc:StockCode>
        <dc:Warehouse>FA</dc:Warehouse>
      </requestData>
    </GetStockOnSO>
  </s:Body>
</s:Envelope>

What xmlDom document nodes do I need to call to build the above? I have the following code, and have put "???" where I do not know how to specify the namespace.

Dim requestDoc
Set requestDoc = WScript.CreateObject("MSXML2.DOMDocument.6.0")

Dim root
Set root = requestDoc.createNode(1, "Envelope", "http://schemas.xmlsoap.org/soap/envelope/")
requestDoc.appendChild root

Dim bodyNode
Set bodyNode = requestDoc.createNode(1, "Body", "http://schemas.xmlsoap.org/soap/envelope/")
root.appendChild bodyNode

Dim operationNode
Set operationNode = requestDoc.createNode(1, methodName, "http://schneider-electric.com/OrderEntryService")
bodyNode.appendChild operationNode

Dim requestDataNode 
Set requestDataNode = requestDoc.createNode(1, "requestData", "???")

dim parameterNode
Set parameterNode = requestDoc.createNode(1, "dc:StockCode", "???")
parameterNode.text = "60686"
requestDataNode.appendChild parameterNode

Set parameterNode = requestDoc.createNode(1, "dc:Warehouse", "???")
parameterNode.text = "FA"
requestDataNode.appendChild parameterNode

operationNode.appendChild requestDataNode

Dim requestXML
requestXML = requestDoc.xml

It is this last requestXML that I would like to be equal to the XML indicated at the beginning of this post.