Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries



Links

Issociate
Impressum

#1: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-17 16:39:47 by Adam Short

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?

============================================================ ======================

Web Service Code :
---------------------

dim strSelect as string
dim srcData as ODBCconnection
dim fltData as ODBCdataAdapter
dim myPath as String

myPath = me.Context.Request.ServerVariables("APPL_PHYSICAL_PATH")


dim rtnData as DataSet

strSelect = "SELECT * FROM myDataSource"

' srcData = new ODBCConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
SOURCE=" & myPath & "..\data\myDataSource.mdb" )

srcData = new ODBCConnection( "DSN=MyDataSource;uid=;pwd=" )

fltData = new ODBCdataAdapter( strSelect, srcData )

rtnData = new dataset

fltData.fill( rtnData )

return rtnData

============================================================ ======================

ASP Web Server Code:
-------------------------

SET objSoapClient = Server.CreateObject("MSSOAP.SoapClient")


' needs to be updated with the url of your Web Service WSDL and is
' followed by the Web Service name

objSoapClient.ClientProperty("ServerHTTPRequest") = True

Call
objSoapClient.mssoapinit("http://system.evolucion.co.uk/evol ucion-services.asmx?WSDL")

set RecordSet = Server.CreateObject("ADODB.Recordset")

' use the SOAP object to call the Web Method Required
RecordSet = objSoapClient.getEvolucionVersionList()

strOutput = strOutput & "<P>On-Line Result : " & RecordSet.RecordCount

============================================================ ======================

Report this message

Mr Ad

Google

#2: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-17 16:56:22 by unknown

try passing it as something both can work with, XML perhaps?

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


"Adam Short" <adam@phuture-uk.net> wrote in message
news:ObPbSewKFHA.3340@TK2MSFTNGP14.phx.gbl...
>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?
>
> ============================================================ ======================
>
> Web Service Code :
> ---------------------
>
> dim strSelect as string
> dim srcData as ODBCconnection
> dim fltData as ODBCdataAdapter
> dim myPath as String
>
> myPath = me.Context.Request.ServerVariables("APPL_PHYSICAL_PATH")
>
>
> dim rtnData as DataSet
>
> strSelect = "SELECT * FROM myDataSource"
>
> ' srcData = new ODBCConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
> SOURCE=" & myPath & "..\data\myDataSource.mdb" )
>
> srcData = new ODBCConnection( "DSN=MyDataSource;uid=;pwd=" )
>
> fltData = new ODBCdataAdapter( strSelect, srcData )
>
> rtnData = new dataset
>
> fltData.fill( rtnData )
>
> return rtnData
>
> ============================================================ ======================
>
> ASP Web Server Code:
> -------------------------
>
> SET objSoapClient = Server.CreateObject("MSSOAP.SoapClient")
>
>
> ' needs to be updated with the url of your Web Service WSDL and is
> ' followed by the Web Service name
>
> objSoapClient.ClientProperty("ServerHTTPRequest") = True
>
> Call
> objSoapClient.mssoapinit("http://system.evolucion.co.uk/evol ucion-services.asmx?WSDL")
>
> set RecordSet = Server.CreateObject("ADODB.Recordset")
>
> ' use the SOAP object to call the Web Method Required
> RecordSet = objSoapClient.getEvolucionVersionList()
>
> strOutput = strOutput & "<P>On-Line Result : " & RecordSet.RecordCount
>
> ============================================================ ======================
>

Report this message

#3: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-17 16:59:31 by mkamath

The DataSet and RecordSet objects are not compatible -- Dataset represents a
whole database (including tables, relations, etc.), while the recordset
represents two-dimensional view of data (Table, view, result from stored
proc, etc)

In my opinion, you need to architect your solution better. You could return
a recordset object from the webservice, or a two-dimensional array.

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com


