gpt4 book ai didi

jquery - Ajax 调用 Web 服务失败

转载 作者:行者123 更新时间:2023-12-01 01:18:34 25 4
gpt4 key购买 nike

我有一个ajax调用 http://mydomain.com/ClientServices/RewardsService.asmx /DisableDivAppsAreNotSupported

抛出以下错误:

<span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

<h2> <i>Request format is unrecognized for URL unexpectedly ending in '/DisableDivAppsAreNotSupported'.</i> </h2></span>

<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

<b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

<br><br>

<b> Exception Details: </b>System.InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/DisableDivAppsAreNotSupported'.<br><br>

<b>Source Error:</b> <br><br>

<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code>

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>

</td>
</tr>
</table>

<br>

为什么它无法识别网址末尾的操作?

最佳答案

您的网址不正确。尝试:

http://mydomain.com/ClientServices/RewardsService.asmx/DisableDivAppsAreNotSupported

还有一些需要检查的事情:

  • 确保脚本服务已启用[System.Web.Script.Services.ScriptService]

  • 确保网络需要 JSON [ScriptMethod(ResponseFormat=ResponseFormat.Json)]

  • 确保启用 getpost:

<configuration>
<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</system.web>
</configuration>

关于jquery - Ajax 调用 Web 服务失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7919082/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com