Call WebService - Request format is unrecognized for URL unexpectedly ending
来源:互联网 发布:软件设计师 应用技术 编辑:程序博客网 时间:2024/04/29 17:25
I have jquery call an asp.net webservice.
$.ajax({
timeout: 10000,
type: "POST",
url: "AgentService.asmx/GetAgentData",
data: JSON.stringify({ agentId: agentId }),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data, textStatus, xmlhttp) {
if (data.d != null) {
PopulateAgentData($popup, data.d);
}
},
error: function (xmlhttp, errorMessage, exceptionObject) {
HandlePopupError($popup, xmlhttp, errorMessage, exceptionObject);
}
});
Got following error
Request format is unrecognized for URL unexpectedly ending in /GetAgentData
I saw solution on internet
The solution in previous versions is to add this to the web.config for the protocols needed (typically omitting HttpGet for production):
<system.web>
<webServices>
<protocols>
<add name="HttpGet" />
<add name="HttpPost" />
<add name="HttpSoap" />
</protocols>
</webServices>
</system.web>
I changed it.
Then, I got another exception:
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()
Finally,
I solved it ending up running this command...
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis.exe -i
Note that you will need your command prompt in Administrator mode for it to work.
Then, IISReset /restart
Then, reboot Windows
- Call WebService - Request format is unrecognized for URL unexpectedly ending
- Error: Request format is unrecognized for URL unexpectedly ending in
- Request format is unrecognized for URL unexpectedly ending in '\xx'问题解决方案
- IIS7 Request format is unrecognized.
- ajax请求webservice错误Request format is invalid: application/json;utf-8
- unrecognized database format
- WebService Service(URL, QName, WebServiceFeature[]) is undefined
- Visual Studio: the specified file is an unrecognized or unsupported binary format
- unable to start program the specified file is an unrecognized or unsupported binary format
- Visual Studio2010: the specified file is an unrecognized or unsupported binary format
- 17 messages for one URL request
- Ending Learning for Day 5
- Ending Learning for Day 6
- Ending Learning for Day 11
- Ending Learning for Day 4
- Ending Learning for Day 14
- svn: Unrecognized URL scheme
- svn: Unrecognized URL scheme
- 直接从链接往jsp页面传值的问题
- Linux下查看文件内容的命令 (
- HDU 5073 Galaxy(贪心)
- Windows知识点记录
- javascript内置函数
- Call WebService - Request format is unrecognized for URL unexpectedly ending
- vim
- msdasql.dll was unable to register itself in the system registry.
- mac下在eclipse中如何清除/切换svn
- 【Nutch】ParserJob
- android-PullRefreshLayout使用
- 集群的分类
- Qt实现应用程序单实例运行-LocalServer方式
- Linux中link,unlink,close,fclose详解