"Adam Short" <adam@phuture-uk.net> wrote in message
news:ObPbSewKFHA.3340@TK2MSFTNGP14.phx.gbl...
> 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?
>
>
============================================================ ================
======
>
> Web Service Code :
> ---------------------
>
> dim strSelect as string
> dim srcData as ODBCconnection
> dim fltData as ODBCdataAdapter
> dim myPath as String
>
> myPath = me.Context.Request.ServerVariables("APPL_PHYSICAL_PATH")
>
>
> dim rtnData as DataSet
>
> strSelect = "SELECT * FROM myDataSource"
>
> ' srcData = new ODBCConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
> SOURCE=" & myPath & "..\data\myDataSource.mdb" )
>
> srcData = new ODBCConnection( "DSN=MyDataSource;uid=;pwd=" )
>
> fltData = new ODBCdataAdapter( strSelect, srcData )
>
> rtnData = new dataset
>
> fltData.fill( rtnData )
>
> return rtnData
>
>
============================================================ ================
======
>
> ASP Web Server Code:
> -------------------------
>
> SET objSoapClient = Server.CreateObject("MSSOAP.SoapClient")
>
>
> ' needs to be updated with the url of your Web Service WSDL and is
> ' followed by the Web Service name
>
> objSoapClient.ClientProperty("ServerHTTPRequest") = True
>
> Call
>
objSoapClient.mssoapinit("http://system.evolucion.co.uk/evol ucion-services.a
smx?WSDL")
>
> set RecordSet = Server.CreateObject("ADODB.Recordset")
>
> ' use the SOAP object to call the Web Method Required
> RecordSet = objSoapClient.getEvolucionVersionList()
>
> strOutput = strOutput & "<P>On-Line Result : " & RecordSet.RecordCount
>
>
============================================================ ================
======
>
>

Report this message

#4: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-17 17:38:20 by reb01501

Adam Short wrote:
> 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?

No.
The dataset is returned as XML. You have to parse the returned XML Document
to extract your data. You can use the MSXML parser to extract the nodes you
need.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Report this message

#5: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-17 22:33:05 by Adam Short

how do you return a recordset from a webservice?

I have looked and not found anything yet?



"Manohar Kamath" <mkamath@TAKETHISOUTkamath.com> wrote in message
news:uhaGLpwKFHA.592@TK2MSFTNGP10.phx.gbl...
> The DataSet and RecordSet objects are not compatible -- Dataset represents
> a
> whole database (including tables, relations, etc.), while the recordset
> represents two-dimensional view of data (Table, view, result from stored
> proc, etc)
>
> In my opinion, you need to architect your solution better. You could
> return
> a recordset object from the webservice, or a two-dimensional array.
>
> --
> Manohar Kamath
> Editor, .netWire
> www.dotnetwire.com
>
>
> "Adam Short" <adam@phuture-uk.net> wrote in message
> news:ObPbSewKFHA.3340@TK2MSFTNGP14.phx.gbl...
>> 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?
>>
>>
> ============================================================ ================
> ======
>>
>> Web Service Code :
>> ---------------------
>>
>> dim strSelect as string
>> dim srcData as ODBCconnection
>> dim fltData as ODBCdataAdapter
>> dim myPath as String
>>
>> myPath = me.Context.Request.ServerVariables("APPL_PHYSICAL_PATH")
>>
>>
>> dim rtnData as DataSet
>>
>> strSelect = "SELECT * FROM myDataSource"
>>
>> ' srcData = new ODBCConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
>> SOURCE=" & myPath & "..\data\myDataSource.mdb" )
>>
>> srcData = new ODBCConnection( "DSN=MyDataSource;uid=;pwd=" )
>>
>> fltData = new ODBCdataAdapter( strSelect, srcData )
>>
>> rtnData = new dataset
>>
>> fltData.fill( rtnData )
>>
>> return rtnData
>>
>>
> ============================================================ ================
> ======
>>
>> ASP Web Server Code:
>> -------------------------
>>
>> SET objSoapClient = Server.CreateObject("MSSOAP.SoapClient")
>>
>>
>> ' needs to be updated with the url of your Web Service WSDL and is
>> ' followed by the Web Service name
>>
>> objSoapClient.ClientProperty("ServerHTTPRequest") = True
>>
>> Call
>>
> objSoapClient.mssoapinit("http://system.evolucion.co.uk/evol ucion-services.a
> smx?WSDL")
>>
>> set RecordSet = Server.CreateObject("ADODB.Recordset")
>>
>> ' use the SOAP object to call the Web Method Required
>> RecordSet = objSoapClient.getEvolucionVersionList()
>>
>> strOutput = strOutput & "<P>On-Line Result : " & RecordSet.RecordCount
>>
>>
> ============================================================ ================
> ======
>>
>>
>
>

Report this message

#6: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-17 22:48:13 by reb01501

You can't.
Well .. maybe ... using Interop, you might be able to create an ADO
recordset and stream it to XML which can be returned but ... I doubt it.
You'll need to ask in a dotnet newsgroup to be sure, but I really doubt it.
If it IS possible, then ADO will have no problem converting the returned XML
recordset into an ADO recordset using the Open method.

A web service returns results in the form of XML. A dotnet page can convert
the XML into the appropriate dotnet object. This cannot be done by vbscript.
You need to parse the returned XML using the methods found in the MSXML
parser: selectNodes, selectSingleNode, etc.

Bob Barrows
Adam Short wrote:
> how do you return a recordset from a webservice?
>
> I have looked and not found anything yet?
>
>
>
> "Manohar Kamath" <mkamath@TAKETHISOUTkamath.com> wrote in message
> news:uhaGLpwKFHA.592@TK2MSFTNGP10.phx.gbl...
>> The DataSet and RecordSet objects are not compatible -- Dataset
>> represents a
>> whole database (including tables, relations, etc.), while the
>> recordset represents two-dimensional view of data (Table, view,
>> result from stored proc, etc)
>>
>> In my opinion, you need to architect your solution better. You could
>> return
>> a recordset object from the webservice, or a two-dimensional array.
>>
>> --
>> Manohar Kamath
>> Editor, .netWire
>> www.dotnetwire.com
>>
>>
>> "Adam Short" <adam@phuture-uk.net> wrote in message
>> news:ObPbSewKFHA.3340@TK2MSFTNGP14.phx.gbl...
>>> 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?
>>>
>>>
>>
============================================================ ================
>> ======
>>>
>>> Web Service Code :
>>> ---------------------
>>>
>>> dim strSelect as string
>>> dim srcData as ODBCconnection
>>> dim fltData as ODBCdataAdapter
>>> dim myPath as String
>>>
>>> myPath = me.Context.Request.ServerVariables("APPL_PHYSICAL_PATH")
>>>
>>>
>>> dim rtnData as DataSet
>>>
>>> strSelect = "SELECT * FROM myDataSource"
>>>
>>> ' srcData = new ODBCConnection(
>>> "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & myPath &
>>> "..\data\myDataSource.mdb" )
>>>
>>> srcData = new ODBCConnection( "DSN=MyDataSource;uid=;pwd=" )
>>>
>>> fltData = new ODBCdataAdapter( strSelect, srcData )
>>>
>>> rtnData = new dataset
>>>
>>> fltData.fill( rtnData )
>>>
>>> return rtnData
>>>
>>>
>>
============================================================ ================
>> ======
>>>
>>> ASP Web Server Code:
>>> -------------------------
>>>
>>> SET objSoapClient = Server.CreateObject("MSSOAP.SoapClient")
>>>
>>>
>>> ' needs to be updated with the url of your Web Service WSDL and
>>> is ' followed by the Web Service name
>>>
>>> objSoapClient.ClientProperty("ServerHTTPRequest") = True
>>>
>>> Call
>>>
>>
objSoapClient.mssoapinit("http://system.evolucion.co.uk/evol ucion-services.a
>> smx?WSDL")
>>>
>>> set RecordSet = Server.CreateObject("ADODB.Recordset")
>>>
>>> ' use the SOAP object to call the Web Method Required
>>> RecordSet = objSoapClient.getEvolucionVersionList()
>>>
>>> strOutput = strOutput & "<P>On-Line Result : " &
>>> RecordSet.RecordCount
>>>
>>>
>>
============================================================ ================
>> ======

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Report this message

#7: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-17 22:59:59 by Adam Short

Right! I think I understand it now.

I will use an array instead, then I will also be able to use the same
webservice when connecting to linux based servers.


"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:Oz8UGszKFHA.3336@TK2MSFTNGP10.phx.gbl...
> You can't.
> Well .. maybe ... using Interop, you might be able to create an ADO
> recordset and stream it to XML which can be returned but ... I doubt it.
> You'll need to ask in a dotnet newsgroup to be sure, but I really doubt
> it.
> If it IS possible, then ADO will have no problem converting the returned
> XML
> recordset into an ADO recordset using the Open method.
>
> A web service returns results in the form of XML. A dotnet page can
> convert
> the XML into the appropriate dotnet object. This cannot be done by
> vbscript.
> You need to parse the returned XML using the methods found in the MSXML
> parser: selectNodes, selectSingleNode, etc.
>
> Bob Barrows
> Adam Short wrote:
>> how do you return a recordset from a webservice?
>>
>> I have looked and not found anything yet?
>>
>>
>>
>> "Manohar Kamath" <mkamath@TAKETHISOUTkamath.com> wrote in message
>> news:uhaGLpwKFHA.592@TK2MSFTNGP10.phx.gbl...
>>> The DataSet and RecordSet objects are not compatible -- Dataset
>>> represents a
>>> whole database (including tables, relations, etc.), while the
>>> recordset represents two-dimensional view of data (Table, view,
>>> result from stored proc, etc)
>>>
>>> In my opinion, you need to architect your solution better. You could
>>> return
>>> a recordset object from the webservice, or a two-dimensional array.
>>>
>>> --
>>> Manohar Kamath
>>> Editor, .netWire
>>> www.dotnetwire.com
>>>
>>>
>>> "Adam Short" <adam@phuture-uk.net> wrote in message
>>> news:ObPbSewKFHA.3340@TK2MSFTNGP14.phx.gbl...
>>>> 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?
>>>>
>>>>
>>>
> ============================================================ ================
>>> ======
>>>>
>>>> Web Service Code :
>>>> ---------------------
>>>>
>>>> dim strSelect as string
>>>> dim srcData as ODBCconnection
>>>> dim fltData as ODBCdataAdapter
>>>> dim myPath as String
>>>>
>>>> myPath = me.Context.Request.ServerVariables("APPL_PHYSICAL_PATH")
>>>>
>>>>
>>>> dim rtnData as DataSet
>>>>
>>>> strSelect = "SELECT * FROM myDataSource"
>>>>
>>>> ' srcData = new ODBCConnection(
>>>> "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & myPath &
>>>> "..\data\myDataSource.mdb" )
>>>>
>>>> srcData = new ODBCConnection( "DSN=MyDataSource;uid=;pwd=" )
>>>>
>>>> fltData = new ODBCdataAdapter( strSelect, srcData )
>>>>
>>>> rtnData = new dataset
>>>>
>>>> fltData.fill( rtnData )
>>>>
>>>> return rtnData
>>>>
>>>>
>>>
> ============================================================ ================
>>> ======
>>>>
>>>> ASP Web Server Code:
>>>> -------------------------
>>>>
>>>> SET objSoapClient = Server.CreateObject("MSSOAP.SoapClient")
>>>>
>>>>
>>>> ' needs to be updated with the url of your Web Service WSDL and
>>>> is ' followed by the Web Service name
>>>>
>>>> objSoapClient.ClientProperty("ServerHTTPRequest") = True
>>>>
>>>> Call
>>>>
>>>
> objSoapClient.mssoapinit("http://system.evolucion.co.uk/evol ucion-services.a
>>> smx?WSDL")
>>>>
>>>> set RecordSet = Server.CreateObject("ADODB.Recordset")
>>>>
>>>> ' use the SOAP object to call the Web Method Required
>>>> RecordSet = objSoapClient.getEvolucionVersionList()
>>>>
>>>> strOutput = strOutput & "<P>On-Line Result : " &
>>>> RecordSet.RecordCount
>>>>
>>>>
>>>
> ============================================================ ================
>>> ======
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>

Report this message

#8: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-18 14:08:22 by mkamath

Or, you can send the XML of the ADO recordset back, and re-construct it on
the client. Use Interop on the server to work with the ADO recordset.

// ON THE SERVER -- Web Service
// Add references to ADODB library

// Create a stream object
myStream = new ADODB.Stream();

// Replace the constants with their actual values
recordSet.Save(myStream, adPersistXML);
output = myStream.ReadText(adReadAll);

// Return the XML string, complete with schema
return output;

on the client, just re-create the disconnected recordset
http://support.microsoft.com/kb/263247

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com


"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:Oz8UGszKFHA.3336@TK2MSFTNGP10.phx.gbl...
> You can't.
> Well .. maybe ... using Interop, you might be able to create an ADO
> recordset and stream it to XML which can be returned but ... I doubt it.
> You'll need to ask in a dotnet newsgroup to be sure, but I really doubt
it.
> If it IS possible, then ADO will have no problem converting the returned
XML
> recordset into an ADO recordset using the Open method.
>
> A web service returns results in the form of XML. A dotnet page can
convert
> the XML into the appropriate dotnet object. This cannot be done by
vbscript.
> You need to parse the returned XML using the methods found in the MSXML
> parser: selectNodes, selectSingleNode, etc.
>
> Bob Barrows
> Adam Short wrote:
> > how do you return a recordset from a webservice?
> >
> > I have looked and not found anything yet?
> >
> >
> >
> > "Manohar Kamath" <mkamath@TAKETHISOUTkamath.com> wrote in message
> > news:uhaGLpwKFHA.592@TK2MSFTNGP10.phx.gbl...
> >> The DataSet and RecordSet objects are not compatible -- Dataset
> >> represents a
> >> whole database (including tables, relations, etc.), while the
> >> recordset represents two-dimensional view of data (Table, view,
> >> result from stored proc, etc)
> >>
> >> In my opinion, you need to architect your solution better. You could
> >> return
> >> a recordset object from the webservice, or a two-dimensional array.
> >>
> >> --
> >> Manohar Kamath
> >> Editor, .netWire
> >> www.dotnetwire.com
> >>
> >>
> >> "Adam Short" <adam@phuture-uk.net> wrote in message
> >> news:ObPbSewKFHA.3340@TK2MSFTNGP14.phx.gbl...
> >>> 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?
> >>>
> >>>
> >>
>
============================================================ ================
> >> ======
> >>>
> >>> Web Service Code :
> >>> ---------------------
> >>>
> >>> dim strSelect as string
> >>> dim srcData as ODBCconnection
> >>> dim fltData as ODBCdataAdapter
> >>> dim myPath as String
> >>>
> >>> myPath = me.Context.Request.ServerVariables("APPL_PHYSICAL_PATH")
> >>>
> >>>
> >>> dim rtnData as DataSet
> >>>
> >>> strSelect = "SELECT * FROM myDataSource"
> >>>
> >>> ' srcData = new ODBCConnection(
> >>> "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & myPath &
> >>> "..\data\myDataSource.mdb" )
> >>>
> >>> srcData = new ODBCConnection( "DSN=MyDataSource;uid=;pwd=" )
> >>>
> >>> fltData = new ODBCdataAdapter( strSelect, srcData )
> >>>
> >>> rtnData = new dataset
> >>>
> >>> fltData.fill( rtnData )
> >>>
> >>> return rtnData
> >>>
> >>>
> >>
>
============================================================ ================
> >> ======
> >>>
> >>> ASP Web Server Code:
> >>> -------------------------
> >>>
> >>> SET objSoapClient = Server.CreateObject("MSSOAP.SoapClient")
> >>>
> >>>
> >>> ' needs to be updated with the url of your Web Service WSDL and
> >>> is ' followed by the Web Service name
> >>>
> >>> objSoapClient.ClientProperty("ServerHTTPRequest") = True
> >>>
> >>> Call
> >>>
> >>
>
objSoapClient.mssoapinit("http://system.evolucion.co.uk/evol ucion-services.a
> >> smx?WSDL")
> >>>
> >>> set RecordSet = Server.CreateObject("ADODB.Recordset")
> >>>
> >>> ' use the SOAP object to call the Web Method Required
> >>> RecordSet = objSoapClient.getEvolucionVersionList()
> >>>
> >>> strOutput = strOutput & "<P>On-Line Result : " &
> >>> RecordSet.RecordCount
> >>>
> >>>
> >>
>
============================================================ ================
> >> ======
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>

Report this message

#9: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-18 14:25:25 by reb01501

Manohar Kamath wrote:
> Or, you can send the XML of the ADO recordset back, and re-construct
> it on the client. Use Interop on the server to work with the ADO
> recordset.
>
> // ON THE SERVER -- Web Service
> // Add references to ADODB library
>
> // Create a stream object
> myStream = new ADODB.Stream();
>
> // Replace the constants with their actual values
> recordSet.Save(myStream, adPersistXML);
> output = myStream.ReadText(adReadAll);
>
> // Return the XML string, complete with schema
> return output;
>
> on the client, just re-create the disconnected recordset
> http://support.microsoft.com/kb/263247
>
All right, I wasn't sure this was possible, so thanks for confirming that it
is possible.

I do appreciate that you are answering the question that was asked. But I do
feel the need to express this reservation:

My only issue with this solution is that it will force ALL consumers of this
service to use ADO, essentially forcing any .Net apps that consume it to
also use Interop to process the results. I realize that you could pass a
flag indicating how the results should be returned (dataset vs recordset)
but that forces the developer to maintain two sets of code that do
essentially the same thing. My preference would be to simply create a sparse
xml document containing the data and return that.

However, if this service is intended to be consumed only by non-.Net
applications, then go for it.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Report this message

#10: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-18 14:33:58 by mkamath

Bob,

Not really, since we still return XML that you can parse it to get back
results -- no different from say if you returned "plain xml." The solution
will not apply to all situations. I am only suggesting based on the case in
hand.

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com


"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:erJZz37KFHA.2420@TK2MSFTNGP12.phx.gbl...
> Manohar Kamath wrote:
> > Or, you can send the XML of the ADO recordset back, and re-construct
> > it on the client. Use Interop on the server to work with the ADO
> > recordset.
> >
> > // ON THE SERVER -- Web Service
> > // Add references to ADODB library
> >
> > // Create a stream object
> > myStream = new ADODB.Stream();
> >
> > // Replace the constants with their actual values
> > recordSet.Save(myStream, adPersistXML);
> > output = myStream.ReadText(adReadAll);
> >
> > // Return the XML string, complete with schema
> > return output;
> >
> > on the client, just re-create the disconnected recordset
> > http://support.microsoft.com/kb/263247
> >
> All right, I wasn't sure this was possible, so thanks for confirming that
it
> is possible.
>
> I do appreciate that you are answering the question that was asked. But I
do
> feel the need to express this reservation:
>
> My only issue with this solution is that it will force ALL consumers of
this
> service to use ADO, essentially forcing any .Net apps that consume it to
> also use Interop to process the results. I realize that you could pass a
> flag indicating how the results should be returned (dataset vs recordset)
> but that forces the developer to maintain two sets of code that do
> essentially the same thing. My preference would be to simply create a
sparse
> xml document containing the data and return that.
>
> However, if this service is intended to be consumed only by non-.Net
> applications, then go for it.
>
> Bob Barrows
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>

Report this message

#11: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-18 14:53:10 by reb01501

Manohar Kamath wrote:
> Bob,
>
> Not really, since we still return XML that you can parse it to get
> back results --

But now we are back to my initial suggestion that the poster parse the
dataset xml in his classic ASP application to extract his data. :-)
Except that you are suggesting the reverse: that the .Net consumer parse the
recordset XML to extract his data. :-)

