[WCF][原创]在“消息”中 指定的 Action 必须与协定中的 ReplyAction 匹配,否则操作协定必须指定 ReplyAction="*"解决方法
刚学了WCF跟着教程做,客户端那边始终报错如下
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header />
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode>
<faultstring xml:lang="zh-CN">操作“Invoke”的传出回复消息指定了 Action=“http://tempuri.org/IRegisterService/InvokeRenspose”,但该操作的协定指定了 ReplyAction=出错“http://tempuri.org/IRegisterService/InvokeResponse”。在“消息”中 指定的 Action 必须与协定中的 ReplyAction 匹配,否则操作协定必须指定 ReplyAction="*"。</faultstring>
<detail>
<ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<HelpLink i:nil="true" />
<InnerException i:nil="true" />
<Message>操作“Invoke”的传出回复消息指定了 Action=“http://tempuri.org/IRegisterService/InvokeRenspose”,但 该操作的协定指定了 ReplyAction=出错“http://tempuri.org/IRegisterService/InvokeResponse”。在“消息”中指定的 Action 必 须与协定中的 ReplyAction 匹配,否则操作协定必须指定 ReplyAction="*"。</Message>
<StackTrace> 在 System.ServiceModel.Dispatcher.DispatchOperationRuntime.SerializeOutputs(MessageRpc& rpc)
在 System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
在 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
在 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc)
在 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
在 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
在 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)
在 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)
在 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
在 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)
在 System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
<Type>System.InvalidOperationException</Type>
</ExceptionDetail>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
查了网上一圈,都没找到解决方法,耗费4个小时找毛病,结果TMD是写错了字符,居然报错不明显essage myMsg = Message.CreateMessage(msg.Version, msg.Headers.Action + "Renspose", "我已经收到消息");
看上面么有?SB,Renspose这尼玛都能写错?我去以后低级错误不可再犯