Our production environment is:
IIS 6.0
.Net framework 4.0
ASP.Net 4.0 thread pool
However, when calling to any web methods on the production server, for example:
[WebMethod(EnableSession = true)]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public void Authenticate(string usrname, string challenge)
it responses:
System.InvalidOperationException: Request format is invalid: application/json; charset=UTF-8.
at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
---EDIT---
My web.config:
<system.web>
<sessionState cookieless="UseCookies" mode="StateServer" timeout="20"/>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
and
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!-- ##William#2012.03.22 ##Try Fixing: System.InvalidOperationException: Request format is invalid: application/json; charset=UTF-8 -->
<handlers>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</handlers>
</system.webServer>
I'm pretty sure that all web methods work properly in my development host. Please kindly advise.
Thanks