<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Turbocharging .Net Webservice Clients</title>
	<link>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/</link>
	<description>Incoherent and disjointed opinionated drivel from somewhere near London</description>
	<pubDate>Sat, 22 Nov 2008 16:27:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: russ</title>
		<link>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-3881</link>
		<dc:creator>russ</dc:creator>
		<pubDate>Thu, 11 Sep 2008 16:27:09 +0000</pubDate>
		<guid>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-3881</guid>
		<description>elmariachi,

The new .Net 3.5 Add Service wizard (using WCF) seems to have gone out of its way to make this difficult. When I use 3.5, I always create 2.0-style web references. There are two ways to do this:

1) Use wsdl.exe directly (e.g. from the command line or a build script

2) In VS2008, in the Add Service Reference dialog, click Advanced... (bottom left corner), then click Add Web Reference... in the Service Reference Settings dialog that pops up. You should then be able to use EnableDecompression as usual.
</description>
		<content:encoded><![CDATA[<p>elmariachi,</p>
<p>The new .Net 3.5 Add Service wizard (using WCF) seems to have gone out of its way to make this difficult. When I use 3.5, I always create 2.0-style web references. There are two ways to do this:</p>
<p>1) Use wsdl.exe directly (e.g. from the command line or a build script</p>
<p>2) In VS2008, in the Add Service Reference dialog, click Advanced&#8230; (bottom left corner), then click Add Web Reference&#8230; in the Service Reference Settings dialog that pops up. You should then be able to use EnableDecompression as usual.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: russ</title>
		<link>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-3880</link>
		<dc:creator>russ</dc:creator>
		<pubDate>Thu, 11 Sep 2008 16:22:27 +0000</pubDate>
		<guid>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-3880</guid>
		<description>Glyn,

I'm actually not sure what's going on there - the same thing is now happening to me, but I can't figure out why. I think it's something at Betfair's end - if I use the little python lib I cooked up, and switch on detailed tracing, I see this (headers only):

POST /global/v3/BFGlobalService HTTP/1.1
Host: api.betfair.com:443
Content-Length: 960
SOAPAction: urn:getEvents
Content-Type: text/xml
Accept-Encoding: gzip
User-Agent: pybetfair/0.4alpha

HTTP/1.1 200 OK
header: Server: Apache-Coyote/1.1
header: Date: Thu, 11 Sep 2008 16:12:56 GMT
header: Server: TME-GLUE/5.0.2
header: Content-Type: text/xml;charset=UTF-8
header: ntCoent-Length: 19715
header: Cache-Control: private
header: Content-Encoding: gzip
header: Content-Length:       1498

So Betfair's servers definitely have compression switched on. It looks like it's doing something weird with the headers (the jumbled ntCoent-Length header contains the uncompressed size of the response), but the data is undoubtedly compressed, and correctly represented in the Content-Length header. Weird. I'll see if I can find out what's going on.

BTW, when using gzip, I believe only the response is compressed, not the request.</description>
		<content:encoded><![CDATA[<p>Glyn,</p>
<p>I&#8217;m actually not sure what&#8217;s going on there - the same thing is now happening to me, but I can&#8217;t figure out why. I think it&#8217;s something at Betfair&#8217;s end - if I use the little python lib I cooked up, and switch on detailed tracing, I see this (headers only):</p>
<p>POST /global/v3/BFGlobalService HTTP/1.1<br />
Host: api.betfair.com:443<br />
Content-Length: 960<br />
SOAPAction: urn:getEvents<br />
Content-Type: text/xml<br />
Accept-Encoding: gzip<br />
User-Agent: pybetfair/0.4alpha</p>
<p>HTTP/1.1 200 OK<br />
header: Server: Apache-Coyote/1.1<br />
header: Date: Thu, 11 Sep 2008 16:12:56 GMT<br />
header: Server: TME-GLUE/5.0.2<br />
header: Content-Type: text/xml;charset=UTF-8<br />
header: ntCoent-Length: 19715<br />
header: Cache-Control: private<br />
header: Content-Encoding: gzip<br />
header: Content-Length:       1498</p>
<p>So Betfair&#8217;s servers definitely have compression switched on. It looks like it&#8217;s doing something weird with the headers (the jumbled ntCoent-Length header contains the uncompressed size of the response), but the data is undoubtedly compressed, and correctly represented in the Content-Length header. Weird. I&#8217;ll see if I can find out what&#8217;s going on.</p>
<p>BTW, when using gzip, I believe only the response is compressed, not the request.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: elmariachi</title>
		<link>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-3875</link>
		<dc:creator>elmariachi</dc:creator>
		<pubDate>Thu, 11 Sep 2008 08:24:15 +0000</pubDate>
		<guid>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-3875</guid>
		<description>its seems that in .NET 3.5 the lines:

BFGlobalService service = new BFGlobalService();
service.EnableDecompression = true;

dont work, since there is no EnableDecompression Property anymore.
Im using the VS2008.

What would be the proper way todo this in .NET 3.5</description>
		<content:encoded><![CDATA[<p>its seems that in .NET 3.5 the lines:</p>
<p>BFGlobalService service = new BFGlobalService();<br />
service.EnableDecompression = true;</p>
<p>dont work, since there is no EnableDecompression Property anymore.<br />
Im using the VS2008.</p>
<p>What would be the proper way todo this in .NET 3.5</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glyn</title>
		<link>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-3549</link>
		<dc:creator>Glyn</dc:creator>
		<pubDate>Fri, 29 Aug 2008 21:42:08 +0000</pubDate>
		<guid>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-3549</guid>
		<description>Hmmm, looks like tags in the xml request haven't posted correctly (not surprisingly), but please take my work for it that the body of the request and the response is not encoded.
Cheers,
Glyn.</description>
		<content:encoded><![CDATA[<p>Hmmm, looks like tags in the xml request haven&#8217;t posted correctly (not surprisingly), but please take my work for it that the body of the request and the response is not encoded.<br />
Cheers,<br />
Glyn.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glyn</title>
		<link>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-3548</link>
		<dc:creator>Glyn</dc:creator>
		<pubDate>Fri, 29 Aug 2008 21:19:07 +0000</pubDate>
		<guid>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-3548</guid>
		<description>Hi,
thanks very much for this great article.  I am having problems enabling decompression using .net 2.0.
I am sending a request to the betfair server, using the below code:

...
BFExchangeService exch = new BFExchangeService();
exch.EnableDecompression = true;
resp = exch.getMarketPrices(req);
...

when I look at the soap request (using fiddler) I see my request went out with 'Accept-Encoding: gzip'.  So that looks ok.
I notice that the response from betfair is not gzip'd (neither is ANY of the text in my outgoing request).

Am I missing something obvious here.  Much googeling has told me that all i should need to do is set EnableDecompression = true, and everything should just magically work.
Is the betfair server playing a cruel trick on me?

Any suggestions or comments gratefully received.
Thanks,
Glyn.  (request header below:  sorry for large post)

POST /global/v3/BFGlobalService HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.1433)
VsDebuggerCausalityData: uIDPoygYcuRlhZpPmGVpTdLQXRIAAAAAHzazgPIXCkSq/XdQF2OsD2WAJ3aAVWhKl5xe1Kb1tSYACAAA
Content-Type: text/xml; charset=utf-8
SOAPAction: "getEvents"
Host: api.betfair.com
Content-Length: 558
Accept-Encoding: gzip

0tTwbdin7udb8kXdRl/udR76XcMMUhPkkr2aRfS4P9wo=25322943</description>
		<content:encoded><![CDATA[<p>Hi,<br />
thanks very much for this great article.  I am having problems enabling decompression using .net 2.0.<br />
I am sending a request to the betfair server, using the below code:</p>
<p>&#8230;<br />
BFExchangeService exch = new BFExchangeService();<br />
exch.EnableDecompression = true;<br />
resp = exch.getMarketPrices(req);<br />
&#8230;</p>
<p>when I look at the soap request (using fiddler) I see my request went out with &#8216;Accept-Encoding: gzip&#8217;.  So that looks ok.<br />
I notice that the response from betfair is not gzip&#8217;d (neither is ANY of the text in my outgoing request).</p>
<p>Am I missing something obvious here.  Much googeling has told me that all i should need to do is set EnableDecompression = true, and everything should just magically work.<br />
Is the betfair server playing a cruel trick on me?</p>
<p>Any suggestions or comments gratefully received.<br />
Thanks,<br />
Glyn.  (request header below:  sorry for large post)</p>
<p>POST /global/v3/BFGlobalService HTTP/1.1<br />
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.1433)<br />
VsDebuggerCausalityData: uIDPoygYcuRlhZpPmGVpTdLQXRIAAAAAHzazgPIXCkSq/XdQF2OsD2WAJ3aAVWhKl5xe1Kb1tSYACAAA<br />
Content-Type: text/xml; charset=utf-8<br />
SOAPAction: &#8220;getEvents&#8221;<br />
Host: api.betfair.com<br />
Content-Length: 558<br />
Accept-Encoding: gzip</p>
<p>0tTwbdin7udb8kXdRl/udR76XcMMUhPkkr2aRfS4P9wo=25322943</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: feed</title>
		<link>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-3212</link>
		<dc:creator>feed</dc:creator>
		<pubDate>Mon, 11 Aug 2008 06:16:06 +0000</pubDate>
		<guid>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-3212</guid>
		<description>Easy and simple information to follow. Great share, thanks</description>
		<content:encoded><![CDATA[<p>Easy and simple information to follow. Great share, thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: russ</title>
		<link>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-2274</link>
		<dc:creator>russ</dc:creator>
		<pubDate>Mon, 09 Jun 2008 21:23:28 +0000</pubDate>
		<guid>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-2274</guid>
		<description>Hi John,

It should be sufficient simply to add the code to the app.config file - though don't add it to the applicationSettings node, insert it as a top level XML fragment. You can also set the values directly on the ServicePointManager object in your app code, although this means changing the code and recompiling if you want to change any values.</description>
		<content:encoded><![CDATA[<p>Hi John,</p>
<p>It should be sufficient simply to add the code to the app.config file - though don&#8217;t add it to the applicationSettings node, insert it as a top level XML fragment. You can also set the values directly on the ServicePointManager object in your app code, although this means changing the code and recompiling if you want to change any values.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Wiess</title>
		<link>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-2192</link>
		<dc:creator>John Wiess</dc:creator>
		<pubDate>Tue, 03 Jun 2008 22:22:04 +0000</pubDate>
		<guid>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-2192</guid>
		<description>Hello,

A very informative, and enjoyable read, and although I understand the  articles aims,I cannot figure where to actually put the code that ups the maxconnection, I have tried pasting the following code into an app.config file as per your instructions with no luck. is there anything else i need to do?


    
        
    
    
        
        
    
</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>A very informative, and enjoyable read, and although I understand the  articles aims,I cannot figure where to actually put the code that ups the maxconnection, I have tried pasting the following code into an app.config file as per your instructions with no luck. is there anything else i need to do?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-1981</link>
		<dc:creator>David</dc:creator>
		<pubDate>Mon, 19 May 2008 19:56:11 +0000</pubDate>
		<guid>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-1981</guid>
		<description>Everything works great except when the web service throws an Exception the client receives "The remote server returned an error: (500) Internal Server Error."  With decompression turned off the client receives our normal customized application exceptions and we can trap them appropriately.  Is there something else we need to implement when overriding WebResponse so the client receives our custom exceptions?  The 500 error is thrown at request.GetResponse() in the HttpWebResponseDecompressed constructor.

Great article btw.</description>
		<content:encoded><![CDATA[<p>Everything works great except when the web service throws an Exception the client receives &#8220;The remote server returned an error: (500) Internal Server Error.&#8221;  With decompression turned off the client receives our normal customized application exceptions and we can trap them appropriately.  Is there something else we need to implement when overriding WebResponse so the client receives our custom exceptions?  The 500 error is thrown at request.GetResponse() in the HttpWebResponseDecompressed constructor.</p>
<p>Great article btw.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: russ</title>
		<link>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-260</link>
		<dc:creator>russ</dc:creator>
		<pubDate>Sun, 24 Feb 2008 19:48:17 +0000</pubDate>
		<guid>http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/#comment-260</guid>
		<description>Hi Joann, thanks for the comment. Hope the tips come in useful!

It is an interesting point about the use of web services for such a high performance application. However, I happen to know that XML serialisation/deserialisation is the largest bottleneck in the system from Betfair's perspective, so I'm not sure XMPP would help much. 

For pure performance, a custom binary protocol would be superior, but then you have the additional burden of writing and maintaining the protocol, and can run into all sorts of interesting problems with byte ordering and encoding across different platforms and processor architectures. Interoperability is the trump card here.</description>
		<content:encoded><![CDATA[<p>Hi Joann, thanks for the comment. Hope the tips come in useful!</p>
<p>It is an interesting point about the use of web services for such a high performance application. However, I happen to know that XML serialisation/deserialisation is the largest bottleneck in the system from Betfair&#8217;s perspective, so I&#8217;m not sure XMPP would help much. </p>
<p>For pure performance, a custom binary protocol would be superior, but then you have the additional burden of writing and maintaining the protocol, and can run into all sorts of interesting problems with byte ordering and encoding across different platforms and processor architectures. Interoperability is the trump card here.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.304 seconds -->
