VB6 SOAP SDK to C# .NET

T

TC

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top