> no different from say if you returned "plain xml."

I'm just saying that my preference would be to avoid the Interop.

> The solution will not apply to all situations. I am only suggesting
> based on the case in hand.

That's why I said:
>> I do appreciate that you are answering the question that was asked.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Report this message

#12: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-18 19:27:35 by Adam Short

So many choices, I really appreciate everything everyone has said regarding
this matter, what to do is the ultimate question.

The scenario follows;

Windows 2003 Server has web services.

Classic ASP, ASP.NET & PHP Websites will eventually need the ability to get
the data.

I am now looking at the possibility of passing back an array of objects.
i.e.

MyClass
{
obj1 as Integer
obj2 as String
}

The Web Service generates a structure very well indeed and all looks well.
However when I try to read the object at the Classic ASP side it fails. I
understand passing through to .NET should be easy, so what do you guys
think?

My tests so far show that SOAPClient can easily interpret strings and
integers, although I am having difficulty with arrays of these types.

My ASP code looks like this

SET objSoapClient = Server.CreateObject("MSSOAP.SoapClient")

' needs to be updated with the url of your Web Service WSDL and is
' followed by the Web Service name

objSoapClient.ClientProperty("ServerHTTPRequest") = True

Call objSoapClient.mssoapinit("http://domain/script.asmx?WSDL")

