当消费WebService时,我得到了以下错误:
URL意外以/myMethodName结尾,请求格式无法识别
如何解决这个问题?
当消费WebService时,我得到了以下错误:
URL意外以/myMethodName结尾,请求格式无法识别
如何解决这个问题?
当前回答
一个需要ContextKey的WebMethod,
[WebMethod]
public string[] GetValues(string prefixText, int count, string contextKey)
当此键未设置时,得到异常。
通过分配AutoCompleteExtender的键来修复它。
ac.ContextKey = "myKey";
其他回答
以我为例,当我从本地PC的Windows 10移动到安装Windows 2012的专用服务器时,出现了这个错误。 解决方案是添加到网络。配置以下行
<webServices>
<protocols>
<add name="Documentation"/>
</protocols>
</webServices>
极好的。
情况2 -同样的问题可以出现)在我的情况下,问题是由于以下一行:
<webServices>
<protocols>
<remove name="Documentation"/>
</protocols>
</webServices>
它在服务器上工作得很好,因为直接调用webservice函数——但是如果你在调试环境中直接从。net运行服务,并且想要手动测试运行该函数,则会失败。
一个需要ContextKey的WebMethod,
[WebMethod]
public string[] GetValues(string prefixText, int count, string contextKey)
当此键未设置时,得到异常。
通过分配AutoCompleteExtender的键来修复它。
ac.ContextKey = "myKey";
在html中,你必须将调用包含在一个带有GET的表单中
<a href="/service/servicename.asmx/FunctionName/parameter=SomeValue">label</a>
您还可以使用POST,其操作是web服务的位置,并通过输入标记输入参数。
还有SOAP和代理类。
我也得到这个错误与apache mod-mono。看起来webservice的文档页在linux中还没有实现。但是尽管出现了这个错误,web服务仍然正常工作。您应该通过在url的末尾添加?WSDL来看到它,即http://localhost/WebService1.asmx?WSDL