views:

18

answers:

1

I am working on a wcf client for a IIS hosted WCF service. Developed in Visual studio 2010.

The service has a callback this callback sends messages back to the clients in session. To create the Service Client code, I added a service reference http://localhost/service.svc with the "Generate asynchonous operations" which is ideal for the service however, it also produced asynchonous operations for the callback. I also used the cammand line with the /a switch tool and produced the same results.

And without the /a switch or unchecking the "Generate Asynchonous operations" checkbox, i obviously get no async operations at all.

I would like to keep the asynchonous operations for the service, while changing the callback to have synchronous operations.

Is that possible? If it is, how can it be done, because it seems to be a binary option. I realise it's just a minor annoyance to have a bunch of methods that have a bunch of methods that have notimpementedexception(); at the end but if it's something i can avoid that would be great. If not i'll live by creating regions.

A: 

Hi,

Run svcutil with and without /async on the command line against the WSDL/metadata enpoint. Merge the two generated clients (e.g. use the async contract in the direction you want and the sync contract the other way).

--larsw

larsw