Loading ...
Sorry, an error occurred while loading the content.

Q: VB6/Web-service/SOAP?

Expand Messages
  • ihadtohaveanid
    Hi, I m relatively new to VB6 and a total rookie when it comes to the SOAP-protocol. I have a question or two regarding Internet- connections. Background: *I m
    Message 1 of 8 , Sep 3, 2002
    • 0 Attachment
      Hi,

      I'm relatively new to VB6 and a total rookie when it comes to the
      SOAP-protocol. I have a question or two regarding Internet-
      connections.

      Background:

      *I'm running VB6 Enterprise Edition (NOT .net!) on Windows 2000 (no
      IIS installed locally)
      *I've been provided with a web-service, WSDL-file and a WSML-file
      *I know all the methods invcluded in this web-service
      *I've got SOAP Toolkit v3 (but i'm not sure to use it as i'm not
      trying to develop a DLL/Com-object but will use the existing web-
      service instead)

      Questions:

      1) How do I create a connection between a VB application and a web
      service (VB .NET)? In Visual Studio, what type of component should i
      include?
      2) I'm getting errors using this syntax (probably because of Question
      1):
      Dim SoapClient As New MSSOAPLib.SoapClient
      Set SoapClient = CreateObject("MSSOAP.SoapClient")
      Call SoapClient.MSSoapInit("DocSample1.wsdl", "", "", "")
      3) Does it matter if i call the WSDL-file as a local file or must i
      be a http://someserver.com/soap/sample.wsdl?
      4) Is it possible to just use the actual web-service, it's WSDL-file
      and it's WSML-file and plain VB6-code to accomplish a connection?
      5) The requests/responses is in XML, how do i 'parse' this?
      6) Can i use a recordset to get the 'parsed' response into my VB6-
      application

      I would be VERY happy for the slightest input on this matter as i'm
      getting really frustrated right now!!! :-)

      Best regards,

      Paddy
    • jim@ironringsoftware.com
      This is explained pretty well in the COM STK documentation - but it seems like you are on the right track. comments inline... ... This is handled by the client
      Message 2 of 8 , Sep 3, 2002
      • 0 Attachment
        This is explained pretty well in the COM STK documentation - but it seems
        like you are on the right track. comments inline...

        > -----Original Message-----
        > From: ihadtohaveanid [mailto:marcus_halb@...]
        > Sent: Tuesday, September 03, 2002 4:58 AM

        > I'm relatively new to VB6 and a total rookie when it comes to the
        > SOAP-protocol. I have a question or two regarding Internet-
        > connections.

        This is handled by the client components of the SOAP toolkit you are using.
        You don't need IIS - just the toolkit.

        > *I'm running VB6 Enterprise Edition (NOT .net!) on Windows 2000 (no
        > IIS installed locally)
        > *I've been provided with a web-service, WSDL-file and a WSML-file
        > *I know all the methods invcluded in this web-service
        > *I've got SOAP Toolkit v3 (but i'm not sure to use it as i'm not
        > trying to develop a DLL/Com-object but will use the existing web-
        > service instead)

        You don't need the WSML that's so the server side toolkit knows what COM
        object to dispatch to.


        > Questions:
        >
        > 1) How do I create a connection between a VB application and a web
        > service (VB .NET)? In Visual Studio, what type of component should I
        > include?

        This is transparent to you. The code you have below looks right. The
        endpoint to connect to should be described in the WSDL file you are using.
        The client toolkit uses that info to opena socket, generate and send a
        request then read the response.

        > 2) I'm getting errors using this syntax (probably because of Question
        > 1):
        > Dim SoapClient As New MSSOAPLib.SoapClient
        > Set SoapClient = CreateObject("MSSOAP.SoapClient")
        > Call SoapClient.MSSoapInit("DocSample1.wsdl", "", "", "")

        This looks ok - but its been a while since I used the COM STK and VB is not
        my first language. You will need to explain what you mean by "errors".
        Compilation errors, runtime errors and what are they?


        > 3) Does it matter if I call the WSDL-file as a local file or must I
        > be a http://someserver.com/soap/sample.wsdl?

        Yes you can/should cache the wsdl locally. Make sure to keep the server
        version and the client version in synch though. You WSDL is your contract
        so if they are skewed your SOAP invocation will likely fail.

        > 4) Is it possible to just use the actual web-service, it's WSDL-file
        > and it's WSML-file and plain VB6-code to accomplish a connection?

        Yes, but you don't need the WSML. Try writing the client in VB Script and
        use cscript to run it! There is no COM programming required on the client -
        until you want to hook into the client components to customize behavior.

        > 5) The requests/responses is in XML, how do i 'parse' this?

        Its parsed for you intot he arguments you specify in the WSDL. There are
        basically 2 encoding schemes - RPC/encoded and Document/Literal. You'll
        have to read about these yourself to understand the issues involved. To get
        started use the defaults and realize that the SOAP toolkit is doing a bunch
        of work for you - including parsing the response and setting the out
        parameters of your method.


        > 6) Can i use a recordset to get the 'parsed' response into my VB6-
        > application

        This is a sticky question - and depends largely on the degree of
        interoperability with other toolkits you need. One way to go is to consider
        your web service a language/platform neutral interface. In that sense it
        wouldn't make sense to send a Microsoft oriented ADO COM object as a SOAP
        message. How would you read it on Linux? But is you control both ends you
        have some flexibility. This is an engineering call on your part and you will
        need to become aware of these issues before you can make that call.

        >
        > I would be VERY happy for the slightest input on this matter as i'm
        > getting really frustrated right now!!! :-)

        Very understandable! I'd recommend getting started with the COM STK
        samples. Use VB Script and cscript.exe to run them to get a little more
        comfortable with the technology. It wont clear up all the issues for you
        but will help grok the basics.

        Good Luck,
        Jim Murphy
      • ihadtohaveanid
        Thanks Jim! I never thought i would get such a great response to my question, i m gonna try again! Thanx again! Br, Paddy
        Message 3 of 8 , Sep 4, 2002
        • 0 Attachment
          Thanks Jim! I never thought i would get such a great response to my
          question, i'm gonna try again!

          Thanx again!

          Br, Paddy
        • ihadtohaveanid
          I m kind of stuck again it seems! I just realized that i can t rely on SOAP toolkit in my VB6- application as it makes an impact on other users (they too need
          Message 4 of 8 , Sep 5, 2002
          • 0 Attachment
            I'm kind of stuck again it seems!

            I just realized that i can't rely on SOAP toolkit in my VB6-
            application as it makes an impact on other users (they too need the
            toolkit on their machines or so i guess anyway).

            Is it possible to develop an application in VB6 (not .net) that
            construct it's own soap request and responses and just 'fires away'
            against a webservice (with standard components and without no
            involvment whatsoever from the SOAP toolkit)?

            I found an interesting article on this matter
            (http://www.devarticles.com/content.php?articleId=186&page=3)

            Couln't i just replace the .asp-file with the actual webservice and
            make it run ok?

            Thanx & Best regards,

            Paddy
          • ihadtohaveanid
            I m kind of stuck again it seems! I just realized that i can t rely on SOAP toolkit in my VB6- application as it makes an impact on other users (they too need
            Message 5 of 8 , Sep 5, 2002
            • 0 Attachment
              I'm kind of stuck again it seems!

              I just realized that i can't rely on SOAP toolkit in my VB6-
              application as it makes an impact on other users (they too need the
              toolkit on their machines or so i guess anyway).

              Is it possible to develop an application in VB6 (not .net) that
              construct it's own soap request and responses and just 'fires away'
              against a webservice (with standard components and without no
              involvment whatsoever from the SOAP toolkit)?

              I found an interesting article on this matter
              (http://www.devarticles.com/content.php?articleId=186&page=3)

              Couln't i just replace the .asp-file with the actual webservice and
              make it run ok?

              Thanx & Best regards,

              Paddy
            • Matt Long
              You get the executables and source for a VB6 processor + client + docs, here: http://www.topxml.com/code/?p=3&id=v20020620100238&ms=50&l=&sw=All If this may
              Message 6 of 8 , Sep 5, 2002
              • 0 Attachment
                You get the executables and source for a VB6 processor + client + docs,
                here:

                http://www.topxml.com/code/?p=3&id=v20020620100238&ms=50&l=&sw=All

                If this may help.

                -Matt Long
                Phalanx Systems, LLC


                > -----Original Message-----
                > From: ihadtohaveanid [mailto:marcus_halb@...]
                > Sent: Thursday, September 05, 2002 8:34 AM
                > To: soapbuilders@yahoogroups.com
                > Subject: [soapbuilders] Q: VB6/Web-service/SOAP?
                >
                > I'm kind of stuck again it seems!
                >
                > I just realized that i can't rely on SOAP toolkit in my VB6-
                > application as it makes an impact on other users (they too need the
                > toolkit on their machines or so i guess anyway).
                >
                > Is it possible to develop an application in VB6 (not .net) that
                > construct it's own soap request and responses and just 'fires away'
                > against a webservice (with standard components and without no
                > involvment whatsoever from the SOAP toolkit)?
                >
                > I found an interesting article on this matter
                > (http://www.devarticles.com/content.php?articleId=186&page=3)
                >
                > Couln't i just replace the .asp-file with the actual webservice and
                > make it run ok?
                >
                > Thanx & Best regards,
                >
                > Paddy
                >
                >
                > ------------------------ Yahoo! Groups Sponsor
                >
                > -----------------------------------------------------------------
                > This group is a forum for builders of SOAP implementations to discuss
                > implementation and interoperability issues. Please stay on-topic.
                >
                > To unsubscribe from this group, send an email to:
                > soapbuilders-unsubscribe@yahoogroups.com
                >
                >
                >
                > Your use of Yahoo! Groups is subject to
                http://docs.yahoo.com/info/terms/
                >
              • jim@ironringsoftware.com
                ... This is problem? Why can t you install the STK components with your app? I ll bet you are using several libraries in your app why is the STK any
                Message 7 of 8 , Sep 5, 2002
                • 0 Attachment
                  > I just realized that i can't rely on SOAP toolkit in my VB6-
                  > application as it makes an impact on other users (they too need the
                  > toolkit on their machines or so i guess anyway).

                  This is problem? Why can't you install the STK components with your
                  app? I'll bet you are using several libraries in your app why is the
                  STK any different?


                  > Is it possible to develop an application in VB6 (not .net) that
                  > construct it's own soap request and responses and just 'fires away'
                  > against a webservice (with standard components and without no
                  > involvment whatsoever from the SOAP toolkit)?

                  SOAP is just XML - so technically you can just send and receive xml over
                  HTTP. You are then on the hook to connect, send, receive and then map
                  the data contained in the xml payload to your application. Depending on
                  the nature of your messages this may be easy or an endless source of
                  bugs. How are you going to connect to the web service and talk HTTP?
                  Do you need to encode messages using SOAP section 5 encoding rules?
                  These are all issues that the toolkit does for you.

                  You may end up asking yourself, since I'm not letting a toolkit do the
                  heavy lifting why use SOAP at all?

                  > Couln't i just replace the .asp-file with the actual webservice and
                  > make it run ok?

                  What do you mean by "the actual webservice"?

                  BTW, I'd recommend bringing these questions up on the SOAP list at
                  http://discuss.develop.com Its more akin to these sorts of issues and
                  there are plenty of folks to help get you going.

                  Jim
                • pprussak@econium.com
                  You don t really need the Soap toolkit. The minimum you d need would be and HTTP component, and something that could create/parse XML. The simplest thng to use
                  Message 8 of 8 , Sep 5, 2002
                  • 0 Attachment
                    You don't really need the Soap toolkit. The minimum you'd need would be
                    and HTTP component, and something that could create/parse XML.

                    The simplest thng to use is MSXML, and with a "known" soap
                    implementation you can hand craft your SOAP messages, and then, parse
                    them back.

                    Your basic SOAP package looks like:
                    <?xml version='1.0' encoding='UTF-8'?>
                    <Envelope xmlns='http://schemas.xmlsoap.org/soap/envelope/'>
                    <Body>soap message goes here</Body>
                    </Envelope>

                    Your message is whatever your SOAP.WSDL would tell you it is. For
                    example, a UDDI message which would go in the "soap message goes here"
                    above...:
                    <find_service generic='2.0' xmlns='urn:uddi-org:api_v2'>
                    <tModelBag>
                    <tModelKey>uuid:e731da8b-bd96-4511-9b42-becac0fd2ad4</tModelKey>
                    </tModelBag>
                    </find_service>

                    You'll need to tweak the headers in your request...
                    ----
                    Set objHTTP = CreateObject("Microsoft.XMLHTTP")
                    objHTTP.Open "POST", address, False
                    If Err.Number <> 0 Then
                    ' handle connection error
                    Else
                    objHTTP.setRequestHeader "Accept", "text/xml"
                    objHTTP.setRequestHeader "Cache-Control", "no-cache"
                    objHTTP.setRequestHeader "Content-Type", "text/xml; charset=""utf-8"""
                    objHTTP.setRequestHeader "SOAPAction", """"""
                    objHTTP.send msg
                    ----

                    And then, if there are no SOAP/HTTP specific errors, the web service
                    would return:
                    Set objDOC = New MSXML2.DOMDocument30
                    objDOC.loadXML (objHTTP.responseText)

                    Where the response text, after stripping out all of the nice soap stuff
                    would be something like (just look at the objDoc and use Xpath to select
                    appropriate "xml element" you're expecting, in this case "//serviceList"
                    node):
                    <serviceList generic="2.0" operator="Blah" truncated="false"
                    xmlns="urn:uddi-org:api_v2">
                    <serviceInfos>
                    <serviceInfo serviceKey="fb9ed6be-0a4c-42ec-bd0c-eb60227565cb"
                    businessKey="9431dade-f700-439e-8c02-953f850c6ae2">
                    <name xml:lang="en">Test</name>
                    </serviceInfo>
                    </serviceInfos>
                    </serviceList>

                    SOAP toolkit is better though, because it allows you to get rid of this
                    extra processing. It is also fairly easy to install with your VB
                    installation (documentation is on the MSDN site, but don't use the .msi
                    package).

                    Piotr

                    -----Original Message-----
                    From: ihadtohaveanid [mailto:marcus_halb@...]
                    Sent: Thursday, September 05, 2002 9:34 AM
                    To: soapbuilders@yahoogroups.com
                    Subject: [soapbuilders] Q: VB6/Web-service/SOAP?


                    I'm kind of stuck again it seems!

                    I just realized that i can't rely on SOAP toolkit in my VB6- application
                    as it makes an impact on other users (they too need the
                    toolkit on their machines or so i guess anyway).

                    Is it possible to develop an application in VB6 (not .net) that
                    construct it's own soap request and responses and just 'fires away'
                    against a webservice (with standard components and without no
                    involvment whatsoever from the SOAP toolkit)?

                    I found an interesting article on this matter
                    (http://www.devarticles.com/content.php?articleId=186&page=3)

                    Couln't i just replace the .asp-file with the actual webservice and
                    make it run ok?

                    Thanx & Best regards,

                    Paddy



                    -----------------------------------------------------------------
                    This group is a forum for builders of SOAP implementations to discuss
                    implementation and interoperability issues. Please stay on-topic.

                    To unsubscribe from this group, send an email to:
                    soapbuilders-unsubscribe@yahoogroups.com



                    Your use of Yahoo! Groups is subject to
                    http://docs.yahoo.com/info/terms/
                  Your message has been successfully submitted and would be delivered to recipients shortly.