Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
C#
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="*")]
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900