Results 1 to 5 of 5

Thread: VB6 and SOAP Toolkit 3.0

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    VB6 and SOAP Toolkit 3.0

    Hello everybody

    I need to add a procedure to an old vb6 project.
    This routine will send a xml file to a webservice and will receive a response from the webservice

    I will use MS SOAP Toolkit3.0
    Until now I found little practical information about this task

    The next is the wsdl for that webservice

    I hope someone may post an example about how to send and receive to this webservice using SOAP Toolkit3.0 or post practical links about the subject

    I need to send Intproveedor and Strxml and receive Intrespuesta
    Thanks in advance

    JG
    Code:
    <?xml version="1.0" encoding="UTF-8" ?> 
    - <definitions name="PRVCargaCFD" targetNamespace="SiCFD" xmlns:tns="SiCFD" xmlns:wsdlns="SiCFD" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns1="SiCFD" xmlns:tns2="Genexus">
    - <types>
    - <schema targetNamespace="SiCFD" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" elementFormDefault="qualified">
      <import namespace="Genexus" /> 
    - <element name="PRVCargaCFD.Execute">
    - <complexType>
    - <sequence>
      <element minOccurs="1" maxOccurs="1" name="Intproveedor" type="xsd:int" /> 
      <element minOccurs="1" maxOccurs="1" name="Strxml" type="xsd:string" /> 
      </sequence>
      </complexType>
      </element>
    - <element name="PRVCargaCFD.ExecuteResponse">
    - <complexType>
    - <sequence>
      <element minOccurs="1" maxOccurs="1" name="Intrespuesta" type="xsd:byte" /> 
      </sequence>
      </complexType>
      </element>
      </schema>
      </types>
    - <message name="PRVCargaCFD.ExecuteSoapIn">
      <part name="parameters" element="tns:PRVCargaCFD.Execute" /> 
      </message>
    - <message name="PRVCargaCFD.ExecuteSoapOut">
      <part name="parameters" element="tns:PRVCargaCFD.ExecuteResponse" /> 
      </message>
    - <portType name="PRVCargaCFDSoapPort">
    - <operation name="Execute">
      <input message="wsdlns:PRVCargaCFD.ExecuteSoapIn" /> 
      <output message="wsdlns:PRVCargaCFD.ExecuteSoapOut" /> 
      </operation>
      </portType>
    - <binding name="PRVCargaCFDSoapBinding" type="wsdlns:PRVCargaCFDSoapPort">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
    - <operation name="Execute">
      <soap:operation soapAction="SiCFDaction/APRVCARGACFD.Execute" /> 
    - <input>
      <soap:body use="literal" /> 
      </input>
    - <output>
      <soap:body use="literal" /> 
      </output>
      </operation>
      </binding>
    - <service name="PRVCargaCFD">
    - <port name="PRVCargaCFDSoapPort" binding="wsdlns:PRVCargaCFDSoapBinding">
      <soap:address location="http://www.diconsa.gob.mx/SiCFDQA/servlet/aprvcargacfd" /> 
      </port>
      </service>
      </definitions>

  2. #2
    Frenzied Member
    Join Date
    Mar 2009
    Posts
    1,182

    Re: VB6 and SOAP Toolkit 3.0

    Time to use your friends (yahoo, google, ask, answers, bing) and search for "vb6 soap toolkit 3.0 tutorial" as I found a few out there...



    Good Luck
    Option Explicit should not be an Option!

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: VB6 and SOAP Toolkit 3.0

    Thanks vb5prgrmr

    Right now I'm following two paths :
    1.- Learning about SOAP, WSDL, XML, etc. And I know that I will solve the problem... But it will take time!
    2.- Searching for practical examples just to short the time and finish the job... but believe me, there're a lot of tutorials about SOAP Toolkit, but simple ones... and as far as I know, I need to manage complex data types using the generic type mapper to serialize or use the XMLDOM... etc.

    JG
    Last edited by jggtz; Apr 11th, 2010 at 02:30 PM.

  4. #4
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: VB6 and SOAP Toolkit 3.0

    Quote Originally Posted by jggtz View Post
    2.- Searching for practical examples just to short the time and finish the job... but believe me, there're a lot of tutorials about SOAP Toolkit, but simple ones... and as far as I know, I need to manage complex data types using the generic type mapper to serialize or use the XMLDOM... etc.

    JG
    Search on http://planet-source-code.com

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: VB6 and SOAP Toolkit 3.0

    Thanks
    It was easier than I thought
    After studying the meaning of each element from the wsdl , the next is the code I'm using
    Code:
    Dim MySoap As New MSSOAPLib30.SoapClient30
    '
    '
    '
        Dim MyIntProveedor  As String
        Dim MyStrxml        As String
        Dim MyIntrespuesta  As Integer
        Dim Msg             As String
        
        MyIntProveedor = "9999"
        MyStrxml = "...here goes xml string..."
        
        Call MySoap.MSSoapInit("http://www.dico.xxx/QA/servlet/xxxcargacfd?wsdl", "PRVCargaCFD")
        MyIntrespuesta = MySoap.Execute(MyIntProveedor, MyStrxml)
        Select Case MyIntrespuesta
            Case 0: Msg = "O.K."
            Case 1: Msg = "Intproveedor is not valid"
            Case 2: Msg = "Error:2"
            Case 3: Msg = "Error:3"
            Case 4: Msg = "Error:4"
            Case 5: Msg = "Error:5"
            Case -1: Msg = "XML has an invalid format"
        End Select
        MsgBox Msg, vbInformation, "Response from WebService"
        
        Set MySoap = Nothing
    (Now I'm dealing with the xml format, if need envelope or not, etc.)

    JG
    Last edited by jggtz; Apr 11th, 2010 at 02:32 PM.

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