HttpPOST fails when using XmlNode

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default HttpPOST fails when using XmlNode

    Can someone explain why HTTP Post fails when implementing this simple
    webmethod?
    [WebMethod]

    public XmlNode Echo(XmlNode doc) {

    return doc;

    }

    while the following works fine:

    [WebMethod]

    public XmlNode EchoDoc(string doc)

    {

    XmlDocument xmldoc = new XmlDocument();

    xmldoc.LoadXml(doc);

    return (XmlNode) xmldoc;

    }

    Configuration:

    ASP.NET 1.1 and

    <add name="HttpPost"/> has been added to the web.config

    Here's the error I receive:

    System.InvalidOperationException: Echo Web Service method name is not valid.
    at System.Web.Services.Protocols.HttpServerProtocol.I nitialize()
    at System.Web.Services.Protocols.ServerProtocol.SetCo ntext(Type type,
    HttpContext context, HttpRequest request, HttpResponse response)
    at System.Web.Services.Protocols.ServerProtocolFactor y.Create(Type type,
    HttpContext context, HttpRequest request, HttpResponse response, Boolean&
    abortProcessing)


    JD Guest

  2. Similar Questions and Discussions

    1. Modify HttpGet and HttpPost portions of WSDL
      Hi. Does anyone know a way to programmatically modify the HttpGet and HttpPost service ports in WSDL(In particular, I would like to modify the...
    2. HttpGet Vs HttpPost vs SOAP
      There is a significant difference. With HTTP POST you can send true message-oriented SOAP requests, but with HTTP GET you can only send parameters...
    3. Error returning an XmlNode from a webservice
      I am using WSE 2.0 and ASP.NET to consume two webservices. The first works fine 100% of the time - the second doesn't. The first has a signature...
    4. XmlNode in Web Services...
      Requirements have made me to come up with a Web Service that accepts XML as input. Figured out that XmlNode is possible to work with and it works...
    5. XmlNode -> Schema -> Object
      I apologize, this question pertains to WebServices only indirectly. Lets say I have an XmlNode that validates against some schema. I also have a...
  3. #2

    Default HttpPOST fails when using XmlNode

    This might seem silly, but have you tried changing the
    name of the Echo method. The way the error message
    reads, it sounds like Echo is some kind of reserved
    word. Given the lack of anything better to try, it's the
    first thing that I'd do.

    Bruce Johnson
    [url]http://www.ObjectSharp.com/Bruce[/url]
    >-----Original Message-----
    >Can someone explain why HTTP Post fails when
    implementing this simple
    >webmethod?
    >[WebMethod]
    >
    >public XmlNode Echo(XmlNode doc) {
    >
    >return doc;
    >
    >}
    >
    >while the following works fine:
    >
    >[WebMethod]
    >
    >public XmlNode EchoDoc(string doc)
    >
    >{
    >
    >XmlDocument xmldoc = new XmlDocument();
    >
    >xmldoc.LoadXml(doc);
    >
    >return (XmlNode) xmldoc;
    >
    >}
    >
    >Configuration:
    >
    >ASP.NET 1.1 and
    >
    ><add name="HttpPost"/> has been added to the web.config
    >
    >Here's the error I receive:
    >
    >System.InvalidOperationException: Echo Web Service
    method name is not valid.
    > at
    System.Web.Services.Protocols.HttpServerProtocol.I nitializ
    e()
    > at
    System.Web.Services.Protocols.ServerProtocol.SetCo ntext
    (Type type,
    >HttpContext context, HttpRequest request, HttpResponse
    response)
    > at
    System.Web.Services.Protocols.ServerProtocolFactor y.Create
    (Type type,
    >HttpContext context, HttpRequest request, HttpResponse
    response, Boolean&
    >abortProcessing)
    >
    >
    >.
    >
    Bruce Johnson Guest

  4. #3

    Default Re: HttpPOST fails when using XmlNode

    Changing the name of the web method doesn't help. Same result. Surely
    someone is sending an XML document to a web method. Is there another
    recommended way to do this as a XML document rather than an encoded string?

    "Bruce Johnson" <Bruce@ObjectSharp.removethis.com> wrote in message
    news:0a7b01c3b9ad$2aef4330$a401280a@phx.gbl...
    > This might seem silly, but have you tried changing the
    > name of the Echo method. The way the error message
    > reads, it sounds like Echo is some kind of reserved
    > word. Given the lack of anything better to try, it's the
    > first thing that I'd do.
    >
    > Bruce Johnson
    > [url]http://www.ObjectSharp.com/Bruce[/url]
    >
    > >-----Original Message-----
    > >Can someone explain why HTTP Post fails when
    > implementing this simple
    > >webmethod?
    > >[WebMethod]
    > >
    > >public XmlNode Echo(XmlNode doc) {
    > >
    > >return doc;
    > >
    > >}
    > >
    > >while the following works fine:
    > >
    > >[WebMethod]
    > >
    > >public XmlNode EchoDoc(string doc)
    > >
    > >{
    > >
    > >XmlDocument xmldoc = new XmlDocument();
    > >
    > >xmldoc.LoadXml(doc);
    > >
    > >return (XmlNode) xmldoc;
    > >
    > >}
    > >
    > >Configuration:
    > >
    > >ASP.NET 1.1 and
    > >
    > ><add name="HttpPost"/> has been added to the web.config
    > >
    > >Here's the error I receive:
    > >
    > >System.InvalidOperationException: Echo Web Service
    > method name is not valid.
    > > at
    > System.Web.Services.Protocols.HttpServerProtocol.I nitializ
    > e()
    > > at
    > System.Web.Services.Protocols.ServerProtocol.SetCo ntext
    > (Type type,
    > >HttpContext context, HttpRequest request, HttpResponse
    > response)
    > > at
    > System.Web.Services.Protocols.ServerProtocolFactor y.Create
    > (Type type,
    > >HttpContext context, HttpRequest request, HttpResponse
    > response, Boolean&
    > >abortProcessing)
    > >
    > >
    > >.
    > >

    JD Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139