Multiple Operations with soapAction=“” in a WCF Service Contract?

拈花ヽ惹草 提交于 2019-12-21 10:46:37

问题


I need to create a service that will be "called back" by a third party. As a result, I need to conform to their WSDL.

Their WSDL has all of the operations defined with soapAction="", so my service needs to do the same. Unfortunately, I'm getting the error:

The operations A and B have the same action (). Every operation must have a unique action value.

In ASMX web services, there was a mode where the soapAction would not be used, but the name of the request element would be used instead. Is there some way using WCF not only to dispatch on the request element, but also to emit a WSDL with no soapAction?


回答1:


This is possible in asmx, but out of the box you will find no clean way to do this in WCF because it uses the action to dispatch messages to operations.

I think the hack you need is to set your soapAction to "*", and then write a custom dispatcher.

A potential side effect of this is a bad WSDL, if you need to expose a WSDL you will have to generate/steal it and then use the externalMetadataLocation attribute



来源:https://stackoverflow.com/questions/2605482/multiple-operations-with-soapaction-in-a-wcf-service-contract

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!