' use the SOAP object to call the Web Method Required
thisData = objSoapClient.testInteger()

strOutput = strOutput & "<P>On-Line Result : " & thisData

thisData = objSoapClient.testString()

strOutput = strOutput & "<P>On-Line Result : " & thisData

thisData = objSoapClient.testObject()

strOutput = strOutput & "<P>On-Line Result : " & thisData.Filename

thisData = objSoapClient.testIntegerArray()

strOutput = strOutput & "<P>On-Line Result : " & thisData(0)

set objSoapClient = nothing

How can I get SOAP to read the integer array? as the above code doesn't
work, also, why is the object not being created as I understand the SOAP
toolkit shoul be able to cope with this.

Here is a snippet from the Web Services script

<webmethod()> public function testIntegerArray() as integer()

Dim MyList(2) As integer

MyList(0)=1000
MyList(1)=2000

Return MyList

end function

<webmethod()> public function testObject() as
DataTypesVB.Enumerations.EvolucionVersionList

Dim MyList As DataTypesVB.Enumerations.EvolucionVersionList

MyList = New DataTypesVB.Enumerations.EvolucionVersionList()
MyList.FileName="test.asp"
MyList.Ver = "1.0"

Return MyList

end function


<webmethod()> public function testString() as String

Dim MyList As String

MyList="test.asp"

Return MyList

end function

<webmethod()> public function testInteger() as integer

Dim MyList As integer

MyList=1000

Return MyList

end function

This is driving me crazy, I'm sure its very simple.

Regards

Adam


"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:OVPdTH8KFHA.1176@TK2MSFTNGP12.phx.gbl...
> Manohar Kamath wrote:
>> Bob,
>>
>> Not really, since we still return XML that you can parse it to get
>> back results --
>
> But now we are back to my initial suggestion that the poster parse the
> dataset xml in his classic ASP application to extract his data. :-)
> Except that you are suggesting the reverse: that the .Net consumer parse
> the
> recordset XML to extract his data. :-)
>
>> no different from say if you returned "plain xml."
>
> I'm just saying that my preference would be to avoid the Interop.
>
>> The solution will not apply to all situations. I am only suggesting
>> based on the case in hand.
>
> That's why I said:
>>> I do appreciate that you are answering the question that was asked.
>
> Bob Barrows
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>

Report this message

#13: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-18 20:06:50 by reb01501

Adam Short wrote:
> So many choices, I really appreciate everything everyone has said
> regarding this matter, what to do is the ultimate question.
>
> The scenario follows;
>
> Windows 2003 Server has web services.
>
> Classic ASP, ASP.NET & PHP Websites will eventually need the ability
> to get the data.
>
> I am now looking at the possibility of passing back an array of
> objects. i.e.
>
> MyClass
> {
> obj1 as Integer
> obj2 as String
> }
>
> The Web Service generates a structure very well indeed and all looks
> well. However when I try to read the object at the Classic ASP side
> it fails. I understand passing through to .NET should be easy, so
> what do you guys think?

A classic ASP consumer can not interpret a system object. All it can do is
parse the XML that is returned. It cannot directly read any objects. You can
see the xml that is returned by browsing to your web service. Use the
interface provided to enter parameters and run the procedure. The resulting
page will show the XML that is being passed to the client. You will need to
use the methods in the msxml parser to extract your data from that XML. Here
are a few articles to help you:

http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls =GGLD,GGLD:2003-36,GGLD:en&q=consuming+web+services+in+class ic+ASP

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Report this message

#14: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-18 23:09:12 by mkamath

Would be interesting to see if a VBScript class can be used instead -- Since
SOAP, when de-serializing, just maps properties by their name.

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com


"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:%23JKCl2%23KFHA.244@TK2MSFTNGP12.phx.gbl...
> Adam Short wrote:
> > So many choices, I really appreciate everything everyone has said
> > regarding this matter, what to do is the ultimate question.
> >
> > The scenario follows;
> >
> > Windows 2003 Server has web services.
> >
> > Classic ASP, ASP.NET & PHP Websites will eventually need the ability
> > to get the data.
> >
> > I am now looking at the possibility of passing back an array of
> > objects. i.e.
> >
> > MyClass
> > {
> > obj1 as Integer
> > obj2 as String
> > }
> >
> > The Web Service generates a structure very well indeed and all looks
> > well. However when I try to read the object at the Classic ASP side
> > it fails. I understand passing through to .NET should be easy, so
> > what do you guys think?
>
> A classic ASP consumer can not interpret a system object. All it can do is
> parse the XML that is returned. It cannot directly read any objects. You
can
> see the xml that is returned by browsing to your web service. Use the
> interface provided to enter parameters and run the procedure. The
resulting
> page will show the XML that is being passed to the client. You will need
to
> use the methods in the msxml parser to extract your data from that XML.
Here
> are a few articles to help you:
>
>
http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls =GGLD,GGLD:2003-36,GGLD:en&q=consuming+web+services+in+class ic+ASP
>
> Bob Barrows
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>

