473,378 Members | 1,456 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,378 software developers and data experts.

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

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.SoapClient30
Set oSoapClient = New MSSOAPLib30.SoapClient30

Call oSoapClient.MSSoapInit("http://localhost/sample/Sample.asmx?wsdl")

' 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.GetSampleData("ferrari@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 XMLStringToRecordset()

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

Set objStream = New ADODB.Stream

objStream.Open
objStream.WriteText strXML
objStream.Position = 0

Set oRecordset = New ADODB.Recordset
oRecordset.Open

objStream.Close
Set objStream = Nothing

Set XMLStringToRecordset = 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 3678
Killer42
8,435 Expert 8TB
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
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...
0
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
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...
5
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
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...
4
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 =...
1
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...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.