problem communicating with web serice using vb6
hi,
I have a web service which i am trying to communicate with, using a vb6 client thru XMLHTTP. I am passing the request to the web service using a soap envelope. The problem is that the parameter that I pass to the method in the web service, somehow is null when received at the web service. I guess it is an encoding issue. The parameter is an XML string which is loaded into an XMLDocument. The web service is running fine since i get a valid reply if i invoke the method passing the same parameter string from the browser.
Here is how I am doing it:
oXMLHTTP.open "POST", "http://rajeshp/Myservice/pgwebservice.asmx", False
Dim strParam As String
strParam = "<XMLQueue><InputXML><BookingRef>304</BookingRef><CompanyCode>PX</CompanyCode><CompanyId>PX</CompanyId><SaleValue>1.50</SaleValue><SaleCurrency>INR</SaleCurrency><Modifier>0008</Modifier><CardNumber>RT1234567891234$</CardNumber><CardType>VISA</CardType><CV2>111</CV2><StartDate>000</StartDate><IssueNumber></IssueNumber><BillingAddress>Tesst</BillingAddress><PostCode>999</PostCode><CardHolderName>TEST</CardHolderName><ExpiryDate>0107</ExpiryDate><TransactionType>01</TransactionType></InputXML></XMLQueue>"
'strParam = Replace(strParam, "<", "<")
'strParam = Replace(strParam, ">", ">")
Dim sBody As String
sBody = "<soap:Envelope" & _
" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""" & _
" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""" & _
" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" & _
"<soap:Body>" & _
"<m:AuthRequest xmlns:m=""http://myproject.com/PGWebService"">" & _
"<xmlQuery>" & strParam & "</xmlQuery>" & _
"</m:AuthRequest>" & _
"</soap:Body>" & _
"</soap:Envelope>"
oXMLHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
oXMLHTTP.setRequestHeader "SOAPAction", "http://myproject.com/PGWebService/AuthRequest"
oXMLHTTP.send sBody
MsgBox oXMLHTTP.responseText
Thanks in advance.
|