[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1835
  • Last Modified:

WCF Service - basicHttpBinding versus others - performance

Hi all

I have a WCF Service running in IIS that I use to Receive & Send a very basic DataContract class to and from a client. The DataContract class is basically a list of strings.

I am using basicHttpBinding. Is there anything more efficient?

Also, if I wanted to add in compression where would I start, if it's even advisible?

Here is my config

<behaviors>
      <serviceBehaviors>
        <behavior name="MyBehaviour">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
        </behavior>
      </serviceBehaviors>
    </behaviors>    
    
    <services>
      <service name="Manager.Mobile.WebService.MyService" behaviorConfiguration="MyBehaviour">
        <endpoint name="MyServiceEndPoint" address=""
                  binding="basicHttpBinding"
                  bindingConfiguration="MyServiceBinding"
                  contract="Manager.Mobile.WebService.IMyService" />
        <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
      </service>
    </services>
    
    <bindings>
      <basicHttpBinding>
        <binding name="MyServiceBinding"
               receiveTimeout="00:05:00"
               sendTimeout="00:05:00"
               openTimeout="00:05:00"
               closeTimeout="00:05:00"
               transferMode="Streamed"
               bypassProxyOnLocal="false"
               useDefaultWebProxy="true"
               maxBufferSize="2147483647"
               maxReceivedMessageSize="2147483647"
               maxBufferPoolSize="2147483647">
          <readerQuotas maxDepth="2147483647"
                        maxStringContentLength="2147483647"
                        maxArrayLength="2147483647"
                        maxBytesPerRead="2147483647"
                        maxNameTableCharCount="2147483647" />
          <security mode="None" />
        </binding>
      </basicHttpBinding>
    </bindings>

Open in new window

0
zattz
Asked:
zattz
2 Solutions
 
DarrenDCommented:
See the Compression and the Binary Encoder

http://msdn.microsoft.com/en-us/library/dd456789.aspx

This is for .NET 4.5 though....

or

http://nirajrules.wordpress.com/2008/12/22/resolving-xmldictionaryreaderquotas-for-wcf-compression-using-gzipencoder/

or
http://www.hanselman.com/blog/EnablingDynamicCompressionGzipDeflateForWCFDataFeedsODataAndOtherCustomServicesInIIS7.aspx

In answer to your question on performance. As far as I know  HTTP is probably the fastest unless you can use direct TCP connections. HTTPS will be slower again.

Cheers,

Darren
0
 
Imran Javed ZiaCommented:
First of all enabling compression at iis will give you a very high boost in case of network cost, so if your client is getting data from WCF then dynamic content compression case be very useful in case of string data and we experience that if a call takes 100 second to transport string data over internet from wcf server to end client then we achived same results in 20 to 30 seconds. So you can view following links to enable dynamic compression on iis 6.0 and 7.x respectively:
http://bloggingabout.net/blogs/ramon/archive/2008/11/06/wcf-and-http-gzip-deflate-compression-and-silverlight.aspx
http://www.hanselman.com/blog/EnablingDynamicCompressionGzipDeflateForWCFDataFeedsODataAndOtherCustomServicesInIIS7.aspx

If your WCF client does not include SilverLight applications the one of prefered binding is Web Servicebinding WSHttpBinding for more details please visit the following link, but selection of binding needs detailed information of network and end client application:
http://www.dotnetfunda.com/interview/exam288-what-is-binding-and-how-many-types-of-bindings-are-there-in-wcf.aspx

Thanks
0
 
zattzAuthor Commented:
thx
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now