Report this message

#15: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-19 00:02:55 by reb01501

Yes, it would be interesting to see. Unfortunately, I don't have time to
find out :-)
Maybe this weekend ...

Bob
Manohar Kamath wrote:
> Would be interesting to see if a VBScript class can be used instead
> -- Since SOAP, when de-serializing, just maps properties by their
> name.
>
> --
> Manohar Kamath
> Editor, .netWire
> www.dotnetwire.com
>
>
> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
> news:%23JKCl2%23KFHA.244@TK2MSFTNGP12.phx.gbl...
>> Adam Short wrote:
>>> So many choices, I really appreciate everything everyone has said
>>> regarding this matter, what to do is the ultimate question.
>>>
>>> The scenario follows;
>>>
>>> Windows 2003 Server has web services.
>>>
>>> Classic ASP, ASP.NET & PHP Websites will eventually need the ability
>>> to get the data.
>>>
>>> I am now looking at the possibility of passing back an array of
>>> objects. i.e.
>>>
>>> MyClass
>>> {
>>> obj1 as Integer
>>> obj2 as String
>>> }
>>>
>>> The Web Service generates a structure very well indeed and all looks
>>> well. However when I try to read the object at the Classic ASP side
>>> it fails. I understand passing through to .NET should be easy, so
>>> what do you guys think?
>>
>> A classic ASP consumer can not interpret a system object. All it can
>> do is parse the XML that is returned. It cannot directly read any
>> objects. You can see the xml that is returned by browsing to your
>> web service. Use the interface provided to enter parameters and run
>> the procedure. The resulting page will show the XML that is being
>> passed to the client. You will need to use the methods in the msxml
>> parser to extract your data from that XML. Here are a few articles
>> to help you:
>>
>>
>
http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls =GGLD,GGLD:2003-36,GGLD:en&q=consuming+web+services+in+class ic+ASP
>>
>> Bob Barrows
>> --
>> Microsoft MVP -- ASP/ASP.NET
>> Please reply to the newsgroup. The email account listed in my From
>> header is my spam trap, so I don't check it very often. You will get
>> a quicker response by posting to the newsgroup.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Report this message

#16: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-19 00:05:57 by Chris Hohmann

"Adam Short" <adam@phuture-uk.net> wrote in message
news:ObPbSewKFHA.3340@TK2MSFTNGP14.phx.gbl...
>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?
[snip]

Here's a proof of concept I came up with. Basically, it makes an HTTP GET
call the getEvolucionVersionList operation of your webservice, then loads
the resultant xml into a MSXML2.DomDocument and transforms the xml to html
using a XSLT stylesheet. HTTP, XML and XSLT are all pretty standard, so this
concept should port easily to PHP, ASP.NET, JSP, etc...

[EvolucionVersionList2HTML.xsl]
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="4.0" indent="yes"/>
<xsl:template match="NewDataSet">
<html>
<body>
<table>
<tr>
<th>RecordID</th>
<th>ModuleName</th>
<th>Description</th>
<th>FileName</th>
<th>Version</th>
<th>Location</th>
<th>SystemVariable</th>
<th>DateEdited</th>
<th>Status</th>
</tr>
<xsl:apply-templates select="Table"/>
</table>
<xsl:value-of select="count(Table)"/> Record(s)
</body>
</html>
</xsl:template>
<xsl:template match="Table">
<tr>
<td><xsl:value-of select="RecordID"/></td>
<td><xsl:value-of select="ModuleName"/></td>
<td><xsl:value-of select="Description"/></td>
<td><xsl:value-of select="FileName"/></td>
<td><xsl:value-of select="Version"/></td>
<td><xsl:value-of select="Location"/></td>
<td><xsl:value-of select="SystemVariable"/></td>
<td><xsl:value-of select="DateEdited"/></td>
<td><xsl:value-of select="Status"/></td>
</tr>
</xsl:template>
</xsl:stylesheet>

[getEvolucionVersionList.asp]
<%
Dim url, http, xml, xsl
url =
"http://system.evolucion.co.uk/evolucion-services.asmx/getEv olucionVersionList"
Set http = CreateObject("MSXML2.ServerXMLHTTP.4.0")
http.Open "GET",url,False
http.Send
Set xml = CreateObject("MSXML2.DOMDocument.4.0")
xml.loadXML http.responseText
Set xsl = CreateObject("MSXML2.DOMDocument.4.0")
xsl.load Server.MapPath("EvolucionVersionList2HTML.xsl")
xml.transformNodeToObject xsl, Response
Set http = Nothing
Set xsl = Nothing
Set xml = Nothing
%>

NOTES:
1. I'm currently using MSXML 4.0. If you're using version 3.0 (which is
likely), you'll need to modify the asp file accordingly. For example,
"MSXML2.ServerXMLHTTP.4.0" would become "MSXML2.ServerXMLHTTP.3.0"

2. I opted not to include the SourceCode data in the html table
presentation.

3. There's nothing wrong with using SOAP to get the data instead of HTTP to
get the data as you did in your origianl code. However, you indicated that
eventually end users would need to be able to consume the service from a
number of different environments. Some of those environments may not have
SOAP, so I wanted to show that it could be done without it.

4. On a completely unrelated note, I noticed that you're using the ".inc"
extension for your include files. Also, it appears you're loading objects
into the Application scope. Here are two articles that explain why these are
not good ideas:

http://aspfaq.com/show.asp?id=2269
http://aspfaq.com/show.asp?id=2053


HTH
-Chris Hohmann

Report this message

#17: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-21 17:44:29 by Adam Short

Thankyou for your input, and comments.

I am fully aware that I could use XMLRPC as you have suggested, but am
really just looking to utilize SOAP as an alternative. More research than
necessity, in fact to be honest I am very disappointed with SOAP on the
whole, and wonder why anyone would implement a system which is so
restrictive.

In the past I have used a hacked XMLRPC procedure developed originally by
David Carter-Tod. Although bugged, I have fixed most of them.





