Android 与使用 ksoap2 的 WCF Web 服务 - 错误 SoapFault –故障代码:“a:操作不支持”
我做了一个简单的项目,使用 ksoap2 调用 wcf web 服务。但当它调用时 信封.getResponse(); 它给出错误说————–
“SoapFault – 故障代码: “a:ActionNotSupported”故障字符串: '带有操作'GetString'的消息 无法在接收方进行处理, 由于 ContractFilter 不匹配 端点调度程序。这可能是 由于合同不匹配 (发送者和发送者之间的操作不匹配 接收器)或绑定/安全 发送者和接收者之间不匹配 接收者。检查发件人和 接收者有相同的合同并且 相同的绑定(包括安全性 要求,例如消息、传输、 没有任何)。'错误因素:“空”详细信息: 空”
我正在本地主机中运行 Web 服务。
请帮助我,
我分配的这个值是否正确,
private static final String SOAP_ACTION = “GetString”;
private static final String OPERATION_NAME = “GetString”;
private static final String WSDL_TARGET_NAMESPACE = “http://tempuri.org/”;
private static final String SOAP_ADDRESS = “http://10.0.2.2:14089/Service1.svc?wsdl”;
I have done a simple project to call wcf web service using ksoap2. But when it calls
envelope.getResponse();
it gives error saying ————–
“SoapFault – faultcode:
‘a:ActionNotSupported’ faultstring:
‘The message with Action ‘GetString’
cannot be processed at the receiver,
due to a ContractFilter mismatch at
the EndpointDispatcher. This may be
because of either a contract mismatch
(mismatched Actions between sender and
receiver) or a binding/security
mismatch between the sender and the
receiver. Check that sender and
receiver have the same contract and
the same binding (including security
requirements, e.g. Message, Transport,
None).’ faultactor: ‘null’ detail:
null”
I’m running web service in localhost.
please help me some one
is this values correct that I have assigned,
private static final String SOAP_ACTION = “GetString”;
private static final String OPERATION_NAME = “GetString”;
private static final String WSDL_TARGET_NAMESPACE = “http://tempuri.org/”;
private static final String SOAP_ADDRESS = “http://10.0.2.2:14089/Service1.svc?wsdl”;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们不知道这些值是否正确 - WSDL 应该告诉您调用
GetString
操作的正确 SOAP 操作是什么。在 Web 浏览器中打开 WSDL(即您在 SOAP_ADDRESS 中分配的地址)并找到类似以下内容的内容:
顺便说一句。当您调用服务时,您应该使用不带
?wsdl
查询字符串的 URL。We don't know if these values are correct - WSDL should tell you what is correct SOAP action for calling the
GetString
operation.Open WSDL in web browser (that is the address you are assigning in
SOAP_ADDRESS
) and find something like:Btw. when you call the service you should use URL without
?wsdl
query string.您还可以使用 SoapUI 检查 actionName。首先通过提供 wsdl 地址生成示例请求,然后找到您的请求。找到它后,请根据请求选择窗口左侧的“Raw”选项卡。您可以在那里找到 http 标头。标头位置之一是“SOAPAction”。这就是我们正在寻找的名字。
You can also check the actionName using SoapUI. First generate example request by providing wsdl address and then find your request. When you find it, select the "Raw" tab on the left side of window with request. You can find there http headers. One of the header position is "SOAPAction". It is the name which we are looking for.