Hi,
I Am New To SOAP Through VB. I am getting following error
" Method 'Send' Of 'IXMLHTTPRequest' Failed".
Error Number := -2146697211
.
I am sending you the code for consideration.
Option Explicit
Dim objHTP 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
''Declaration Ends Here
Private Sub tax_cal()
'Create SOAP Envelope
strEnvelope = ""
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>" & Val(txt_Sale.Text) & "<salestotal>" & _
"</m:getsalestax>" & _
"</Soap: Body>" & _
"</Soap: Envelope>"
'Setup To Post To Our Local Server
objHTP.open "post", "http://localhost/soap.asp", False
'Set A Standard SOAP / XML Header For The Content-Type
objHTP.setRequestHeader "Content-Type", "text/xml"
'Set A Header For The Method To Be Called
objHTP.setRequestHeader "SOAPMethodName", "urn:myserver/soap:Taxcalcultor#GetSalesTax"
'Make The SOAP Call
objHTP.send strEnvelope
'Get The Return Envelope
strreturn = objHTP.responseText
'Load The Return Envelope Into A DOM
objReturn.loadXML strreturn
'Query The Return Envelope
strQuery = "SOAP:Envelope/SOAP:Body/m:GetSalesTaxResponse/SalesTax"
dblTax = objReturn.selectSingleNode(strQuery).Text
txt_Tax.Text = dblTax
End Sub