Private Sub cmdDoIt_Click() ' WSDL filename comes from a text box DoItRopeDomLL (txtWSDL.Text) DoItRopeDomHL (txtWSDL.Text) End Sub Private Sub SerializeXMLElement(Serializer As SoapSerializer, Element) Dim child Dim childList As IXMLDOMNodeList If Element.nodeTypeString = "element" Then Serializer.startElement Element.nodeName, , "" Set childList = Element.childNodes For Each child In childList If childList.length > 0 Then If child.nodeTypeString = "element" Then Call SerializeXMLElement(Serializer, child) Else Serializer.writeString Element.Text End If End If Next Serializer.endElement Else Serializer.writeString Element.Text End If End Sub ' make a SOAP call using the MSSoapToolkit using the Low Level Interface Private Sub DoItRopeDomLL(ByVal WSDL As String) Dim TempDoc As DOMDocument30 Dim root As IXMLDOMElement ' load example xml for transmission Set TempDoc = New DOMDocument30 TempDoc.Load ("example.xml") Dim Serializer As SoapSerializer Dim Reader As SoapReader Dim ResultElm As IXMLDOMElement Dim FaultElm As IXMLDOMElement Dim Connector As SoapConnector Dim xmlLiteral As String ' create the connection Set Connector = New WinInetConnector Connector.Property("EndPointURL") = "http://localhost:8080/soap/servlet/rpcrouter" Connector.Connect Nothing Connector.Property("SoapAction") = "urn:B2BService" Connector.BeginMessage Nothing Set Serializer = New SoapSerializer Serializer.Init Connector.InputStream ' create the SOAP envelope and contents Serializer.startEnvelope , "" Serializer.startBody "" Serializer.startElement "sendMessage", "urn:B2BService", "http://schemas.xmlsoap.org/soap/encoding/", "m" Serializer.startElement "stringDocument", , "http://schemas.xmlsoap.org/soap/encoding/" ' iterate through the XML document adding the elements and attributes to the ' SOAP envelope as required Set root = TempDoc.documentElement Call SerializeXMLElement(Serializer, root) Serializer.endElement Serializer.endElement Serializer.endBody Serializer.endEnvelope ' make the call Connector.EndMessage ' read the result Set Reader = New SoapReader Reader.Load Connector.OutputStream If Not Reader.Fault Is Nothing Then MsgBox Reader.faultstring.Text, vbExclamation Else MsgBox Reader.RPCResult.Text, vbExclamation End If End Sub ' make a SOAP call using the MSSoapToolkit using the High Level Interface Private Sub DoItRopeDomHL(ByVal WSDL As String) Dim Client As SoapClient Dim OutputParam Dim stringDocument As IXMLDOMElement Dim TempDoc As DOMDocument30 Set Client = New SoapClient On Error GoTo ErrorHandler Client.mssoapinit WSDL ' load example xml for transmission Set TempDoc = New DOMDocument30 TempDoc.Load ("example.xml") Set stringDocument = TempDoc.documentElement If TempDoc.parseError.errorCode = 0 Then ' make the call OutputParam = Client.sendMessage(stringDocument) ' put the result into a text box on screen Text1.Text = OutputParam Else MsgBox "XML Parse Error - " + TempDoc.parseError.reason, vbExclamation End If Exit Sub ErrorHandler: If Client.faultstring = "" Then Text1.Text = Client.faultcode + Client.faultstring + Client.faultactor + Client.detail MsgBox Err.Description, vbExclamation Else MsgBox Client.faultstring, vbExclamation End If End Sub