Webservices and vb6 client

Discussion in 'ASP .Net Web Services' started by Jukka Kenttälä, Jul 9, 2003.

  1. Hi!

    I have a problem with web service that uses private
    variables and stores them to context.session. I can call
    it from .NET application using cookies or cookieless
    session and it works fine. The problem is that when I try
    to call it from vb6 client using SOAP I get application-
    defined error. The web service is simple, sample code
    below:

    Private prNumber As Integer

    <WebMethod(EnableSession:=True)> Public Function Plus
    (ByVal vNumberToAdd As Integer) As String
    If Context.Session("Number") Is Nothing Then
    prNumber = 0
    Else
    prNumber = Context.Session("Number")
    End If

    prNumber += vNumberToAdd
    Context.Session("Number") = prNumber
    Plus = prNumber
    End Function

    How can I use this web service from vb6?

    Best Regards
    Johanna Turku
    Jukka Kenttälä, Jul 9, 2003
    #1
    1. Advertising

  2. Hi Johanna,

    To call a webservice from VB6, you will need to use the Soap Toolkit.
    You can download Soap Toolkit 3.0 from
    http://www.microsoft.com/downloads/details.aspx?FamilyId=C943C0DD-CEEC-4088-
    9753-86F052EC8450&displaylang=en

    The user guide installed with the soap toolkit has samples of how to call a
    web service.

    From a vb6 application, you will have to use code something similar to:
    ========================================================
    Dim soapClient3 As MSSOAPLib30.SoapClient30
    Set soapClient3 = New MSSOAPLib30.SoapClient30

    Call
    soapClient3.mssoapinit("http://servername/SimpleWebService/Service1.asmx?WSD
    L")
    If Err <> 0 Then
    MsgBox "initialization failed " + Err.Description
    End If

    'Now call the webmethod
    soapClient3.WebMethodName()
    =========================================================
    Note that you will have to take care of the WSDL file location that you
    pass to MsSoapInit() call when going up against a .Net web service
    This will need to be something like:
    "http://servername/SimpleWebService/Service1.asmx?WSDL"

    If this doesn't help, please tell us what version of the Soap Toolkit you
    are using, and the exact error you are getting.

    Thanks,
    Abhuday

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Abhuday Aggarwal [MS], Jul 11, 2003
    #2
    1. Advertising

  3. Hello Johanna,

    I was following up on this issue to check you were able to resolve it or if
    you had further questions.
    Please keep us posted if you are still running into some problems.

    Thanks,
    Abhuday

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Abhuday Aggarwal [MS], Jul 17, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Carter

    VB6 thin client

    Mark Carter, Sep 29, 2003, in forum: Python
    Replies:
    1
    Views:
    407
    Daniel Dittmar
    Sep 29, 2003
  2. Mike Cook
    Replies:
    0
    Views:
    431
    Mike Cook
    Jul 17, 2003
  3. Graeme Anderson

    ASP.NET WebService called from VB6 Client

    Graeme Anderson, Nov 2, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    130
    Graeme Anderson
    Nov 2, 2003
  4. geek2geek

    Newbie question: using .net web service with vb6 client

    geek2geek, Nov 6, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    154
    geek2geek
    Nov 6, 2003
  5. Reg Jacklin

    Instaling a VB6 Web Services client

    Reg Jacklin, Feb 26, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    135
    Reg Jacklin
    Feb 26, 2004
Loading...

Share This Page