带有Action''的消息无法在接收方处理,

时间:2013-09-17 22:30:31

标签: c# wcf c#-4.0 soap wcf-binding

我有客户提供的WSDl,我需要创建一个WCF服务

它不提供任何肥皂操作,因为它在肥皂1.2下我尝试使用以下配置在WCF中实现

当我尝试使用soap UI提交和应用时,我收到以下错误

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
   <s:Body>
      <s:Fault>
         <s:Code>
            <s:Value>s:Sender</s:Value>
            <s:Subcode>
               <s:Value xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">a:ActionNotSupported</s:Value>
            </s:Subcode>
         </s:Code>
         <s:Reason>
            <s:Text xml:lang="en-US">The 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:Text>
         </s:Reason>
         <s:Detail>
            <z:anyType i:nil="true" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/>
         </s:Detail>
      </s:Fault>
   </s:Body>
</s:Envelope>

                                                               

<services>
  <service name="Myservice" behaviorConfiguration="MyServiceTypeBehaviors">
    <endpoint name="MyserviceEndpoint" address="soap12" 
              binding="customBinding" bindingNamespace="http://Myservice.namespace"
              bindingConfiguration="httpSoap12" contract="IMyService"/>

  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="MyServiceTypeBehaviors" >
      <serviceMetadata httpGetEnabled="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

1 个答案:

答案 0 :(得分:1)

如果未指定soapAction(例如,可能存在默认的soapaction),有various interpretations是否该怎么办。我建议设置wcf客户端和服务器,看看客户端发送的soapAction。这是所有客户应发送的soapAction。