HttpPOST fails when using XmlNode

J

JD

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.Initialize()
at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type,
HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing)
 
B

Bruce Johnson

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
http://www.ObjectSharp.com/Bruce
-----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.Initializ
e()
at
System.Web.Services.Protocols.ServerProtocol.SetContext
(Type type,
HttpContext context, HttpRequest request, HttpResponse response)
at
System.Web.Services.Protocols.ServerProtocolFactory.Create
(Type type,
 
J

JD

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 said:
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
http://www.ObjectSharp.com/Bruce
-----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.Initializ
e()
at
System.Web.Services.Protocols.ServerProtocol.SetContext
(Type type,
HttpContext context, HttpRequest request, HttpResponse response)
at
System.Web.Services.Protocols.ServerProtocolFactory.Create
(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing)


.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top