<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ioan Lazarciuc&#039;s Weblog &#187; readerQuotas</title>
	<atom:link href="http://www.lazarciuc.ro/ioan/tag/readerquotas/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lazarciuc.ro/ioan</link>
	<description>I program, therefore I exist.</description>
	<lastBuildDate>Mon, 19 Dec 2011 06:24:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>WCF Contract Limits?</title>
		<link>http://www.lazarciuc.ro/ioan/2009/05/28/wcf-contract-limits/</link>
		<comments>http://www.lazarciuc.ro/ioan/2009/05/28/wcf-contract-limits/#comments</comments>
		<pubDate>Wed, 27 May 2009 21:42:06 +0000</pubDate>
		<dc:creator>cretz</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[metadata exchange]]></category>
		<category><![CDATA[readerQuotas]]></category>
		<category><![CDATA[wcf]]></category>

		<guid isPermaLink="false">http://www.lazarciuc.ro/ioan/2009/05/28/wcf-contract-limits/</guid>
		<description><![CDATA[Today I’ve hit the size limit for a WCF service contract. It might seem unbelievable, but it’s almost true. I have a service contract with about 40 operations. After adding a new method to the contract, I get an error from the WCF Test Client: Error: Cannot obtain Metadata from http://localhost:8731/Design_Time_Addresses/CDA.Services/ApplicationService/mex If this is a [...]]]></description>
			<content:encoded><![CDATA[<p>Today I’ve hit the size limit for a WCF service contract. It might seem unbelievable, but it’s almost true.</p>
<p> <span id="more-28"></span>
<p>I have a service contract with about 40 operations. After adding a new method to the contract, I get an error from the WCF Test Client:</p>
<blockquote><p><em>Error: Cannot obtain Metadata from </em><a href="http://localhost:8731/Design_Time_Addresses/CDA.Services/ApplicationService/mex"><em>http://localhost:8731/Design_Time_Addresses/CDA.Services/ApplicationService/mex</em></a><em> If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.&#160; For help enabling metadata publishing, please refer to the MSDN documentation at </em><a href="http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata"><em>http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata</em></a><em> Exchange Error&#160;&#160;&#160; URI: </em><a href="http://localhost:8731/Design_Time_Addresses/CDA.Services/ApplicationService/mex"><em>http://localhost:8731/Design_Time_Addresses/CDA.Services/ApplicationService/mex</em></a><em>&#160;&#160;&#160; Metadata contains a reference that cannot be resolved: '</em><a href="http://localhost:8731/Design_Time_Addresses/CDA.Services/ApplicationService/mex'"><em>http://localhost:8731/Design_Time_Addresses/CDA.Services/ApplicationService/mex'</em></a><em>.&#160;&#160;&#160; There is an error in XML document (1, 110009).&#160;&#160;&#160; The value for the 'base' attribute is invalid - 'q1:EntityObject' is an invalid value for the 'base' attribute..HTTP GET Error&#160;&#160;&#160; URI: </em><a href="http://localhost:8731/Design_Time_Addresses/CDA.Services/ApplicationService/mex"><em>http://localhost:8731/Design_Time_Addresses/CDA.Services/ApplicationService/mex</em></a><em>&#160;&#160;&#160; There was an error downloading '</em><a href="http://localhost:8731/Design_Time_Addresses/CDA.Services/ApplicationService/mex'"><em>http://localhost:8731/Design_Time_Addresses/CDA.Services/ApplicationService/mex'</em></a><em>.&#160;&#160;&#160; The request failed with HTTP status 400: Bad Request.</em></p>
</blockquote>
<p>Same error if i attempt to add this service to a project. The message seems to change depending on which method I leave out, or put in. It seems to be getting hilarious, but it’s not. Accidentally, i got this error(truncated):</p>
<blockquote><p><em>There is an error in XML document The maximum nametable character count quota (16384) has been exceeded while reading XML data.</em></p>
</blockquote>
<p>After a bit of searching online, I found out that this is a recognized issue with the default metadata exchange binding, <a href="http://social.msdn.microsoft.com/forums/en-US/wcf/thread/17592561-c470-452a-a52c-2a5a2839582c/" target="_blank">here</a>. The workarounds didn’t look good at all to me, so I continued searching. Then, I came across <a href="http://msdn.microsoft.com/en-us/library/aa395212.aspx" target="_blank">this</a>, which looks a lot more promising.</p>
<p>I created a custom wsHttpBinding that I used for the meta data contract. Now the task was to get the Visual Studio IDE and the WCF Test Client to use this binding when adding or updating a service reference. In order for this, corresponding bindings must be configured for each tool, in its .exe.config file. The binding must be identical with the one on the service side, and it must have a name that corresponds to the protocol used by it (http, https, net.tcp).</p>
<p>There are 3 places(files) that need to be updated: devenv.exe.config, WcfTestClient.exe.config and SvcUtil.exe.config. Actually, if you have several versions of the Windows SDK installed, you might have more than 3 places to modify. My advice is to do a search for each of the config file names and change as many of them as required in order to get your work back on track.</p>
<p>I would have thought that the mexHttp(s)Binding would allow for custom quotas for the reader. Perhaps in .NET 4.0? (vote <a href="https://connect.microsoft.com/wcf/feedback/ViewFeedback.aspx?FeedbackID=459384" target="_blank">here</a> if it hurts)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazarciuc.ro/ioan/2009/05/28/wcf-contract-limits/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

