1

I have a WCF SOAP service hosted on an Azure App Service. It has two custom domains attached, service-abc.com and service-123.com (as well as the default azure address of service-abc.azurewebsites.net)

In my WCF Service Contract, I have the SOAP Actions defined as follows, using the service-abc.com domain:

[System.ServiceModel.OperationContractAttribute(Action = "https://service-abc.com/GetTodos", ReplyAction = "https://service-abc/GetTodos")]
    [System.ServiceModel.XmlSerializerFormatAttribute()]
    [LegacyFormatMessage]
    Task<GetTodosResponse> GetTodos(GetTodosRequest request);

When I ask for the wsdl for this service, the soapAction values change to match the domain.

Eg:

GET https://service-abc.azurewebsites.net/?wsdl will return:

<wsdl:operation name="GetTodos">
<soap:operation soapAction="https://service-abc.azurewebsites.net/GetTodos" style="document"/>

GET https://service-abc.com/?wsdl will return:

<wsdl:operation name="GetTodos">
<soap:operation soapAction="https://service-abc.com/GetTodos" style="document"/>

GET https://service-123.com/?wsdl will return:

<wsdl:operation name="GetTodos">
<soap:operation soapAction="https://service-123.com/GetTodos" style="document"/>

But calling the SOAP service using those any of those soapActions apart from (https://service-abc.com/GetTodos) results in the error:

The message with Action 'https://service-123.com/GetTodos' 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). in <source stack trace>

because the Action supplied https://service-123/GetTodos does not match the Action defined in the contract https://service-abc.com/GetTodos

So the question is, can I stop the wsdl generating with the custom domain in the soapActions and just stay as the soapActions defined in the contract? IE, can the wsdl just return

<wsdl:operation name="GetTodos">
<soap:operation soapAction="https://service-abc.com/GetTodos" style="document"/>

regardless of which domain the request is made on?

DavidGouge
  • 4,583
  • 6
  • 34
  • 46
  • Maybe you can take a look at [this case](https://stackoverflow.com/questions/5487791/contractfilter-mismatch-at-the-endpointdispatcher-exception). It describes the situation similar to yours. – Jiayao Oct 13 '22 at 10:03

0 Answers0