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个回答

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

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问