CSLA WCF ServiceHost

CSLA WCF ServiceHost

Old forum URL: forums.lhotka.net/forums/t/7362.aspx


SouthSpawn posted on Wednesday, July 29, 2009

I have to create a ServiceHostFactory to get WCF to work with my Hosting Provider.

This means, that in my WCF Service, I have to add some "Code Behind" logic.

I notice in one of the CSLA service file examples I have, the only line of code is
 
<% @ServiceHost Service="Business.Compression.CompressedHost" %>

I have to add the "Factory" property here to point to my back end factory.

If I go the code behind way, it will now expect me to implement a interface.

Should I just implement the "IWcfPortal" in the code behind file?
If so, once the interface methods are created, what code do I add for each method?

Am I thinking about this wrong?

Thanks

RockfordLhotka replied on Wednesday, July 29, 2009

Can you just have your code-behind file subclass CompressedHost?

RockfordLhotka replied on Wednesday, July 29, 2009

Or you could put the CompressedHost code into the code-behind. It doesn't really matter where that code is physically (though having it in a DLL is cleaner imo).

SouthSpawn replied on Wednesday, July 29, 2009

I think I have to get rid of compression :( I really think that ICSharp compression component will not work with my hosting provider. I think it depends on something in the GAC.

So I really don't think I need the Compressed Host at all?
Couldn't I just inherit Csla.Server.Hosts.SilverLight.WcfPortal which will automatically implement the IWcfPortal Interface.

Isn't there a piece of code I could copy out of the CSLA framework to fill in those methods?

RockfordLhotka replied on Wednesday, July 29, 2009

For any realistic SL app you need some type of compression. If you can't get that library to work, you might need to find another library. There are several commerial options from component vendors, but I don't know if there are other open source (free) ones out there.

SouthSpawn replied on Wednesday, July 29, 2009

Let me look around

SouthSpawn replied on Wednesday, July 29, 2009

I found one called ZLib.Net

I will try that.

tetranz replied on Wednesday, July 29, 2009

Just for what it's worth, I've used icsharpcode.sharpziplib in an ASP.NET application on a low cost web host without a problem. Nothing required in the GAC. Admittedly that was a couple of years ago so maybe something has changed. I believe DotNetNuke still uses it.

Copyright (c) Marimer LLC