473,320 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

VB.NET Webservice Client - NOT to use SOAP Toolkit 3

Hi,

I have a successful VB6 web service client that uses the SOAP Toolkit 3
to make calls to a web service written in ASP.Net (VB.Net). However,
due to Microsoft not recommending the use of SOAP Toolkit 3 on a
Windows 2003 server, I must scrap the use of the toolkit and look to
develop the client in VB.Net instead.

I have upgraded the VB6 application to VB.Net using the built-in
upgrade tool that comes with Visual Studio .Net 2003. The majority of
the code has been translated to .Net, but I am having trouble as the
SOAP Toolkit 3 code has also been translated to VB.Net.

I have successfully called the web service to return very simple
values, where I do not actually need to use objects such as:
WSDLReader30, SoapSerializer30, SoapReader30, SoapConnector30 that are
required in the VB6 application. Am I correct to assume this??

I would appreciate if someone could advise me on how I should tackle
translating the following VB6 function that uses SOAP Toolkit 3.

The VB6 function is as follows:

Private Function ExecuteSOAP(aOperation() As String, xmlparams As
IXMLDOMNode, bErrorOnNoSOAP As Boolean) As SoapReader30

Dim WSDLReader As New WSDLReader30
Dim serializer As SoapSerializer30
Dim Reader As New SoapReader30
Dim Connector As New SoapConnector30
Dim ServiceEnumerator As IEnumWSDLService, Service As IWSDLService
Dim Fetched As Long
Dim PortEnumerator As IEnumWSDLPorts, Port As IWSDLPort
Dim OperationEnumerator As IEnumWSDLOperations, Operation As
IWSDLOperation
Dim MapperEnumerator As IEnumSoapMappers, Mapper As ISoapMapper
Dim bFoundOperation As Boolean
Dim XMLElement As IXMLDOMNode

'read WSDL file
On Error GoTo ErrorHandler

WSDLReader.Load gWSDL, ""

' Loop round the services
WSDLReader.GetSoapServices ServiceEnumerator
ServiceEnumerator.Next 1, Service, Fetched
Do While Fetched = 1 And bFoundOperation = False

' Loop round the ports
Service.GetSoapPorts PortEnumerator
PortEnumerator.Next 1, Port, Fetched
Do While Fetched = 1 And bFoundOperation = False

' find the operation
Port.GetSoapOperations OperationEnumerator

' The Find method returns an error if it fails so trap it
and continue
Set Operation = Nothing
On Error Resume Next
OperationEnumerator.Find aOperation(1), Operation
On Error GoTo ErrorHandler

If Not Operation Is Nothing Then
' prepare request
bFoundOperation = True
Set MapperEnumerator =
Operation.InputMessage.MessageParts

MapperEnumerator.Next 1, Mapper, Fetched
Do While Fetched = 1
'See if this is a complex type. The SchemaNode
property is nothing if simple type
If Mapper.SchemaNode Is Nothing Then
' simple type, just get the parameter from the
input xml file
If Not xmlparams.selectSingleNode("//" &
Mapper.ElementName) Is Nothing Then
Mapper.ComValue =
xmlparams.selectSingleNode("//" & Mapper.ElementName).Text
Else
Mapper.ComValue = ""
End If
Else
'complex type, use the whole node from the
input xml file
Mapper.ComValue = ""
If Not xmlparams.selectSingleNode("//" &
Mapper.ElementName) Is Nothing Then
'Mapper.ComValue =
xmlparams.selectSingleNode("//" & Mapper.ElementName).xml
For Each XMLElement In
xmlparams.selectSingleNode("//" & Mapper.ElementName).childNodes
Mapper.ComValue = Mapper.ComValue &
XMLElement.xml
Next
End If
End If
MapperEnumerator.Next 1, Mapper, Fetched
Loop

End If

If bFoundOperation = False Then PortEnumerator.Next 1,
Port, Fetched
Loop

If bFoundOperation = False Then ServiceEnumerator.Next 1,
Service, Fetched
Loop

If bFoundOperation = False Then
Set ExecuteSOAP = Nothing
Else
Set Connector = New HttpConnector30

strDebugPoint = "Connecting to port '" & Port.Address & "'"
Connector.ConnectWSDL Port

Connector.BeginMessageWSDL Operation

Set serializer = New SoapSerializer30
serializer.Init Connector.InputStream

serializer.StartEnvelope
serializer.StartBody

Operation.Save serializer, True

serializer.EndBody

' Force the message to appear on the screen
DoEvents

serializer.EndEnvelope

Connector.EndMessage

Reader.Load Connector.OutputStream

Set ExecuteSOAP = Reader
End If
Exit Function
Many thanks.

Jimmy

Jan 24 '06 #1
0 4519

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Det | last post by:
Hi there I am somewhat stuck with calling a WebService from out of a VB App. My Goal: - Get a WebService invoked under MS - Access 2002, not using the MS-SOAP-Toolkit but the .net - Framework ...
7
by: Q. John Chen | last post by:
All, I have a WebService created in .NET. I have VB6 Client consume the WebService (using Soap ToolKit 3.0) But I have couple user who got error accessing the WebServer with error message...
1
by: Vincenzo Milazzo | last post by:
Ciao, come faccio a chiamare un webservice scritto in c# da una pagina asp in vbscript ? Ciao a tutti
7
by: Nalaka | last post by:
Hi, I created a sinple web service that returns a dataSet. Then I created a client program that uses this web service (that returns the Dataset). My question is, how did the client figure...
1
by: NN | last post by:
Hello, I have a question. I have a program made in VB6 that caputure the images that are transmitted by a webcam and records it in a database in MySQL. I want to do a WebService in .NET that...
0
jeffbroodwar
by: jeffbroodwar | last post by:
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...
2
jeffbroodwar
by: jeffbroodwar | last post by:
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...
0
jeffbroodwar
by: jeffbroodwar | last post by:
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...
5
jeffbroodwar
by: jeffbroodwar | last post by:
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.