XML Node to XML Document

Discussion in 'ASP .Net' started by =?Utf-8?B?RGF2ZSBU?=, Jul 31, 2007.

  1. 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
    =?Utf-8?B?RGF2ZSBU?=, Jul 31, 2007
    #1
    1. Advertising

  2. On Jul 31, 5:32 pm, Dave T <> 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, Jul 31, 2007
    #2
    1. Advertising

  3. On Jul 31, 9:17 pm, Alexey Smirnov <> wrote:
    > On Jul 31, 5:32 pm, Dave T <> 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


    read more: http://support.microsoft.com/kb/330600
    Alexey Smirnov, Jul 31, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,375
  2. Tony Prichard
    Replies:
    0
    Views:
    706
    Tony Prichard
    Dec 12, 2003
  3. Tjerk Wolterink
    Replies:
    2
    Views:
    1,392
    Dimitre Novatchev
    Aug 24, 2006
  4. Martin Honnen

    Re: Reading XML Node-by-Node

    Martin Honnen, Nov 12, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    373
    Martin Honnen
    Nov 12, 2008
  5. Geagleeye

    how to creating new node inside a xml node

    Geagleeye, Aug 2, 2006, in forum: ASP General
    Replies:
    2
    Views:
    183
    Geagleeye
    Aug 3, 2006
Loading...

Share This Page