consuming Java webservice with VB6 help...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jeffbroodwar
    New Member
    • Oct 2006
    • 118

    #1

    consuming Java webservice with VB6 help...

    hi, i need help about consuming webservice created in java with vb6. i've created the webservice in netbeans with sun java server bundle and used MS Soap toolkit 3.0 on the client side.

    i've attached the sample client source code in vb6 :

    _______________ _______________ _______________ _____ _______________ _

    '************** ******* Created procedure *************** **************
    Private Sub Connect()

    strClient = "http://localhost:8080/HiWS/HiWS?WSDL"

    End sub

    '************** ******* Form events *************** *************** ******
    Private Sub cmdDoHello_Clic k()

    Dim Client As New MSSOAPLib30.Soa pClient30

    Connect
    Client.MSSoapIn it (strClient)

    txtSoapMessage. Text = Client.sayHi("J eff")

    End Sub

    _______________ _______________ _______________ _____ _______________ _

    just a reminder.. i've added microsoft soap type libraryv3.0 in the references window.

    *sayHi is the method of the java webservice

    i'm receiving the following errors :

    client: incorrect number of parameters supplied for soap request hresult=0x80070 057: the parameter is incorrect.
    -client: unspecified client error. HRESULT=0x80070 057: the parameter is incorrect.

    -I hope someone can help me with this one..... i'm running out of time... thanx in advance.
  • freakybeard
    New Member
    • Nov 2006
    • 2

    #2
    jeffbroodwar,
    Having the same difficulty, except using Tomcat 5.5 and/or 6.0. Any chance that you've solved your problem?
    I created a really simple web service in .net, and communicaion with vb6 using ms soap toolkit 3.0 worked just fine. I noticed that the wsdls are different though, where the one created in the .net web service was a bit more verbose:

    <s:schema elementFormDefa ult="qualified" targetNamespace ="http://tempuri.org/">
    −
    <s:element name="HelloWorl d">
    <s:complexTyp e/>
    </s:element>
    −
    <s:element name="HelloWorl dResponse">
    −
    <s:complexTyp e>
    −
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="HelloWorl dResult" type="s:string"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    </s:schema>

    as compared to the one in Java created using jax-ws 2.0, which linked into a xsd:

    <xsd:schema>
    <xsd:import namespace="http ://example.com" schemaLocation= "HelloService_s chema1.xsd"/>
    </xsd:schema>


    Myself being kind of a newbie w/ the whole web service thing, I doubt that could have a lot to do with it...still, who knows...

    Comment

    • freakybeard
      New Member
      • Nov 2006
      • 2

      #3
      By the way, an ugly hack would be to write a .net wrapper to subscribe to the java webservice, and expose it to COM...if you have that option available...alt hough COM-to-.Net interop really sucks...

      Comment

      • jeffbroodwar
        New Member
        • Oct 2006
        • 118

        #4
        fortunately i was able to get this thing working... consuming the java service with vb6. IF the service will only display text. ex: Hello World !. but if a service like addition,databa se query,etc. (something that will require input...) it sez... invalid parameters... guess the problem now is on the syntax itself... check this out :

        =============== =============== =============== ========
        Private sub Connect()

        strClient = "http://localhost:8080/JavaMathService 2/JavaMathService 2?WSDL"

        End sub
        =============== =============== =============== ========

        Private sub Button1_Click()



        Dim i as IXMLDOMSelectio n
        Dim Client as New mssoaplib30.Soa pClient30

        Connect
        Client.MSSoapIn it (strClient)

        Set i = Client.database sample(val(text 1.text))
        txtbox1.text = i.context.Text


        End sub
        =============== =============== =============== ========
        just add :
        Soap library version 3.0
        Microsoft XML, v6.0

        an error pops up telling me about missing element....mean ing the value of text1.text (ID number) was not read as an input. don't know how to pass this element/value so that it will return to txtbox1 "SODA".

        take note : (ID #1 = SODA)

        please check this... you might be able to figure it out...... thanx

        Regards,
        Jeff

        Comment

        • AricC
          Recognized Expert Top Contributor
          • Oct 2006
          • 1885

          #5
          You should post this or a link to this post down in the VB forum there are quite a few really good VB6 programmers that hang out there.

          Comment

          • jeffbroodwar
            New Member
            • Oct 2006
            • 118

            #6
            okie, thanx aricc

            Best Regards,
            Jeff

            Comment

            Working...