简体   繁体   中英

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

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM