Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 7th, 2006, 09:35 PM
Registered User
 
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to lchandrathil Send a message via Yahoo to lchandrathil
Default 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.
 
Old July 14th, 2006, 07:28 AM
Registered User
 
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to lchandrathil Send a message via Yahoo to lchandrathil
Default

anybody has a solution? please help. URGENT!!!!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Communicating two PCs over the Intenet mirfanm C# 2005 0 March 9th, 2007 08:42 AM
Vb6 component from web service pzmrcd General .NET 0 September 9th, 2006 05:05 PM
communicating with usb port Lookie VB How-To 1 March 2nd, 2005 11:53 PM
Integrating Web Service with VB6 anubhav.kumar ASP.NET 1.0 and 1.1 Basics 0 October 30th, 2004 01:26 AM
communicating with another application Evolving_App J2EE 0 December 5th, 2003 03:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.