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.
returns a pointer to the newly created node object.
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>
Copyright © Simon Fell, 2000-2004. All rights reserved.