Request format is unrecognized for URL unexpectedly ending in Web Method()
Today I want to share with you a new problem which I had faced yesterday.
It was about web service related error. I have used Web Method() in my application to fill up a country dropdown. Everything
was going well but when I had used this web method it showed me an error like this:
System.InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/GetCountyList'.
After googling, I have found the solution.
This error was occured because GET and POST are disabled by default in ASP.NET 2.0 and greater.
Now I would like to share this with you. From msdn I have got some relative information which may help you to get understand
The .NET-connected Web services support HTTP GET, HTTP POST and SOAP protocols. By default, in .NET Framework 1.0, all three
protocols are enabled. By default, in .NET Framework 1.1 or greater, HTTP GET and HTTP POST are both disabled. This is for
Applications that use HTTP GET or HTTP POST to invoke a Web service fail when the Web service is upgraded to .NET Framework
1.1 or greater. These applications receive a exception: System.InvalidOperationException: Request format is unrecognized.
HTTP GET and HTTP POST may be enabled by editing the Web.config file for the vroot where the Web service resides. The
following configuration enables both HTTP GET and HTTP POST:
For more info pls visits these links: