New Posts New Posts RSS Feed: Ideablade compression on a non-ideablade project
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Ideablade compression on a non-ideablade project

 Post Reply Post Reply
Author
pponzano View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Apr-2011
Location: Italy
Posts: 165
Post Options Post Options   Quote pponzano Quote  Post ReplyReply Direct Link To This Post Topic: Ideablade compression on a non-ideablade project
    Posted: 05-Mar-2012 at 12:47am
Hello,
I've got a silverlight 4 application that uses WCF services (not RIA) to fetch data... I would like to apply Gzip compression, it's possible to use

   <add name="gzipMessageEncoding" type="IdeaBlade.Core.Wcf.Extensions.GZipMessageEncodingElement, IdeaBlade.Core" />

just for compression itself?

what assembly should I reference?
Since I declare the proxy by codebehind (specifing CutomBinding and so on) how do I add a bindingelementexpression programmatically?

Thanks
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 782
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 05-Mar-2012 at 5:22pm
Hi Paolo,
 
In theory you should be able to use the compression with no issues.
 
Be sure to add the IdeaBlade.Core assembly.
 
To add binding programmatically, create the CustomBinding and use the Gzip binding element in place of the usual binding element: (http://social.msdn.microsoft.com/Forums/en/wcf/thread/2205b22c-b582-4771-a361-ee9b85fc0493)

var binding = new CustomBinding(new GZipMessageEncodingBindingElement(), new HttpTransportBindingElement());
 
Or you could simply do it in your config file: (from one of our config file samples in the DevForce Resource Center)
 
  <system.serviceModel>
 
    <bindings>
      <customBinding>
        <binding name="compressedBinaryBinding"
                 closeTimeout="00:01:00"
                 openTimeout="00:01:00"
                 receiveTimeout="00:10:00"
                 sendTimeout="00:01:00">
          <gzipMessageEncoding>
            <readerQuotas
                 maxDepth="2147483647"
                 maxStringContentLength="2147483647"
                 maxArrayLength="2147483647" />
          </gzipMessageEncoding>
          <httpTransport maxReceivedMessageSize="2147483647" />
        </binding>
      </customBinding>
    </bindings>
    <extensions>
      <bindingElementExtensions>
        <add name="gzipMessageEncoding"
             type="IdeaBlade.Core.Wcf.Extensions.GZipMessageEncodingElement, IdeaBlade.Core"/>
      </bindingElementExtensions>
    </extensions>
  </system.serviceModel>
 
 
Regards,
   Silvio.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down