I am attempting to process a request/response message in WCF using a universal contract. This works fine if I specify the action in the request and response messages. However, if I put set Action="*" and ReplyAction="*" on the Contract, the client code will no longer compile, giving the error:
'CxTestSenderReceiver.ServiceReference1.CxMessageReceiverServiceClient' does not contain a definition for 'ProcessMessage' and no extension method 'ProcessMessage' accepting a first argument of type 'CxTestSenderReceiver.ServiceReference1.CxMessageReceiverServiceClient' could be found (are you missing a using directive or an assembly reference?)
c:\users\documents\visual studio 2010\Projects\CxMessageService\CxTestSenderReceiver\MainWindow.xaml.cs
Here is my contract:
public interface ICxMessageReceiverService
{
[OperationContract(Action="*", ReplyAction="*")]
System.ServiceModel.Channels.Message ProcessMessage(System.ServiceModel.Channels.Message msg);
}
The client was set up by using Add Service Reference, so all my client code is really doing is the following:
ServiceReference1.CxMessageReceiverServiceClient client = new ServiceReference1.CxMessageReceiverServiceClient();
System.ServiceModel.Channels.Message msg, response;
msg = System.ServiceModel.Channels.Message.CreateMessage(System.ServiceModel.Channels.MessageVersion.Soap11, "http://tempuri.org/ICxMessageReceiverService/ProcessMessage", data);
response = client.ProcessMessage(msg);
But it won't compile because (as it says in the above error) it is not aware that process message exists. If I change the OperationContract attribute to not have the Action="*" and ReplyAction="*" attributes then it works just fine.
What do I have to do in the client so that I can allow the Action="*" and ReplyAction="*" parameters in my contract?
Thanks,
What I have tried:
I tried to update the service reference after update the operation contract to
[OperationContract(Action="*", ReplyAction="*")]