Sessions for windows-service-hosted WCF service for Silverlight 3

  • Thread starter Thread starter eXavier
  • Start date Start date
E

eXavier

Hello,
We are developing Silverlight 3 client application and corresponding server.
The server is WCF service that needs to run without IIS. We host it in custom
windows service. Now we are facing problem how to handle sessions in the WCF
service because Silverlight allows only basicHttpBinding. (We use sessions
successfully with wsHttpBinding.)

Using basicHttpBinding, we found it is possible to use
aspnetCompatibilityMode when the WCF service is hosted in IIS. But the
requirement for us is to run it without IIS, so we need another approach.

Is there any possibility or best practice how to implement session support
for the 'basicHttpBinding', if the WCF service is hosted within the windows
service? Is there possibility to use custom binding fulfilling Silverlight
requirements but allowing sessions?

Thanks!
 
* eXavier wrote, On 25-9-2009 18:28:
Hello,
We are developing Silverlight 3 client application and corresponding server.
The server is WCF service that needs to run without IIS. We host it in custom
windows service. Now we are facing problem how to handle sessions in the WCF
service because Silverlight allows only basicHttpBinding. (We use sessions
successfully with wsHttpBinding.)

Using basicHttpBinding, we found it is possible to use
aspnetCompatibilityMode when the WCF service is hosted in IIS. But the
requirement for us is to run it without IIS, so we need another approach.

Is there any possibility or best practice how to implement session support
for the 'basicHttpBinding', if the WCF service is hosted within the windows
service? Is there possibility to use custom binding fulfilling Silverlight
requirements but allowing sessions?

Thanks!

Hosting WCF in a windows service is against the guidelines for such a
deployment. Why are you *not* hosting it in IIS, other than that it is a
requirement.

From the article found at
(http://msdn.microsoft.com/en-us/library/bb332338.aspx):
"
In other words, you shouldn't consider self-hosting for enterprise
scenarios. Self-hosting is suitable during the development or
demonstration phases of your enterprise project. Another suitable
example where you would self-host your services is when you want
applications on a user desktop to communicate with each other or in a
peer-to-peer scenario...
"

I'd argue that a requirement from your customer should not go against
best practices nor against the framework guidelines.

For a hosted service, accessed from a remote client, the documentation
recommends either using IIS as the host or Windows Activation Services
(WAS).
 
Hello Jesse,

Thanks for your response. Regarding to the resource you are refering to -
the self-hosting as defined in the article denotes to Console or WinForm
applications. Although we provide our own implementation of windows service,
it is refered to as Windows Service scenario in the article. Sorry if I was
not clear enough in my post.

Actually, we follow the best practices from the article:
"For your service applications to be ready to run in a data center, the only
viable option for enterprise service-oriented scenarios is hosting your
services either on IIS or as a Windows service."


The point is that our customers have different environments (typically
Windows Server 2003) and some of them do not permit running IIS on their
servers. So we would like to provide them with solution not using IIS. So,
following the best practices, we provide windows service.
 
* eXavier wrote, On 29-9-2009 12:45:
Hello Jesse,

Thanks for your response. Regarding to the resource you are refering to -
the self-hosting as defined in the article denotes to Console or WinForm
applications. Although we provide our own implementation of windows service,
it is refered to as Windows Service scenario in the article. Sorry if I was
not clear enough in my post.

Actually, we follow the best practices from the article:
"For your service applications to be ready to run in a data center, the only
viable option for enterprise service-oriented scenarios is hosting your
services either on IIS or as a Windows service."


The point is that our customers have different environments (typically
Windows Server 2003) and some of them do not permit running IIS on their
servers. So we would like to provide them with solution not using IIS. So,
following the best practices, we provide windows service.

Ok... sorry my bad :). Though hosting in a windows service is still not
my preferred way of doing it.

I do wonder though, why they won't allow IIS, but will allow the running
of custom windows services.

Apart from implementing your own protocol implementation, the only other
option I see is to host the ASP.NET runtime yourself, that's how the
Visual Studio 2008 visual studio host for web application is run, so you
should be able to do the same.

I remember the sources for Cassini being around as a free download. I'm
not sure if they updated it to a more recent version. That way you
should be able to run in ASP.NET Compat Mode
 
Back
Top