2 jessenee jessenee 于 2013.11.29 16:10 提问

wcf服务端如何处理多个Action为空的操作?

现有固定协议的webService,要开发一个相应的wcf服务,客户端是固定的,发送的SoapHeader中不包含Action信息,而服务端OperationContractAttribute中只能有一个Action="",如果OperationContract中不设置Action,则会报错
{"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)."}

如果设置其中一个Action=""再调用这个函数,能正常运行。
但这个Service中有多个函数,服务器端要如何定义才能识别空的Action?
在具体实现上加了[ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)],没起作用

1个回答

lanfan_11
lanfan_11   2014.11.11 12:58

同问,我也遇到这个问题了!不知道怎么解决。

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!