Print Page | Close Window

6.0.9 Silverlight Compression

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2614
Printed Date: 29-Jul-2026 at 8:30pm


Topic: 6.0.9 Silverlight Compression
Posted By: rasmus
Subject: 6.0.9 Silverlight Compression
Date Posted: 08-Apr-2011 at 3:38am
Hi
 
I have successfully configured my SL-app to enable GZIP. This is how I did it:
 
1. I added this class to my SL app: http://drc.ideablade.com/xwiki/bin/view/Documentation/code-sample-add-gzip - http://drc.ideablade.com/xwiki/bin/view/Documentation/code-sample-add-gzip
 
I then added this to my web.config in the system.serviceModel:

<extensions>

<bindingElementExtensions>

<add name="gzipMessageEncoding"

type="IdeaBlade.Core.Wcf.Extensions.GZipMessageEncodingElement, IdeaBlade.Core, Version=6.0.9.0, Culture=neutral, PublicKeyToken=287b5094865421c0"/>

</bindingElementExtensions>

</bindingExtensions>

I then changed my binding in web.config to this:

<binding name="customBinaryBinding" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">

<gzipMessageEncoding>

<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"/>

</gzipMessageEncoding>

<httpTransport maxBufferPoolSize="5120000" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"/>

</binding>

In my services section I have this (I changed nothing there):

<service name="EntityService">

<endpoint address="" binding="customBinding" bindingConfiguration="customBinaryBinding" contract="IdeaBlade.EntityModel.IEntityServiceContract"/>

</service>

<service name="IdeaBlade.EntityModel.Server.EntityServer">

<endpoint address="" binding="customBinding" bindingConfiguration="customBinaryBinding" contract="IdeaBlade.EntityModel.IEntityServerContract"/>

</service>

My problem is, when i Deploy these changes to the server, I get the error: "There is no endpoint listening on http://...Services/EntitiService.svc..."
 
Can you help me out here?
 
Thank your for your time.
 
Rasmus



Replies:
Posted By: kimj
Date Posted: 08-Apr-2011 at 9:31am
First make sure the EntityService will start after your web.config modifications.  Here's more info - http://drc.ideablade.com/xwiki/bin/view/Documentation/deploy-troubleshooting-ntier#HHowtoseeiftheEntityServerisrunning - http://drc.ideablade.com/xwiki/bin/view/Documentation/deploy-troubleshooting-ntier#HHowtoseeiftheEntityServerisrunning
 
Next double check all the addresses and bindings to make sure the client and server are using the same settings.
 
If you're testing in Visual Studio, I'd also put a breakpoint in the OnEndpointCreated code added to the client to see if the logic is being executed.  That sample code is assuming you're using a CustomBinding (you may not be), and then swaps out the current message encoder for one using GZip.  Your channel stack may differ from the sample too.
 
I should add that if you haven't already been using a ServiceReferences.ClientConfig on your client there's no reason to add GZip support in this way, since DevForce now automatically uses GZip in the default configuration.  If you need the <serviceModel> on both client and server for some reason, such as changing timeout values, it can be easier to forego the <serviceModel> sections in the config files altogether and do this through code.  A few samples show how to do this - http://drc.ideablade.com/xwiki/bin/view/Documentation/code-samples-configure-deploy - http://drc.ideablade.com/xwiki/bin/view/Documentation/code-samples-configure-deploy .
 
 


Posted By: rasmus
Date Posted: 11-Apr-2011 at 4:05am
Hi
 
The entityserver is running. I have doublechecked the web.config. The only diffence between the production server and the development environment is the IIS version (6 on the production server and 7 on local). I do need the ServiceReferences.ClientConfig for several resons - so the default creation is not really an option.
 
I can confirm that the client does replace the CustomBinding. I think the problem is on the server. Any ideas for debugging this?
 
Rasmus


Posted By: kimj
Date Posted: 11-Apr-2011 at 11:41am
Were your ServiceReferences.ClientConfig and web.config definitions working in production before you added the Gzip support?   I'm curious about the endpoint addresses, as DevForce will automatically append "/sl" to addresses built on the client, but the addresses in your web.config don't show this.
Also, is this working in IIS7 on your local machine, and only not working in IIS6 in production?
 
As for debugging, check the server's debug log to see the addresses the services are listening on.  The error you're seeing can occur either due to a bad address or a mismatch in the binding information causing the handshake to fail.


Posted By: rasmus
Date Posted: 13-Apr-2011 at 8:20am
Hi
 
I have never appended /sl in my web.config. The only thing that has changed in my Web.Config is the binding configuration
 
from:
 

<binding name="customBinaryBinding" ...>

<binaryMessageEncoding>

<readerQuotas ... />

</binaryMessageEncoding>

<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />

</binding>

to

<binding name="customBinaryBinding" ...>

<gzipMessageEncoding>

<readerQuotas ... />

</gzipMessageEncoding>

<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />

</binding>

And added the extension:

<extensions>

<bindingElementExtensions>

<add name="gzipMessageEncoding"

type="IdeaBlade.Core.Wcf.Extensions.GZipMessageEncodingElement, IdeaBlade.Core, Version=6.0.9.0, Culture=neutral, PublicKeyToken=287b5094865421c0"/>

</bindingElementExtensions>

</extensions>

If i change back from to binaryMessageEncoding from gzipMessageEncoding, things starts working again (if I also remove the extension of the ServiceProxyEvents from the Client).
 
-Rasmus


Posted By: kimj
Date Posted: 13-Apr-2011 at 9:55am
I've uploaded a working sample using a configuration like yours so you can see where your implementation may differ:
uploads/11/FirstSilverlightApp.zip - uploads/11/FirstSilverlightApp.zip


Posted By: rasmus
Date Posted: 13-Apr-2011 at 10:59am
Hi
 
Thank you  for your reply and the uploaded solution. If I change the solution to running on the local IIS web server (port 80). Deploys the solution to a folder on my local development system, and maps a webesite to the folder, everything works. If I deploy the same files to the production server (IIS 6), I get the same error as mentioned before.
 
Can you confirm that you can make the uploaded solution work on an IIS 6?
 
-Rasmus


Posted By: kimj
Date Posted: 14-Apr-2011 at 6:10pm
The uploaded solution does work in IIS 6.
 
A few other things to look at are:  1) whether the XAP has been previously cached and is therefore not your new one, and 2) the debug log on the server to see if the serviceModel section is in fact being used.  If the serviceModel wasn't used for some reason, that reason may be logged.  The log will also show the addresses the services are actually listening on.



Print Page | Close Window