VB Client Code

Sub Main()
  Dim objHTTP As New MSXML.XMLHTTPRequest
  Dim strEnvelope As String
  Dim strReturn As String
  Dim objReturn As New MSXML.DOMDocument
  Dim dblTax As Double
  Dim strQuery As String
  'Create the SOAP Envelope
  strEnvelope = _
    "<soap:envelope xmlns:soap=""urn:schemas-xmlsoap-org:soap.v1"">" & _
    "<soap:header></soap:header>" & _
    "<soap:body>" & _
    "<m:getsalestax xmlns:m=""urn:myserver/soap:TaxCalculator"">" & _
    "<salestotal>100</salestotal>" & _
    "</m:getsalestax>" & _
    "</soap:body>" & _
  'Set up to post to our local server
  objHTTP.open "post", "http://localhost/soap.asp", False
  'Set a standard SOAP/ XML header for the content-type
  objHTTP.setRequestHeader "Content-Type", "text/xml"
  'Set a header for the method to be called
  objHTTP.setRequestHeader "SOAPMethodName", _
  'Make the SOAP call
  objHTTP.send strEnvelope
  'Get the return envelope
  strReturn = objHTTP.responseText
  'Load the return envelope into a DOM
  objReturn.loadXML strReturn
  'Query the return envelope
  strQuery = _
  dblTax = objReturn.selectSingleNode(strQuery).Text
  Debug.Print dblTax
End Sub

You might also like...



Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC. As potential programmers, they are mentally mutilated beyond hope of regeneration.” - E. W. Dijkstra