473,236 Members | 1,578 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,236 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 4502

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: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.