ISOAPNodes::Create Method

HRESULT Create([in] BSTR Name, [in] VARIANT Val, [in, defaultvalue(L"")] BSTR Namespace, [in, defaultvalue(L"")] BSTR Type, [in, defaultvalue(L"")] BSTR TypeNamespace, [out, retval] ISOAPNode ** newNode);

This allows you to create and initialize a new node, and add it to the collection, all the one go. This makes it easy to build up parameter and other nodes.

 

Parameters

Name
BSTR, [in]: Set the name of the new node to this
Val
VARIANT, [in]: Set the node value to this
Namespace
BSTR, [in, defaultvalue(L"")]: Set the namespace URI of the name to this
Type
BSTR, [in, defaultvalue(L"")]: Set the name of the XmlType to this
TypeNamespace
BSTR, [in, defaultvalue(L"")]: Set the namespace URI of the XmlType to this
newNode
ISOAPNode **, [out, retval]: returns a pointer to the new node.

 

Return Values

returns a pointer to the newly created node object.

 

Sample Code

dim e , n
set e = CreateObject("pocketSOAP.Envelope.2")
e.SetMethod "echoStruct", "http://soapinterop.org/"
set n = e.Parameters.Create ( "inputStruct", "", "", "SOAPStruct", "http://soapinterop.org/xsd")
n.Nodes.Create "varString", "string"
n.Nodes.Create "varFloat", 123.456
n.Nodes.Create "varInt", 42
wscript.echo e.serialize
' prints
<S:Envelope
        S:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'
        xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'
        xmlns:E='http://schemas.xmlsoap.org/soap/encoding/'
        xmlns:a='http://soapinterop.org/'
        xmlns:b='http://soapinterop.org/xsd'
        xmlns:c='http://www.w3.org/2001/XMLSchema-instance'
        xmlns:d='http://www.w3.org/2001/XMLSchema'>
<S:Body><a:echoStruct><inputStruct href='#a'/>
</a:echoStruct>
<b:SOAPStruct E:root='0' id='a' c:type='b:SOAPStruct'><varString c:type='d:string'>string</varString>
<varFloat c:type='d:double'>123.456</varFloat>
<varInt c:type='d:short'>42</varInt>
</b:SOAPStruct>
</S:Body></S:Envelope>

 

See Also

The ISOAPNodes Interface | 

 

 

Copyright

Copyright © Simon Fell, 2000-2004. All rights reserved.