WCF in Windows application
- From: mk <mk@xxxxxxxxxx>
- Date: Mon, 13 Jul 2009 12:32:56 +0200
Hi all,
I've created WCF service hosted in WinForm application. I want to use duplex Services because after establishing session between client and the service, in some cases (e.g. at scheduled time) service initiate data transfer.
When I create service as follow:
ServiceHost srvHost = new ServiceHost(typeOf(MyService));
then on server side I have no access to invoke the method from MyService object which send data to the client.
When I create service like this:
MyService mySrv = new MyService();
ServiceHost srvHost = new ServiceHost(mySrv);
then I have an access to invoke methods to send data because I have a reference to mySrv object. The problem is that such service have to have InstanceContextMode set to "Single" so it doesn't support sessions.
My question is: how to implement sending data from application which hosts the WCF duplex service?
Another question is how to identify particular sessions from application which host the service? Application have to send data to only one client which establish session with the service not to all connected clients. Clients have to login to the service at the begining so usernames can identify particular sessions.
Best regards and thanks in advance.
Mariusz
.
- Prev by Date: Re: Unit testing
- Next by Date: RE: HttpWebResponse.GetResponse() hangs my program.
- Previous by thread: Re: Unit testing
- Next by thread: RE: HttpWebResponse.GetResponse() hangs my program.
- Index(es):
Relevant Pages
|