对接webservice接口时报错:发送方和接收方 Action 不匹配

趁着早上有时间,赶紧记录一下,哈哈。

错误提示如下:
1、英文版:
<s:Envelope xmlns:s=“http://schemas.xmlsoap.org/soap/envelope/”><s:Body><s:Fault>a:ActionNotSupportedThe message with Action ‘’ 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).</s:Fault></s:Body></s:Envelope>

2、中文版:
<s:Envelope xmlns:s=“http://schemas.xmlsoap.org/soap/envelope/”><s:Body><s:Fault>a:ActionNotSupported由于 ContractFilter 在 EndpointDispatcher 不匹配,因此 Action 为“”的消息无法在接收方处理。这可能是由于协定不匹配(发送方和接收方 Action 不匹配)或发送方和接收方绑定/安全不匹配。请检查发送方和接收方是否具有相同的协定和绑定(包括安全要求,如 Message、Transport、None)。</s:Fault></s:Body></s:Envelope>

原因:
webservise接口都会有默认的SOAPAction值,一般为http://tempuri.org。造成此情况的原因也很多,基本上都是服务端的问题。

处理方法:
在请求头中添加"SOAPAction",对应的内容有两种获取方法
1、在使用soapui测试接口的时候,可以查看到当前方法内的Action;
在这里插入图片描述
2、浏览器打开webservice的地址,在每个方法下面都会有一个soapAction属性(也可能是action属性)
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值