0

I need my wcf client to communicate with the service with a blank SoapAction because the service is configured to dispatch the operation by body of the soap message. And the operation contract is decorated as below so it will not require soap action. I guess WCF sends a soapaction by default. Is there any option in wcf client to send a blank soapaction? Thanks for any help!

[OperationContract(Action="")]

Jyina
  • 2,530
  • 9
  • 42
  • 80

1 Answers1

1

use the same OperationContract attribute on your client code, i.e. reference.cs. More details here.

Yaron Naveh
  • 23,560
  • 32
  • 103
  • 158
  • The operation contract in the reference.cs has an empty string for Action attribute which means I think that the service does not require the client to send SoapAction. Correct? – Jyina Jun 16 '12 at 14:23
  • But when my client sends a request to the service, I get an error " 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)." – Jyina Jun 16 '12 at 14:25
  • maybe the service requires soap action anyway. check out in the wsdl it gemerates if an action is defined – Yaron Naveh Jun 16 '12 at 14:55