Csla with Wcf Compression on remote host fails

Csla with Wcf Compression on remote host fails

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

Savij posted on Wednesday, November 10, 2010


I followed the instructions in the F.A.Q. about setting up compression. I am using Siverlight 4, Csla 4.0.0 and .net 4 in Visual Studio 2010. When using localhost everything works and compress/decompress is fine. I am using the cSharpZipLib as stated in the F.A.Q. as well.

When I move this to a remote host Wcf fails. The failure is an http 500 and the message I get back is "NOTFOUND". If I remove the compression, the project runs fine. So, it has something to do with the compression (I am thinking it might be configuration).

Here is my web.config Wcf section:

      <service behaviorConfiguration="WcfPortalBehavior" name="TaskManagement.Library.Compression.CompressedHost">
        <endpoint address="" binding="basicHttpBinding" contract="Csla.Server.Hosts.Silverlight.IWcfPortal" bindingConfiguration="BasicHttpBinding_IWcfPortal">
            <dns value="Stage01" />
        <behavior name="returnFaults">
          <serviceDebug includeExceptionDetailInFaults="true" />
        <behavior name="WcfPortalBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceAuthorization impersonateCallerForAllOperations="true" />
        <binding name="BasicHttpBinding_IWcfPortal" maxBufferSize="10000000" maxReceivedMessageSize="10000000" receiveTimeout="00:10:00" sendTimeout="00:10:00" openTimeout="00:10:00" closeTimeout="00:10:00" useDefaultWebProxy="false">
          <readerQuotas maxBytesPerRead="10000000" maxArrayLength="10000000" maxStringContentLength="10000000" />
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Windows" />

I also change the svc file to point to :
(Same as the Service name)

I also add the  Csla.DataPortal.ProxyTypeName in the silverlight application.

Again everything works till I move it to my Stage01 server.

I am stuck on this. Can anyone help shed some light?



RockfordLhotka replied on Wednesday, November 10, 2010

You changed your svc file to use the new host type?

Savij replied on Wednesday, November 10, 2010

Yes, the svc file is set to the same thing as the Service Name:

<%@ ServiceHost Language="C#" Debug="true" Service="TaskManagement.Library.Compression.CompressedHost" %>

I stated that in my first email, but it may not have been clear. The above line is in place though and it doesnt work when not on localhost.



RockfordLhotka replied on Wednesday, November 10, 2010

Some people have reported issues with that compression library in SL4 and .NET 4. I haven't personally encountered issues, but others have. Perhaps you should try a different compression library.

Savij replied on Monday, November 15, 2010

I was working on this from a co-workers machine at the time. For some reason, I moved to my computer and did the same steps and it worked like a charm. I could not see any typos but it is possible there was one?? I don't know why it didnt work before, but it's now in production and working well. I can't say that I love the performance on slower machines, but after talking to Microsoft support about the performance issues, I learned that although Silverlight is supported by older computers, performance is not good on them. First time renders are really slow (up to 12 seconds on some of them when looking via Fiddler or httpWatch) and round trip WCF calls are a few seconds each time as well. On new fast machines performance is not bad at all though.According to Microsoft support, there is no way to speed up the render time for the first screen on slower processor machines (I am talking about P4 CPU's with sub 2ghz speeds).

That part is not a CSLA thing, I just wanted to pass along what I learned. I implemented compression because of performance, so I thought the info was relevant. Hope it's informative to others.


richardb replied on Tuesday, November 16, 2010

Interesting info on the performance aspect, as I'm finding similar things on a full blown WPF Windows application.  Much of our PC base is old (3 / 4 years old - not many iCore's in sight) and while getting the data out into our CSLA objects is fine, the WPF rendering/binding performance is shocking.  For our users with newer machines it's an order magnitude better and then some.

A similar WIndows Winforms app runs lovely on same machines - WPF rendering just really needs decent kit (dedicated graphics card) to be useable.

Seems we are due a Windows 7 / PC rollout next year so looking forward to better WPF performance.


Savij replied on Tuesday, November 16, 2010

Yeah we are also rolling out new PC's next year sometime so it should be better. We also are using a Winforms app on the same box and performance there is really good, even on the same slow pc's. The main difference is that on those pc's we are using Remoting instead of WCF. We tried WCF instead at one point but we have remote locations one from Florida to Las Vegas and the Vegas office performance was terrible compared to Remoting. We tried tweaking everything we could but Remoting was so much faster, we opted to stay with the older technology.

Once you get used to coding in Silverlight/WPF it's hard to go back. Databinding and such is so nice compared to Winforms. I also love the Silverlight deployment model. I just wish Microsoft would do something about the rendering and WCF performance. I am using transparancies and gradients all over my winforms app and even the simplest Silverlight view renders poorly (performance wise that is) compared to the winforms view. I guess if Microsoft at least would tell us what CPU/GPU to use minimum to get good performance we could follow that and maybe not make a choice to use the technology till we upgrade the older pc's. I asked and they couldnt tell me. They just said it was pure CPU power as far as rendering the first view.


Copyright (c) Marimer LLC