Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have try to capture full XML in web service. But I got 500 Internal Server Error while try to post in Fiddler. What I miss in this?

WebService -

[WebMethod]
     public XmlDocument XML(XmlDocument xmlDoc)
     {
         XmlDocument x = new XmlDocument();
         x = xmlDoc;
         return xmlDoc;
     }


Request Body -

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <XML xmlns="http://tempuri.org/">
      <xmlDoc>string</xmlDoc>
      <number>96</number>
    </XML>
  </soap:Body>
</soap:Envelope>


POST http://localhost:50710/Service1.asmx?op=XML HTTP/1.1
POST /Service1.asmx HTTP/1.1: 
Host: localhost:50710
Content-Type: text/xml; charset=utf-8
Content-Length: 367
SOAPAction: "http://tempuri.org/XML"
Posted

1 solution

To start with, your method makes no sense at all. First two lines do nothing; their result is ignored. You simply return the same object supplied on input.

—SA
 
Share this answer
 
Comments
Jagadeeswaran Natarajan 20-Nov-14 5:58am    
Ya,. I know that. This is for testing purpose,. So I try to get the XML fist,. I fail in that. So I am not implementing de serialization on XML. And My Question is Getting the XML which i post in request body.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900