views:

67

answers:

1

I have a callback service that is hosted over wsDualHttpBinding. I'm looking to add a client that will poll for the data rather than receive the callback (will be a mobile device using wince for demo purposes). I was curious what the best way to do this is? You cannot create a client proxy using NetCFSvcUtil with a service hosted with wsDualHttpBinding (I understand that), but you cannot host a callback service over basicHttpBinding. I really need the same service hosted over both basicaHttpBinding (clients will poll for data) and wsDualHttpBinding (callback will notify clients of data). Any ideas on the best way to handle this without creating two separate services to host the same data?

A: 

What do you mean by two separate services hosting the same data? Do you expect to share same service instance to handle both wsDualHttpBinding and basicHttpBinding requests?

Your current problem is that service interface for duplex communication cannot be used for basicHttpBinding. You have to create second service contract and implement it in the same service. In that case you can expose two endpoints for the service: one duplex with WSDualHttpBinding and one with BasicHttpBinding. Endpoints must have different relative addresses. From the perspective of the client those endpoints are separate services - each of them requires separate client proxy. So unless your service is singleton you will have new service instance for each client proxy. New service instance means no data sharing.

Thera are some possibilities to modify this behavior but it means replacing Instance provider.

Ladislav Mrnka
Thanks. Multiple service contracts for the same service seems to be what I was missing. I would like my service to be a singleton service and it seems that the clients using the callback service are not "sharing" data with the clients using the non-callback service contract. Shouldn't the service hold the same data regardless of the contract the client uses? I have InstanceContextMode = InstanceContextMode.Single and it was working before when the clients shared the same service contract. Thanks for your help.
Sean