"Chris Hohmann" <nospam@thankyou.com> wrote in message
news:eEYJW9ALFHA.1308@TK2MSFTNGP15.phx.gbl...
> "Adam Short" <adam@phuture-uk.net> wrote in message
> news:ObPbSewKFHA.3340@TK2MSFTNGP14.phx.gbl...
>>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?
> [snip]
>
> Here's a proof of concept I came up with. Basically, it makes an HTTP GET
> call the getEvolucionVersionList operation of your webservice, then loads
> the resultant xml into a MSXML2.DomDocument and transforms the xml to html
> using a XSLT stylesheet. HTTP, XML and XSLT are all pretty standard, so
> this concept should port easily to PHP, ASP.NET, JSP, etc...
>
> [EvolucionVersionList2HTML.xsl]
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method="html" version="4.0" indent="yes"/>
> <xsl:template match="NewDataSet">
> <html>
> <body>
> <table>
> <tr>
> <th>RecordID</th>
> <th>ModuleName</th>
> <th>Description</th>
> <th>FileName</th>
> <th>Version</th>
> <th>Location</th>
> <th>SystemVariable</th>
> <th>DateEdited</th>
> <th>Status</th>
> </tr>
> <xsl:apply-templates select="Table"/>
> </table>
> <xsl:value-of select="count(Table)"/> Record(s)
> </body>
> </html>
> </xsl:template>
> <xsl:template match="Table">
> <tr>
> <td><xsl:value-of select="RecordID"/></td>
> <td><xsl:value-of select="ModuleName"/></td>
> <td><xsl:value-of select="Description"/></td>
> <td><xsl:value-of select="FileName"/></td>
> <td><xsl:value-of select="Version"/></td>
> <td><xsl:value-of select="Location"/></td>
> <td><xsl:value-of select="SystemVariable"/></td>
> <td><xsl:value-of select="DateEdited"/></td>
> <td><xsl:value-of select="Status"/></td>
> </tr>
> </xsl:template>
> </xsl:stylesheet>
>
> [getEvolucionVersionList.asp]
> <%
> Dim url, http, xml, xsl
> url =
> "http://system.evolucion.co.uk/evolucion-services.asmx/getEv olucionVersionList"
> Set http = CreateObject("MSXML2.ServerXMLHTTP.4.0")
> http.Open "GET",url,False
> http.Send
> Set xml = CreateObject("MSXML2.DOMDocument.4.0")
> xml.loadXML http.responseText
> Set xsl = CreateObject("MSXML2.DOMDocument.4.0")
> xsl.load Server.MapPath("EvolucionVersionList2HTML.xsl")
> xml.transformNodeToObject xsl, Response
> Set http = Nothing
> Set xsl = Nothing
> Set xml = Nothing
> %>
>
> NOTES:
> 1. I'm currently using MSXML 4.0. If you're using version 3.0 (which is
> likely), you'll need to modify the asp file accordingly. For example,
> "MSXML2.ServerXMLHTTP.4.0" would become "MSXML2.ServerXMLHTTP.3.0"
>
> 2. I opted not to include the SourceCode data in the html table
> presentation.
>
> 3. There's nothing wrong with using SOAP to get the data instead of HTTP
> to get the data as you did in your origianl code. However, you indicated
> that eventually end users would need to be able to consume the service
> from a number of different environments. Some of those environments may
> not have SOAP, so I wanted to show that it could be done without it.
>
> 4. On a completely unrelated note, I noticed that you're using the ".inc"
> extension for your include files. Also, it appears you're loading objects
> into the Application scope. Here are two articles that explain why these
> are not good ideas:
>
> http://aspfaq.com/show.asp?id=2269
> http://aspfaq.com/show.asp?id=2053
>
>
> HTH
> -Chris Hohmann
>
>

Report this message

#18: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-21 19:38:06 by reb01501

I think MS agrees with you, given that they have deprecated that toolkit.

Adam Short wrote:
> Thankyou for your input, and comments.
>
> I am fully aware that I could use XMLRPC as you have suggested, but am
> really just looking to utilize SOAP as an alternative. More research
> than necessity, in fact to be honest I am very disappointed with
> SOAP on the whole, and wonder why anyone would implement a system
> which is so restrictive.
>
> In the past I have used a hacked XMLRPC procedure developed
> originally by David Carter-Tod. Although bugged, I have fixed most
> of them.
>
>
>
>
>
> "Chris Hohmann" <nospam@thankyou.com> wrote in message
> news:eEYJW9ALFHA.1308@TK2MSFTNGP15.phx.gbl...
>> "Adam Short" <adam@phuture-uk.net> wrote in message
>> news:ObPbSewKFHA.3340@TK2MSFTNGP14.phx.gbl...
>>> 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?
>> [snip]
>>
>> Here's a proof of concept I came up with. Basically, it makes an
>> HTTP GET call the getEvolucionVersionList operation of your
>> webservice, then loads the resultant xml into a MSXML2.DomDocument
>> and transforms the xml to html using a XSLT stylesheet. HTTP, XML
>> and XSLT are all pretty standard, so this concept should port easily
>> to PHP, ASP.NET, JSP, etc...
>>
>> [EvolucionVersionList2HTML.xsl]
>> <?xml version="1.0" encoding="utf-8"?>
>> <xsl:stylesheet version="1.0"
>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>> <xsl:output method="html" version="4.0" indent="yes"/>
>> <xsl:template match="NewDataSet">
>> <html>
>> <body>
>> <table>
>> <tr>
>> <th>RecordID</th>
>> <th>ModuleName</th>
>> <th>Description</th>
>> <th>FileName</th>
>> <th>Version</th>
>> <th>Location</th>
>> <th>SystemVariable</th>
>> <th>DateEdited</th>
>> <th>Status</th>
>> </tr>
>> <xsl:apply-templates select="Table"/>
>> </table>
>> <xsl:value-of select="count(Table)"/> Record(s)
>> </body>
>> </html>
>> </xsl:template>
>> <xsl:template match="Table">
>> <tr>
>> <td><xsl:value-of select="RecordID"/></td>
>> <td><xsl:value-of select="ModuleName"/></td>
>> <td><xsl:value-of select="Description"/></td>
>> <td><xsl:value-of select="FileName"/></td>
>> <td><xsl:value-of select="Version"/></td>
>> <td><xsl:value-of select="Location"/></td>
>> <td><xsl:value-of select="SystemVariable"/></td>
>> <td><xsl:value-of select="DateEdited"/></td>
>> <td><xsl:value-of select="Status"/></td>
>> </tr>
>> </xsl:template>
>> </xsl:stylesheet>
>>
>> [getEvolucionVersionList.asp]
>> <%
>> Dim url, http, xml, xsl
>> url =
>>
"http://system.evolucion.co.uk/evolucion-services.asmx/getEv olucionVersionLi
st"
>> Set http = CreateObject("MSXML2.ServerXMLHTTP.4.0")
>> http.Open "GET",url,False
>> http.Send
>> Set xml = CreateObject("MSXML2.DOMDocument.4.0")
>> xml.loadXML http.responseText
>> Set xsl = CreateObject("MSXML2.DOMDocument.4.0")
>> xsl.load Server.MapPath("EvolucionVersionList2HTML.xsl")
>> xml.transformNodeToObject xsl, Response
>> Set http = Nothing
>> Set xsl = Nothing
>> Set xml = Nothing
>> %>
>>
>> NOTES:
>> 1. I'm currently using MSXML 4.0. If you're using version 3.0 (which
>> is likely), you'll need to modify the asp file accordingly. For
>> example, "MSXML2.ServerXMLHTTP.4.0" would become
>> "MSXML2.ServerXMLHTTP.3.0"
>>
>> 2. I opted not to include the SourceCode data in the html table
>> presentation.
>>
>> 3. There's nothing wrong with using SOAP to get the data instead of
>> HTTP to get the data as you did in your origianl code. However, you
>> indicated that eventually end users would need to be able to consume
>> the service from a number of different environments. Some of those
>> environments may not have SOAP, so I wanted to show that it could be
>> done without it.
>>
>> 4. On a completely unrelated note, I noticed that you're using the
>> ".inc" extension for your include files. Also, it appears you're
>> loading objects into the Application scope. Here are two articles
>> that explain why these are not good ideas:
>>
>> http://aspfaq.com/show.asp?id=2269
>> http://aspfaq.com/show.asp?id=2053
>>
>>
>> HTH
>> -Chris Hohmann

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Report this message

