Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Output XML from a .net webservice

Reply
Thread Tools

Output XML from a .net webservice

 
 
Mahesha
Guest
Posts: n/a
 
      01-29-2004
Hello,
I want to write a .net webservice which returns the data as a xml.
I get this xml from a dataset by calling GetXml method.This web
service will be used by clients who donot use .net or microsoft
platforms. This size of the xml string could be quite big.I would like
to know whats the best method to return the data.

a)Should I just return this xml as a string from my webservice.
b)Is there a better efficient approach to handle this using SOAP.

I'm a newbie and it would be great if someone could direct me to a
tutorial/link which can help me on this.

Regards,
Mahesha
 
Reply With Quote
 
 
 
 
Jan Tielens
Guest
Posts: n/a
 
      01-29-2004
If you're clients are not .NET clients, it's still possible to return custom
classes for example. So if your only concern is interoperability you may
want to check out these as well.

Concerning your question, you can return an XMLDocument. Here's an example:
http://www.xmlwebservices.cc/index_Samples.htm

Source:
<!--StartFragment--><%@ WebService Language="vb" Class="XMLTest" %>

Imports System.Web.Services
Imports System.Xml
Imports System.Xml.Serialization

<WebService(Namespace:="http://eyesoft.de/webservices/")> _
Public Class XMLTest
Inherits System.Web.Services.WebService

<WebMethod()> _
Public Function _
GetXML() As System.Xml.XmlDocument
Dim myXML As New XmlDocument()
myXML.Load(Server.MapPath(".\") & "AddrBook.xml")

GetXML = myXML
End Function
End Class


--
Greetz

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


"Mahesha" <> wrote in message
news: m...
> Hello,
> I want to write a .net webservice which returns the data as a xml.
> I get this xml from a dataset by calling GetXml method.This web
> service will be used by clients who donot use .net or microsoft
> platforms. This size of the xml string could be quite big.I would like
> to know whats the best method to return the data.
>
> a)Should I just return this xml as a string from my webservice.
> b)Is there a better efficient approach to handle this using SOAP.
>
> I'm a newbie and it would be great if someone could direct me to a
> tutorial/link which can help me on this.
>
> Regards,
> Mahesha



 
Reply With Quote
 
 
 
 
Trebek
Guest
Posts: n/a
 
      01-29-2004
My advice would be to simply return the string as you are doing. If it
becomes unreasonably large, I would consider DIME as an alternative, but
only if the string return doesn't work.

Alex

"Mahesha" <> wrote in message
news: m...
> Hello,
> I want to write a .net webservice which returns the data as a xml.
> I get this xml from a dataset by calling GetXml method.This web
> service will be used by clients who donot use .net or microsoft
> platforms. This size of the xml string could be quite big.I would like
> to know whats the best method to return the data.
>
> a)Should I just return this xml as a string from my webservice.
> b)Is there a better efficient approach to handle this using SOAP.
>
> I'm a newbie and it would be great if someone could direct me to a
> tutorial/link which can help me on this.
>
> Regards,
> Mahesha



 
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
How do I output webservice as XML stream? File? Mark B ASP .Net 1 11-02-2008 03:17 PM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Problem! webservice.htc calling nonsecure webservice from a secured ssl https webpage batista ASP .Net 1 01-26-2006 12:05 PM
Problem! webservice.htc calling nonsecure webservice from a secured ssl https webpage batista ASP .Net 0 01-26-2006 08:13 AM
WebService returns XML in a String - how can I 'convert' this to an XML document? Ben Turner ASP .Net 2 01-02-2004 05:20 AM



Advertisments