Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Operations with soapAction="" in a WCF Service Contract?

Tags:

c#

wsdl

wcf

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?

like image 670
John Saunders Avatar asked Apr 09 '10 06:04

John Saunders


1 Answers

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

like image 110
Nix Avatar answered Oct 21 '22 05:10

Nix