#19: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-22 16:18:50 by Adam Short

I have decided to implement a sort of XML recordset system using Web
Services to generate an XML recordset which will be pulled into an ASP ADO
Recordset, however in all the excitement I've gone and killed my ADODB
component on the server. There's another posting covering that!

Once I've sorted this issue out I will begin testing the final code. If it
works I will post it here.

Thanks Again to everyone

Regards

Adam


"Manohar Kamath" <mkamath@TAKETHISOUTkamath.com> wrote in message
news:%23b75e87KFHA.3992@TK2MSFTNGP15.phx.gbl...
> Bob,
>
> Not really, since we still return XML that you can parse it to get back
> results -- no different from say if you returned "plain xml." The solution
> will not apply to all situations. I am only suggesting based on the case
> in
> hand.
>
> --
> Manohar Kamath
> Editor, .netWire
> www.dotnetwire.com
>
>
> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
> news:erJZz37KFHA.2420@TK2MSFTNGP12.phx.gbl...
>> Manohar Kamath wrote:
>> > Or, you can send the XML of the ADO recordset back, and re-construct
>> > it on the client. Use Interop on the server to work with the ADO
>> > recordset.
>> >
>> > // ON THE SERVER -- Web Service
>> > // Add references to ADODB library
>> >
>> > // Create a stream object
>> > myStream = new ADODB.Stream();
>> >
>> > // Replace the constants with their actual values
>> > recordSet.Save(myStream, adPersistXML);
>> > output = myStream.ReadText(adReadAll);
>> >
>> > // Return the XML string, complete with schema
>> > return output;
>> >
>> > on the client, just re-create the disconnected recordset
>> > http://support.microsoft.com/kb/263247
>> >
>> All right, I wasn't sure this was possible, so thanks for confirming that
> it
>> is possible.
>>
>> I do appreciate that you are answering the question that was asked. But I
> do
>> feel the need to express this reservation:
>>
>> My only issue with this solution is that it will force ALL consumers of
> this
>> service to use ADO, essentially forcing any .Net apps that consume it to
>> also use Interop to process the results. I realize that you could pass a
>> flag indicating how the results should be returned (dataset vs recordset)
>> but that forces the developer to maintain two sets of code that do
>> essentially the same thing. My preference would be to simply create a
> sparse
>> xml document containing the data and return that.
>>
>> However, if this service is intended to be consumed only by non-.Net
>> applications, then go for it.
>>
>> Bob Barrows
>>
>> --
>> Microsoft MVP -- ASP/ASP.NET
>> Please reply to the newsgroup. The email account listed in my From
>> header is my spam trap, so I don't check it very often. You will get a
>> quicker response by posting to the newsgroup.
>>
>>
>
>

Report this message

#20: Re: Classic ASP to .NET WebService interfacing (Dataset to RecordSet)

Posted on 2005-03-23 14:31:41 by Adam Short

This is a multi-part message in MIME format.

------=_NextPart_000_003E_01C52FAC.A7F8ADA0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Well here it is!! The answer I think I have been looking for!!!


First you need to get adodb.dll and insert this line of code at the top =
of your webservice.

<%@ Assembly name=3D"adodb" %>

Then add the line;

imports adodb

Then the rest is history

<webmethod()> public function testRecordSet() as ADODB.Recordset


' srcData =3D new ODBCConnection( =
"PROVIDER=3DMicrosoft.Jet.OLEDB.4.0;DATA SOURCE=3D" & myPath & =
"..\data\evolucion.mdb" )
' srcData =3D new ODBCConnection( "DSN=3DPhutureUKSystem;uid=3D;pwd=3D" =
)



' Declare and instantiate an ADODB Connection object.=20
Dim objCon As New ADODB.Connection=20
Dim objData As New ADODB.Recordset=20
Dim objStream As New ADODB.Stream=20

objCon.Open ("DSN=3DPhutureUKSystem; uid=3D; pwd=3D")

objData.Open ("EvolucionCode", objCon, =
ADODB.CursorTypeEnum.adOpenStatic, =
ADODB.LockTypeEnum.adLockBatchOptimistic)

objData.Save(objStream, ADODB.PersistFormatEnum.adPersistXML)=20

return objStream.ReadText=20

'Clean up. Finally always occurs so cleanup here.=20
objCon.Close()=20
objData.Close()=20

end function

A recordset is returned, now all I need to do is open it up the other =
end!



