![]() |
How to return XML Document from web service.
Can someone point me to an example of a VB.Net client that reads an
XML Document from a web service? I have a web service that successfully creates an XML document, saves it on the server and returns it to the calling client. Maybe I don't understand all I know about this but for some reason what is returned is an XMLNode, not a document. How does one usually return an XML Document from a web service? SHould I be using XMLDatadocument? Thanks, GH |
Re: How to return XML Document from web service.
If your webmethod's return value is an XMLDocument and that is, in fact,
what your code returns, then your web service returns an XMLDocument. So, the calling code would look something like: [vb.net] 'Assuming you have already made your web reference Dim ws As New someServer.someService() Dim xmlDoc As Xml.XmlDocument = ws.someMethodThatReturnsAnXMLDocument() "GH" <dotnetgod@hotmail.com> wrote in message news:1170631275.907638.202940@v33g2000cwv.googlegr oups.com... > Can someone point me to an example of a VB.Net client that reads an > XML Document from a web service? > > I have a web service that successfully creates an XML document, saves > it on the server and returns it to the calling client. > > Maybe I don't understand all I know about this but for some reason > what is returned is an XMLNode, not a document. How does one usually > return an XML Document from a web service? SHould I be using > XMLDatadocument? > > Thanks, > GH > |
Re: How to return XML Document from web service.
On Feb 4, 8:28 pm, "Scott M." <s...@nospam.nospam> wrote:
> If your webmethod's return value is an XMLDocument and that is, in fact, > what your code returns, then your web service returns an XMLDocument. So, > the calling code would look something like: > > [vb.net] > > 'Assuming you have already made your web reference > Dim ws As New someServer.someService() > Dim xmlDoc As Xml.XmlDocument = ws.someMethodThatReturnsAnXMLDocument() > > "GH" <dotnet...@hotmail.com> wrote in message > > news:1170631275.907638.202940@v33g2000cwv.googlegr oups.com... > > > > > Can someone point me to an example of a VB.Net client that reads an > > XML Document from a web service? > > > I have a web service that successfully creates an XML document, saves > > it on the server and returns it to the calling client. > > > Maybe I don't understand all I know about this but for some reason > > what is returned is an XMLNode, not a document. How does one usually > > return an XML Document from a web service? SHould I be using > > XMLDatadocument? > > > Thanks, > > GH- Hide quoted text - > > - Show quoted text - Thanks but when I do what you suggest I get the error: "Unable to cast object of type 'System.Xml.XmlElement' to type 'System.Xml.XmlDocument'." This implies that my web service is not really returning a document, however.... My web service says Public Function GetWebOrders() As XmlDocument Dim Doc As New XmlDocument ...... Build the document and Doc.Save it on the server (which works fine).... Return Doc End Function My Client says: Dim xmlDoc As Xml.XmlDocument = ws.GetWebOrders() ....that's when I get the error above. It has been suggested that I return the XML as a String but I dont think that is the best way to do it. --GH |
Re: How to return XML Document from web service.
> It has been suggested that I return the XML as a String but I dont
> think that is the best way to do it. Personally, I think that is the best way to do it. But, have you tried casting your result as an XMLDocument? |
| All times are GMT. The time now is 05:53 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.