VB6 SOAP SDK to C# .NET

Discussion in 'ASP .Net Web Services' started by TC, Apr 13, 2005.

  1. TC

    TC Guest

    Hey All,

    I have been asked to port a VB6 COM component that makes SOAP calls to .Net.
    The server side SOAP calls are written in PHP and after referencing the
    WSDL, the SOAP methods do not offer any return type when viewed in the
    Object Browser.

    The responses are currently extracted from an XML document.

    Below is a sample of the code that I was handed in VB using the SOAP SDK
    --I did not write this -- don't shoot the messenger ;-)


    Private Const ENC = "http://schemas.xmlsoap.org/soap/encoding/"
    Private Const XSI = "http://www.w3.org/1999/XMLSchema-instance"
    Private Const XSD = "http://www.w3.org/1999/XMLSchema"

    Set Connector = New HttpConnector
    Set Serializer = New SoapSerializer
    Set Reader = New SoapReader

    URI = "urn:" & "soap"
    Connector.Property("EndPointURL") = "http://www.soaptest.com/soap.php"
    Connector.Connect
    Connector.Property("SoapAction") = URI & "#" & method
    Connector.BeginMessage
    Serializer.Init Connector.InputStream
    Serializer.startEnvelope , ENC
    Serializer.SoapNamespace "xsi", XSI
    Serializer.SoapNamespace "SOAP-ENC", ENC
    Serializer.SoapNamespace "xsd", XSD
    Serializer.startBody
    Serializer.startElement "trackmail", URI, , "method"


    Serializer.startElement "subject"
    Serializer.SoapAttribute "type", , "xsd:string", "xsi"
    Serializer.writeString msgsubject
    Serializer.endElement
    Serializer.startElement "text"
    Serializer.SoapAttribute "type", , "xsd:string", "xsi"
    Serializer.writeString msgtext
    Serializer.endElement

    Serializer.endElement
    Serializer.endBody
    Serializer.endEnvelope
    Connector.EndMessage

    'have the reader parse the response
    Reader.Load Connector.OutputStream

    If Reader.RPCResult.nodeTypedValue = "Succeeded" Then
    MsgBox "Success"
    Else
    MsgBox "Failed"
    End If



    I am looking to port these SOAP calls to C#. For example:

    soapmethods MySoap=new soapmethods();
    MySoap.methodname("arg1","arg2");

    The above is fine for sending material to the server. What I should I put
    to the left of the above method call if I am expecting an XML document
    returned from the server?

    Can anyone advise based upon the sample provided?

    Thanks & Regards,

    TC
    TC, Apr 13, 2005
    #1
    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. Carl Howarth

    ASP3/VB6 to ASP.NET/VB.NET

    Carl Howarth, Jul 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    391
    Steve C. Orr, MCSD
    Jul 8, 2003
  2. George Ter-Saakov

    Re: ASP.NET -> VB.NET -> VB6.0 DCOM

    George Ter-Saakov, Jun 2, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    625
    George Ter-Saakov
    Jun 3, 2004
  3. Mike Cook
    Replies:
    0
    Views:
    408
    Mike Cook
    Jul 17, 2003
  4. Clement
    Replies:
    0
    Views:
    238
    Clement
    Nov 22, 2003
  5. Replies:
    0
    Views:
    426
Loading...

Share This Page