Ask a Question related to ASP.NET Web Services, Design and Development.
-
John Bailo #1
XmlDocument Web method returns type XmlNode
I developed a web method that returns type XmlDocument.
But a client calling the web method will only accept the return value as
datatype XmlNode.
Why?
--
[url]http://antimeme.texeme.com[/url]
John Bailo Guest
-
WS return type, XML string or XmlDocument, which is better?
I'm developing a set of .NET WS for internal use. The server consumer is also .NET so compatibility is not an issue. I'm weighing on whether my WS... -
Help! My WebService method doen't return XmlDocument objects
I've built a web service that has a method which should return XmlDocument object's. The problem is: in the client, inspecting the web service... -
Webservice method returns XML.
I wrote webservice with one method Test. When i am trying to return a simple string it works form test client. When i am trying to return an XML... -
Relation between XmlNode and WSDL minoccurs or type
I have a WSDL-file that looks like the following (Part of it) - <s:complexType name="Persoonslijst"> - <s:sequence> <s:element minOccurs="0"... -
loading xmlcontent from one xmldocument into another xmldocument
Hi, I get xml data into one xmldocument and other xml data into a second xmldocument. Let's say the structure of the first is <Table>... -
James Flynn #2
RE: XmlDocument Web method returns type XmlNode
Could be that the client doesn't want the entire xmlDocument.
Change the return type to xmlNode
Then, take your existing xmlDocument and add the following to be returned:
xmlDocument.SelectSingleNode(XPath Expression Goes Here)
"John Bailo" wrote:
>
> I developed a web method that returns type XmlDocument.
>
> But a client calling the web method will only accept the return value as
> datatype XmlNode.
>
> Why?
>
>
> --
> [url]http://antimeme.texeme.com[/url]
>James Flynn Guest
-
John Bailo #3
Re: XmlDocument Web method returns type XmlNode
James Flynn wrote:
Yes, I can read it via workarounds.> Could be that the client doesn't want the entire xmlDocument.
> Change the return type to xmlNode
>
> Then, take your existing xmlDocument and add the following to be returned:
> xmlDocument.SelectSingleNode(XPath Expression Goes Here)
It just disturbs me that an explicitly typed complex return type
XmlDocument is translated to a completely different type when creating
the web reference in the client (!)
>
>
>
> "John Bailo" wrote:
>
>>>I developed a web method that returns type XmlDocument.
>>
>>But a client calling the web method will only accept the return value as
>>datatype XmlNode.
>>
>>Why?
>>
>>
>>--
>>[url]http://antimeme.texeme.com[/url]
>>
--
[url]http://antimeme.texeme.com[/url]
John Bailo Guest
-
Dan Rogers #4
RE: XmlDocument Web method returns type XmlNode
Hi John,
In general, if you really want to return raw XML to the client, as opposed
to normal classes or .NET based native data types, try and use XmlNode as
the return type when coding an ASP.NET webMethod. The reason is that the
return data comes from the first element child from the SOAP:Body element -
and thus won't be a complete document. If you really want to make a pure
XML document based interface, use simple ASP and the DOM, instead of
ASP.Net. This is the case when you want to include processing instructions
that point to XSLT, etc). Otherwise, if you are simply on the
green-diamond slopes and wanting to return plain old XML, just use XmlNode
instead of the DOM. You can still use the DOM to build your response, and
then peel off the node you want to return (you can only return one!).
Hope this helps,
Dan Rogers
Microsoft Corporation
--------------------microsoft.public.dotnet.framework.aspnet.webservic es,microsoft.public.dotnet>From: John Bailo <jabailo@earthlink.net>
>Newsgroups:
general,microsoft.public.dotnet.languages.csharp3LpxG5/QqYUFUyGyb/WBPw0wNdqJiK5DPPYt/mZzRHDfDoJ4D2>Subject: XmlDocument Web method returns type XmlNode
>Date: Fri, 22 Oct 2004 10:54:22 -0700
>Lines: 11
>Message-ID: <2tsvqeF23c4s0U1@uni-berlin.de>
>Mime-Version: 1.0
>Content-Type: text/plain; charset=us-ascii; format=flowed
>Content-Transfer-Encoding: 7bit
>X-Trace: news.uni-berlin.decpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!cpmsftn gxa06.phx.gbl!TK2MSFTNGP08>User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)
>X-Accept-Language: en-us, en
>Path:
phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!f
u-berlin.de!uni-berlin.de!not-for-mailmicrosoft.public.dotnet.languages.csharp:281723>Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.general:149951
microsoft.public.dotnet.framework.aspnet.webservic es:26210>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
>
>
>I developed a web method that returns type XmlDocument.
>
>But a client calling the web method will only accept the return value as
>datatype XmlNode.
>
>Why?
>
>
>--
>[url]http://antimeme.texeme.com[/url]
>Dan Rogers Guest



Reply With Quote

