For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > July 2007 > XML Node to XML Document









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author XML Node to XML Document
Dave T

2007-07-31, 7:12 pm

I have a web service method that returns an XMLDocument. When I call it from
an aspx page, the intellisense says that the method is of type XMLNode, so
when I try, stupidly, to get the results of the web service call into an
XMLDocument in the client, it fails with the error

System.Web.Services.Protocols.SoapException: Server was unable to process
request. ---> System.InvalidCastException: Unable to cast object of type
'System.Xml.XmlElement' to type 'System.Xml.XmlDocument'.

Does anyone know where I might find out more about this?

Thanks
Alexey Smirnov

2007-07-31, 7:12 pm

On Jul 31, 5:32 pm, Dave T <Da...@discussions.microsoft.com> wrote:
> I have a web service method that returns an XMLDocument. When I call it from
> an aspx page, the intellisense says that the method is of type XMLNode, so
> when I try, stupidly, to get the results of the web service call into an
> XMLDocument in the client, it fails with the error
>
> System.Web.Services.Protocols.SoapException: Server was unable to process
> request. ---> System.InvalidCastException: Unable to cast object of type
> 'System.Xml.XmlElement' to type 'System.Xml.XmlDocument'.
>
> Does anyone know where I might find out more about this?
>
> Thanks


You should create a XmlDocument and add the result node into it

Alexey Smirnov

2007-07-31, 7:12 pm

On Jul 31, 9:17 pm, Alexey Smirnov <alexey.smir...@gmail.com> wrote:
> On Jul 31, 5:32 pm, Dave T <Da...@discussions.microsoft.com> wrote:
>
>
>
>
>
> You should create a XmlDocument and add the result node into it


read more: http://support.microsoft.com/kb/330600

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com