"Adam Short" <adam@phuture-uk.net> wrote in message =
news:ObPbSewKFHA.3340@TK2MSFTNGP14.phx.gbl...
>I am trying to write a routine that will connect a .NET server with a=20
> classic ASP server.
>=20
> I know the following code doesn't work! The data is being returned =
as a=20
> dataset, however ASP does not recognise datasets and requires a =
recordset.=20
> Can the datatypes be converted? At the Classic ASP end or .NET end? =
Can=20
> SOAP toolkit provide the conversion, can any toolkit provide a =
conversion?
>=20
> =
==================== =====3D=
==================== =====3D=
==================== =====3D=
=======3D
>=20
> Web Service Code :
> ---------------------
>=20
> dim strSelect as string
> dim srcData as ODBCconnection
> dim fltData as ODBCdataAdapter
> dim myPath as String
>=20
> myPath =3D me.Context.Request.ServerVariables("APPL_PHYSICAL_PATH")
>=20
>=20
> dim rtnData as DataSet
>=20
> strSelect =3D "SELECT * FROM myDataSource"
>=20
> ' srcData =3D new ODBCConnection( =
"PROVIDER=3DMicrosoft.Jet.OLEDB.4.0;DATA=20
> SOURCE=3D" & myPath & "..\data\myDataSource.mdb" )
>=20
> srcData =3D new ODBCConnection( "DSN=3DMyDataSource;uid=3D;pwd=3D" )
>=20
> fltData =3D new ODBCdataAdapter( strSelect, srcData )
>=20
> rtnData =3D new dataset
>=20
> fltData.fill( rtnData )
>=20
> return rtnData
>=20
> =
==================== =====3D=
==================== =====3D=
==================== =====3D=
=======3D
>=20
> ASP Web Server Code:
> -------------------------
>=20
> SET objSoapClient =3D Server.CreateObject("MSSOAP.SoapClient")
>=20
>=20
> ' needs to be updated with the url of your Web Service WSDL and is
> ' followed by the Web Service name
>=20
> objSoapClient.ClientProperty("ServerHTTPRequest") =3D True
>=20
> Call=20
> =
objSoapClient.mssoapinit("http://system.evolucion.co.uk/evol ucion-service=
s.asmx?WSDL")
>=20
> set RecordSet =3D Server.CreateObject("ADODB.Recordset")
>=20
> ' use the SOAP object to call the Web Method Required
> RecordSet =3D objSoapClient.getEvolucionVersionList()
>=20
> strOutput =3D strOutput & "<P>On-Line Result : " & =
RecordSet.RecordCount
>=20
> =
==================== =====3D=
==================== =====3D=
==================== =====3D=
=======
>=20
>
------=_NextPart_000_003E_01C52FAC.A7F8ADA0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2604" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Well here it is!!&nbsp; The answer I =
think I have=20
been looking for!!!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>First you need to get adodb.dll and =
insert this=20
line of code at the top of your webservice.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3DCourier>&lt;%@ Assembly =
name=3D"adodb"=20
%&gt;</FONT><BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Then add the line;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DCourier size=3D2>imports adodb</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Then the rest is history</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DCourier size=3D2>&nbsp;&lt;webmethod()&gt; public =
function=20
testRecordSet() as ADODB.Recordset</FONT></DIV>
<DIV><FONT face=3DCourier size=3D2></FONT>&nbsp;</DIV>
<DIV><BR><FONT face=3DCourier size=3D2>'&nbsp;&nbsp;srcData =3D new =
ODBCConnection(=20
"PROVIDER=3DMicrosoft.Jet.OLEDB.4.0;DATA SOURCE=3D" &amp; myPath &amp;=20
"..\data\evolucion.mdb" )<BR>'&nbsp;&nbsp;srcData =3D new =
ODBCConnection(=20
"DSN=3DPhutureUKSystem;uid=3D;pwd=3D" )</FONT></DIV>
<DIV><FONT face=3DCourier size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DCourier size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DCourier size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DCourier =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '=20
Declare and instantiate an ADODB Connection object.=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim objCon As New=20
ADODB.Connection <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim =
objData As=20
New ADODB.Recordset <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim =
objStream=20
As New ADODB.Stream </FONT></DIV>
<DIV><FONT face=3DCourier size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DCourier size=3D2>&nbsp;&nbsp;objCon.Open =
("DSN=3DPhutureUKSystem;=20
uid=3D; pwd=3D")</FONT></DIV>
<DIV><FONT face=3DCourier size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DCourier size=3D2>&nbsp;&nbsp;objData.Open =
("EvolucionCode",=20
objCon, ADODB.CursorTypeEnum.adOpenStatic,=20
ADODB.LockTypeEnum.adLockBatchOptimistic)</FONT></DIV>
<DIV><FONT face=3DCourier size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DCourier =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
objData.Save(objStream, ADODB.PersistFormatEnum.adPersistXML) =
</FONT></DIV>
<DIV><FONT face=3DCourier size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DCourier size=3D2>&nbsp;&nbsp;return objStream.ReadText =

</FONT></DIV>
<DIV><FONT face=3DCourier size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DCourier size=3D2>&nbsp;&nbsp;&nbsp;'Clean up. Finally =
always=20
occurs so cleanup here. =
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
objCon.Close() <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
objData.Close() </FONT></DIV>
<DIV><FONT face=3DCourier size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3DCourier>&nbsp;end=20
function<BR></FONT><BR>A recordset is returned, now all I need to do is =
open it=20
up the other end!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>"Adam Short" &lt;</FONT><A=20
href=3D"mailto:adam@phuture-uk.net"><FONT face=3DArial=20
size=3D2>adam@phuture-uk.net</FONT></A><FONT face=3DArial size=3D2>&gt; =
wrote in=20
message </FONT><A =
href=3D"news:ObPbSewKFHA.3340@TK2MSFTNGP14.phx.gbl"><FONT=20
face=3DArial =
size=3D2>news:ObPbSewKFHA.3340@TK2MSFTNGP14.phx.gbl</FONT></A><FONT=20
face=3DArial size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt;I =
am trying to=20
write a routine that will connect a .NET server with a <BR>&gt; classic =
ASP=20
server.<BR>&gt; <BR>&gt; I know the following code doesn't =
work!&nbsp;&nbsp; The=20
data is being returned as a <BR>&gt; dataset, however ASP does not =
recognise=20
datasets and requires a recordset. <BR>&gt; Can the datatypes be=20
converted?&nbsp; At the Classic ASP end or .NET end?&nbsp; Can <BR>&gt; =
SOAP=20
toolkit provide the conversion, can any toolkit provide a =
conversion?<BR>&gt;=20
<BR>&gt;=20
==================== =====3D=
==================== =====3D=
==================== =====3D=
=======3D<BR>&gt;=20
<BR>&gt; Web Service Code :<BR>&gt; ---------------------<BR>&gt; =
<BR>&gt;&nbsp;=20
dim strSelect as string<BR>&gt;&nbsp; dim srcData as=20
ODBCconnection<BR>&gt;&nbsp; dim fltData as =
ODBCdataAdapter<BR>&gt;&nbsp; dim=20
myPath as String<BR>&gt; <BR>&gt;&nbsp; myPath =
me.Context.Request.ServerVariables("APPL_PHYSICAL_PATH")<BR>&gt; =
<BR>&gt;=20
<BR>&gt;&nbsp; dim rtnData as DataSet<BR>&gt; <BR>&gt;&nbsp; strSelect =
=3D "SELECT=20
* FROM myDataSource"<BR>&gt; <BR>&gt; '&nbsp; srcData =3D new =
ODBCConnection(=20
"PROVIDER=3DMicrosoft.Jet.OLEDB.4.0;DATA <BR>&gt; SOURCE=3D" &amp; =
myPath &amp;=20
"..\data\myDataSource.mdb" )<BR>&gt; <BR>&gt;&nbsp; srcData =3D new=20
ODBCConnection( "DSN=3DMyDataSource;uid=3D;pwd=3D" )<BR>&gt; =
<BR>&gt;&nbsp; fltData =
new ODBCdataAdapter( strSelect, srcData )<BR>&gt; <BR>&gt;&nbsp; rtnData =
=3D new=20
dataset<BR>&gt; <BR>&gt;&nbsp; fltData.fill( rtnData )<BR>&gt; =
<BR>&gt;&nbsp;=20
return rtnData<BR>&gt; <BR>&gt;=20
==================== =====3D=
==================== =====3D=
==================== =====3D=
=======3D<BR>&gt;=20
<BR>&gt; ASP Web Server Code:<BR>&gt; -------------------------<BR>&gt;=20
<BR>&gt;&nbsp;&nbsp; SET objSoapClient =
Server.CreateObject("MSSOAP.SoapClient")<BR>&gt; <BR>&gt; =
<BR>&gt;&nbsp;&nbsp; '=20
needs to be updated with the url of your Web Service WSDL and=20
is<BR>&gt;&nbsp;&nbsp; ' followed by the Web Service name<BR>&gt;=20
<BR>&gt;&nbsp;&nbsp; objSoapClient.ClientProperty("ServerHTTPRequest") =
=
True<BR>&gt; <BR>&gt;&nbsp;&nbsp; Call <BR>&gt;=20
objSoapClient.mssoapinit("</FONT><A=20
href=3D"http://system.evolucion.co.uk/evolucion-services.asm x?WSDL"><FONT=
=20
face=3DArial=20
size=3D2>http://system.evolucion.co.uk/evolucion-services.as mx?WSDL</FONT=
></A><FONT=20
face=3DArial size=3D2>")<BR>&gt; <BR>&gt;&nbsp;&nbsp; set RecordSet =
Server.CreateObject("ADODB.Recordset")<BR>&gt; <BR>&gt;&nbsp;&nbsp; ' =
use the=20
SOAP object to call the Web Method Required<BR>&gt;&nbsp;&nbsp; =
RecordSet =
objSoapClient.getEvolucionVersionList()<BR>&gt; <BR>&gt;&nbsp;&nbsp; =
strOutput =
strOutput &amp; "&lt;P&gt;On-Line Result : " &amp; =
RecordSet.RecordCount<BR>&gt;=20
<BR>&gt;=20
==================== =====3D=
==================== =====3D=
==================== =====3D=
=======
<BR>&gt; <BR>&gt;</FONT></BODY></HTML>

------=_NextPart_000_003E_01C52FAC.A7F8ADA0--

Report this message