Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Question about methodology for Gurus

Reply
Thread Tools

Question about methodology for Gurus

 
 
JR
Guest
Posts: n/a
 
      12-10-2003
Hi,

I have a question about the best method to return sql records through a web
service.

I will potentially be sending back anywhere from one to a thousand records
from a sql call through a webmethod. I would like some advice on the "Best"
way to send the data to the client. Right now I am filling a dataset from
the sql call, writing the xml to an xmlwriter object, then converting that
to a string which I then return to the client.

Would it be better to send back a collection or custom object or is there
another approach that I'm missing? I would like to keep this as scalable as
possible so I would like to avoid using datasets and such.


Thanks in advance,
Jamie


 
Reply With Quote
 
 
 
 
Jan Tielens
Guest
Posts: n/a
 
      12-10-2003
If you want to avoid a DataSet, I would recommend using custom objects in a
collection. Ofcourse this will be somehow a performance degradation, like
you have now when you serialize your DataSet to a string. Using custom
objects you get the advantage that you are working with types, instead of a
long string with xml in it. Ofcourse xml in string format is the most
flexible solution, so it's always the choice between flexibility and
ease-of-use.

If your concern is interoperability (e.g. communication with java clients),
the custom objects won't raise any issues. I've succesfully implemented such
a solution without any problems regarding the communication between .NET and
Java.

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan


"JR" <(E-Mail Removed)> wrote in message
news:#G$(E-Mail Removed)...
> Hi,
>
> I have a question about the best method to return sql records through a

web
> service.
>
> I will potentially be sending back anywhere from one to a thousand records
> from a sql call through a webmethod. I would like some advice on the

"Best"
> way to send the data to the client. Right now I am filling a dataset from
> the sql call, writing the xml to an xmlwriter object, then converting that
> to a string which I then return to the client.
>
> Would it be better to send back a collection or custom object or is there
> another approach that I'm missing? I would like to keep this as scalable

as
> possible so I would like to avoid using datasets and such.
>
>
> Thanks in advance,
> Jamie
>
>



 
Reply With Quote
 
 
 
 
JR
Guest
Posts: n/a
 
      12-10-2003
Great info, thanks for the advise Jan.


"Jan Tielens" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> If you want to avoid a DataSet, I would recommend using custom objects in

a
> collection. Ofcourse this will be somehow a performance degradation, like
> you have now when you serialize your DataSet to a string. Using custom
> objects you get the advantage that you are working with types, instead of

a
> long string with xml in it. Ofcourse xml in string format is the most
> flexible solution, so it's always the choice between flexibility and
> ease-of-use.
>
> If your concern is interoperability (e.g. communication with java

clients),
> the custom objects won't raise any issues. I've succesfully implemented

such
> a solution without any problems regarding the communication between .NET

and
> Java.
>
> --
> Greetz
>
> Jan Tielens
> ________________________________
> Read my weblog: http://weblogs.asp.net/jan
>
>
> "JR" <(E-Mail Removed)> wrote in message
> news:#G$(E-Mail Removed)...
> > Hi,
> >
> > I have a question about the best method to return sql records through a

> web
> > service.
> >
> > I will potentially be sending back anywhere from one to a thousand

records
> > from a sql call through a webmethod. I would like some advice on the

> "Best"
> > way to send the data to the client. Right now I am filling a dataset

from
> > the sql call, writing the xml to an xmlwriter object, then converting

that
> > to a string which I then return to the client.
> >
> > Would it be better to send back a collection or custom object or is

there
> > another approach that I'm missing? I would like to keep this as scalable

> as
> > possible so I would like to avoid using datasets and such.
> >
> >
> > Thanks in advance,
> > Jamie
> >
> >

>
>



 
Reply With Quote
 
Dino Chiesa [Microsoft]
Guest
Posts: n/a
 
      12-11-2003
If you want the table metaphor, you can also do something like

[WebMethod(Description="returns an XmlNode derived from a DataSet. This
form excludes schema info. ")]
public System.Xml.XmlNode GetDataSet_XmlDoc(int orderId) {
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
System.Data.DataSet ds= Service(orderId);
doc.LoadXml(ds.GetXml());
return doc;
}


"JR" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Great info, thanks for the advise Jan.
>
>
> "Jan Tielens" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > If you want to avoid a DataSet, I would recommend using custom objects

in
> a
> > collection. Ofcourse this will be somehow a performance degradation,

like
> > you have now when you serialize your DataSet to a string. Using custom
> > objects you get the advantage that you are working with types, instead

of
> a
> > long string with xml in it. Ofcourse xml in string format is the most
> > flexible solution, so it's always the choice between flexibility and
> > ease-of-use.
> >
> > If your concern is interoperability (e.g. communication with java

> clients),
> > the custom objects won't raise any issues. I've succesfully implemented

> such
> > a solution without any problems regarding the communication between .NET

> and
> > Java.
> >
> > --
> > Greetz
> >
> > Jan Tielens
> > ________________________________
> > Read my weblog: http://weblogs.asp.net/jan
> >
> >
> > "JR" <(E-Mail Removed)> wrote in message
> > news:#G$(E-Mail Removed)...
> > > Hi,
> > >
> > > I have a question about the best method to return sql records through

a
> > web
> > > service.
> > >
> > > I will potentially be sending back anywhere from one to a thousand

> records
> > > from a sql call through a webmethod. I would like some advice on the

> > "Best"
> > > way to send the data to the client. Right now I am filling a dataset

> from
> > > the sql call, writing the xml to an xmlwriter object, then converting

> that
> > > to a string which I then return to the client.
> > >
> > > Would it be better to send back a collection or custom object or is

> there
> > > another approach that I'm missing? I would like to keep this as

scalable
> > as
> > > possible so I would like to avoid using datasets and such.
> > >
> > >
> > > Thanks in advance,
> > > Jamie
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Verification Methodology Manual for SystemVerilog examples imavroid VHDL 0 03-12-2006 03:18 PM
Development methodology for .net like fusebox Imran Aziz ASP .Net 2 08-05-2005 04:47 PM
General Design Question classic versus asp.net methodology needin4mation@gmail.com ASP .Net 3 07-25-2005 03:24 PM
Brainiacs: Methodology to choose best of many class to handle abstract data arieljake Java 3 02-09-2005 04:57 AM
CORBA or some other methodology? Ted Holden Java 12 11-22-2004 07:11 PM



Advertisments