我是接手别人的一个项目,他的方法可以调用,并且正确.. 我新添加进去的方法,在别的client可以调用,但是报异常..
错误信息如下:看不懂的想办法翻译一下吧..
System.ServiceModel.ActionNotSupportedException was unhandled by user code
Message="The message with Action 'GetddlistData_Cla' 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)."
Source="mscorlib"
StackTrace:
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at ServiceSupply.CustomerService.WebDBData.GetddlistData_Cla()
at ServiceSupply.CustomerService.WebDBDataClient.GetddlistData_Cla() in F:\Kay_VSS_workspace\Ax_Web_0005\AX_Web_Portal.root\WintecEC.root\WintecEC\ServiceSupply\Service References\CustomerService\Reference.cs:line 7237
at VenderPortal.newVenderportal.ddlistDatabindcls() in F:\Kay_VSS_workspace\Ax_Web_0005\AX_Web_Portal.root\AX_Web_Portal\Ax_Web_0005_Vender Portal\newVenderportal.aspx.cs:line 198
at VenderPortal.newVenderportal.Page_Load(Object sender, EventArgs e) in F:\Kay_VSS_workspace\Ax_Web_0005\AX_Web_Portal.root\AX_Web_Portal\Ax_Web_0005_Vender Portal\newVenderportal.aspx.cs:line 21
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException:
上面的意思是说WCF 框架解析 GetddlistData_Cla 这个方法发现契约不匹配。你是不是引用服务后,后来又改动服务端的配置,检查下面的 配置:安全性、消息编码、消息可靠性、事务等等配置。或者你嫌麻烦的话, 就直接在客户端更新下服务。把服务端、客户端的服务配置同步。保持一致就应该没问题了。
@蒝来 ﹏。: 你这个问题解决了吗?怎么解决的啊?我也碰到了。。。
@蒝来 ﹏。: 这位兄台,你的这个问题解决了吗?求赐教啊,在下也是接手的项目,然后新添加了一个方法,客户端引用就报错啊
'GetddlistData_Cla'里面的参数,有 没有加数据约定的吧?
可能是调用者与被调用者的绑定方式不一样吧,比如server:basichttpbinding,而host:wshttpbinding
你这个问题解决了吗?怎么解决的啊?我也碰到了。。。