473,808 Members | 2,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Consuming a .NET Webservice in VB6, and Creating a ADO RecordSet

1 New Member
Hi All,

I have a simple question.
Howto consume a .NET webservice form VB6.

I have tried very many methods. I currently use MSXML. Here is the piece of code that I use. This works flawlessly. It gets a XML String from the WS, and I'm supposed to parse this for my project. But I thought that is a very cumbersome process. I'd like a easier method than just parsing the XML and iterating it. I guess most of you would agree with me in this respect.

Ok lets look at the code..

Dim oSoapClient As MSSOAPLib30.Soa pClient30
Set oSoapClient = New MSSOAPLib30.Soa pClient30

Call oSoapClient.MSS oapInit("http://localhost/sample/Sample.asmx?wsd l")

' The WS expects 2 parameters, the username and password
' I provide the same by calling the method GetSampleData
' This returns some sample data that needs to be used in VB6 application

Dim xmlString As String
xmlString = oSoapClient.Get SampleData("fer rari@gmail.com" , "march")

Debug.Print xmlString

Well, that is the end of the story. The cariable xmlString contains the XML data that which needs to be parsed. But I dont want to parse it or iterate it.

What I thought was to write this XML to a file. And convert this XML data into a Recordset that we all love to use. It's much easier to go about and manipulate later in the application.

For this I tried the following code XMLStringToReco rdset()

Public Function XMLStringToReco rdset(strXML As String) As Recordset
Dim objStream As ADODB.Stream
Dim oRecordset As ADODB.Recordset

Set objStream = New ADODB.Stream

objStream.Open
objStream.Write Text strXML
objStream.Posit ion = 0

Set oRecordset = New ADODB.Recordset
oRecordset.Open

objStream.Close
Set objStream = Nothing

Set XMLStringToReco rdset = oRecordset

Set oRecordset = Nothing
End Function

But this throws some error like this "the connection cannot be used to perform this operation. It is either closed or invalid in this context".

I pressume the error is because the recordset cannot be written with plain XML, but it needs to follow the MS Schema.

Does anyone know how to go about this?
Nov 21 '06 #1
1 3700
Killer42
8,435 Recognized Expert Expert
Which statement throws the error?
Nov 22 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

19
9333
by: Adam Short | last post by:
I am trying to write a routine that will connect a .NET server with a classic ASP server. I know the following code doesn't work! The data is being returned as a dataset, however ASP does not recognise datasets and requires a recordset. Can the datatypes be converted? At the Classic ASP end or .NET end? Can SOAP toolkit provide the conversion, can any toolkit provide a conversion? ...
0
1236
by: kamig | last post by:
Hi! Scenario: Consuming my webService in a windows application give denied acces! Explanation: I have to say a moveTo fn. which move one file/dir from one drive to another, <authorization>
0
1571
by: plmanikandan | last post by:
I need to develop a application to consume a webservice. For consuming web service i tried a example in Consuming a Web Service in C# in http://www.csharphelp.com.But i am uanble to use that webservices in http://upload.eraserver.net/circle24/worldtime/worldtime.asmx?WSDL.Can anybody give me simple example(website link) for consuming webservice(other than local host). Mani
5
17125
by: Preben Zacho | last post by:
Anyone that has a link or description that simply as possible shows how to add a web reference to a class library in C# and consuming it? TIA PZ
0
1238
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 attached the sample client source code in vb6 : __________________________________________________________________ '********************* Created procedure ***************************** Private Sub Connect() strClient =...
2
2792
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 attached the sample client source code in vb6 : __________________________________________________ ________________ '********************* Created procedure ***************************** Private Sub Connect() strClient =...
0
1243
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 attached the sample client source code in vb6 : __________________________________________________ ________________ '********************* Created procedure ***************************** Private Sub Connect() strClient =...
4
5998
by: Boni | last post by:
I want consuming a webserivce trough a proxy. I use this code. myService s = new myService (); System.Net.WebProxy proxyObject = new System.Net.WebProxy("http://proxyhost:8080"); s.Proxy = proxyObject; It doesn't works, it returns a error HTTP 407: Proxy Authentication Required ( Access is denied. ). But my proxy don't need a user Authentication.
1
3429
by: =?Utf-8?B?VmVua2F0ZXNhbiBT?= | last post by:
Hi, I have a requirement of consuming a connection object returned from a COM component deployed in COM+ application. I have given the need for this requirement end of my query. My component returns a Connection objec to ASP page and then I am trying to use the same Connection object to Command/Recordset object to execute a SP I am getting the error given below ************************************
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9600
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10113
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9195
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7651
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3859
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.