Results 1 to 4 of 4

Thread: Web Reference in Visual Basic 6?

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2004
    Location
    Mississippi
    Posts
    54

    Web Reference in Visual Basic 6?

    I understand the .NET stuff has Add-> Web Reference capability built in, where you simply supply the WSDL URL to the wizard but is there any way to do create a Web Reference in Visual Basic 6?

    ...if not, how can I do this using another method in Visual Basic 6?

    Basically, the 3rd party company we wish to interact with has given us the WSDL URL, and two methods - sendRequest() and getResponse().

    What about the following with the Inet control:

    VB Code:
    1. Dim PostData As String
    2.     Dim Headers As String
    3.  
    4.     Inet1.Protocol = icHTTPS
    5.     Inet1.RemoteHost = "companywebsite.com"
    6.     Inet1.RemotePort = 443
    7.     Inet1.Document = "/stspost"
    8.     Inet1.UserName = "userID"
    9.     Inet1.Password = "password"
    10.    
    11.     PostData = "sendRequest=REQUEST GOES HERE (FIXED-LENGTH TEXT)"
    12.     Headers = "Content-Type: application/x-www-form-urlencoded" & vbCrLf
    13.    
    14.     Inet1.Execute , "Post", PostData, Headers

    Thanks for any help you guys can give!

  2. #2

    Thread Starter
    Member
    Join Date
    Oct 2004
    Location
    Mississippi
    Posts
    54

    Re: Web Reference in Visual Basic 6?

    Well, I got that to actually submit and get some feedback, but now it's coming back in XML, apparently. Here's what dumps to the textbox:

    <?xml version='1.0' encoding='UTF-8'?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
    <SOAP-ENV:Fault>
    <faultcode>SOAP-ENV:Client</faultcode>
    <faultstring>parsing error: oracle.xml.parser.v2.XMLParseException: Start of root element expected.</faultstring>
    <faultactor>/web-services/Auth</faultactor>
    </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Not sure, but maybe it's time to just go ahead and jump into .NET.

    Money-wise, it's no problem for me to get the company to purchase Visual Studio 2005 Standard, since it's only around $250, but how difficult is it to migrate Visual Basic 6 projects over? I've heard it's easier than with older versions of .NET, but I would like some feedback.

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2004
    Location
    Mississippi
    Posts
    54

    Re: Web Reference in Visual Basic 6?

    I'm downloading Visual Basic 2005 Express now, just to see how it works. I'm assuming I can't compile, etc. with it.

    Is there any way to purchase Visual Basic 2005 Standard by itself, as I don't need VC++, J#, etc.? I can only find Visual Studio 2005.

  4. #4

    Thread Starter
    Member
    Join Date
    Oct 2004
    Location
    Mississippi
    Posts
    54

    Re: Web Reference in Visual Basic 6?

    Visual Basic 2005 is a whole new can of worms so...


    I downloaded the SOAP Toolkit 3 and I may be getting somewhere.


    VB Code:
    1. Dim Client As SoapClient30      ' SOAP Client
    2.      Dim Results As IXMLDOMSelection ' All the results.
    3.      Dim MainNode As IXMLDOMNode     ' High-level nodes.
    4.      Dim ItemList As IXMLDOMNodeList ' All the result items.
    5.      Dim ItemNode As IXMLDOMNode     ' Result item nodes.
    6.      Dim DataList As IXMLDOMNodeList ' All the data items.
    7.      Dim DataNode As IXMLDOMNode     ' One data item.
    8.      
    9.     ' Initialize the SOAP client.
    10.      Set Client = New SoapClient30
    11.    
    12.     Client.MSSoapInit "https://www.company/web-services/Auth?WSDL", "auth"
    13.  
    14.     strPacket = "FIXED-FIELD TEXT HERE"
    15.  
    16.      ' Make the request.
    17.      Set Results = Client.sendRequest(strPacket)


    Looks like it's at least recognizing the "sendRequest" method and talking to the server. Howerver, I now get the following message:

    No Deserializer found to deserialize a ':msgString' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'. [java.lang.IllegalArgumentException]

    Any help would be appreciated!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width