Gary Williams
12-04-2005, 10:03 AM
Hi All,
I have the following vbs script on my server. When I run this script, I get the error message below regarding line 2.
I have installed SOAP Toolkit 3.0 on the server so it does have MSXML available plus other SOAP/XML scripts work fine.
Any ideas?
Regards
Gary
==================
CLIENT.VBS SCRIPT
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>" & _
"</soap:envelope>"
'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", _
"urn:myserver/soap:TaxCalculator#GetSalesTax"
'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 = _
"SOAP:Envelope/SOAP:Body/m:GetSalesTaxResponse/SalesTax"
dblTax = objReturn.selectSingleNode(strQuery).Text
Debug.Print dblTax
End Sub
========================
ERROR MESSAGE
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
D:\website\www\client.vbs(2, 13) Microsoft VBScript compilation error: Expected end of statement
========================
I have the following vbs script on my server. When I run this script, I get the error message below regarding line 2.
I have installed SOAP Toolkit 3.0 on the server so it does have MSXML available plus other SOAP/XML scripts work fine.
Any ideas?
Regards
Gary
==================
CLIENT.VBS SCRIPT
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>" & _
"</soap:envelope>"
'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", _
"urn:myserver/soap:TaxCalculator#GetSalesTax"
'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 = _
"SOAP:Envelope/SOAP:Body/m:GetSalesTaxResponse/SalesTax"
dblTax = objReturn.selectSingleNode(strQuery).Text
Debug.Print dblTax
End Sub
========================
ERROR MESSAGE
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
D:\website\www\client.vbs(2, 13) Microsoft VBScript compilation error: Expected end of statement
========================