WCF Binary Bindings in Silverlight 3 | John Papa

John Papa

Evangelist on the loose

WCF Binary Bindings in Silverlight 3

...

One of the most common comments I hear form people when they start digging into Silverlight 3 Beta (and Silverlight 2) is the lack of WCF binding options. Some changes have been made to include binary encoding in Silverlight 3, so now we have:

  • customBinding
    • can do things like binary binding with WCF clients
    • new to Silverlight 3 Beta
  • basicHttpBinding
    • basic clear text binding
  • pollingDuplexHttpBinding
    • exactly what it says … a pseudo duplex basic binding that uses polling

 

Custom binding with binary encoding is nice if you want to do binary encoding of the message. In fact, this is the default binding that is created when you use a Silverlight enabled WCF file template in Visual Studio 2008 to create a WCF service. Binary encoding often offers performance gains over text encoding. Here is a quick glimpse at the config setup for the binding

<system.serviceModel>

    <behaviors>

        <serviceBehaviors>

            <behavior name="SilverlightApplication2.Web.Service1Behavior">

                <serviceMetadata httpGetEnabled="true" />

                <serviceDebug includeExceptionDetailInFaults="false" />

            </behavior>

        </serviceBehaviors>

    </behaviors>

    <bindings>

        <customBinding>

            <binding name="customBinding0">

                <binaryMessageEncoding />

                <httpTransport />

            </binding>

        </customBinding>

    </bindings>

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />

    <services>

        <service behaviorConfiguration="SilverlightApplication2.Web.Service1Behavior"

            name="SilverlightApplication2.Web.Service1">

            <endpoint address="" binding="customBinding" bindingConfiguration="customBinding0"

                contract="SilverlightApplication2.Web.Service1" />

            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />

        </service>

    </services>

</system.serviceModel>

 

There is a nice blog post from Yavor Georgiev, (Program Manager on the Connected Framework Team) that explains this in more detail. You can also view Eugene Ovosvetsky’s (also of Microsoft) presenting his Consuming Web Services in Silverlight 3 session at Mix 2009 … this session covers binary encoding as well as other new networking features.

tags: Silverlight
  • http://microsoft.dailynewsabout.com/archives/108 Anonymous

    Pingback from Daily News About Microsoft : A few links about Microsoft – Thursday, 14 May 2009 20:04

  • http://www.silverlight-travel.com/blog/2009/05/18/wcf-binary-bindings-in-silverlight-3/ Anonymous

    Pingback from Silverlight Travel » WCF Binary Bindings in Silverlight 3

  • http://cs.identitymine.com/blogs/david_kelley/archive/2009/05/17/xaml-wcf-binding-type.aspx Anonymous

    Just kidding… as of late I am not aware of such a think however, it could be done. I was pooring over

  • http://blog.identitymine.com/blogs/david_kelley/archive/2009/05/17/xaml-wcf-binding-type.aspx Anonymous

    Just kidding… as of late I am not aware of such a think however, it could be done. I was pooring over

  • http://www.davidezordan.net/blog/?p=1068 Anonymous

    Pingback from Silverlight 3 Beta and Binary message encoding | DavideZordan.net

%d bloggers like this: