【发布时间】:2018-11-24 23:14:31
【问题描述】:
我需要为下面给定的 SOAP 消息构建一个服务,我的客户端使用这个 SOAP 消息来调用我的新 WCF 服务。
我开始构建 wcf basicHTTPBinding。
我需要知道如何以这样一种方式构建服务以保证接收到客户端的调用。
<soapenv:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<ctx:clientContext
xmlns:ctx="http://ClientContext">
<ctx:clientUserId>775</ctx:clientUserId>
</ctx:clientContext>
<To soapenv:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://myserverurl.com/Services/UpdateRequest.svc/soapService</To>
<Action soapenv:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">updateRequestStatus</Action>
</soapenv:Header>
<soapenv:Body>
<p20:updateRequestStatus xmlns:p20="http://com.myservice.update.ws">
<requestId xmlns="">6699</requestId>
<status xmlns="">Approved</status>
</p20:updateRequestStatus>
</soapenv:Body>
</soapenv:Envelope>
我尝试实现此类服务并将其发布给我的客户以便调用它。客户端调用我的服务时出错:
错误描述如下:
由于 EndpointDispatcher 的 ContractFilter 不匹配,接收方无法处理带有 Action 'updateRequestStatus' 的消息。这可能是因为合约不匹配(发送方和接收方之间的操作不匹配)或发送方和接收方之间的绑定/安全不匹配。检查发送方和接收方是否具有相同的合同和相同的绑定(包括安全要求,例如消息、传输、无)。
我该如何解决这个问题?
【问题讨论】: