<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DU8NRHw-fip7ImA9WxBRE0w.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808</id><updated>2009-12-31T19:51:35.256-08:00</updated><title>Yaron Naveh's Web Services 2.0 Blog</title><subtitle type="html">Web Services Performance, Interoperability And Testing - WCF, Axis2, WSIT...</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://webservices20.blogspot.com/" /><link rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>57</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/WebServices20" /><feedburner:emailServiceId>WebServices20</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry gd:etag="W/&quot;A0EHR3Yyeip7ImA9WxBREUQ.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-4401667975540036874</id><published>2009-12-30T10:21:00.000-08:00</published><updated>2009-12-30T11:00:36.892-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-30T11:00:36.892-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Security" /><title>Security Gotcha: Nonrepudiation</title><content type="html">An important web services security requirement is nonrepudiation. This requirement prevents a party from denying it sent or received a message. The way to implement this is using Xml Digital Signatures. For example, if I sent a message which is signed with my private key, I cannot later deny that I sent it.&lt;br /&gt;&lt;br /&gt;A common mistake is to think that every  web service that require an X.509 certificate ensures nonrepudiation. This goes without say for web services that only require server certificate - in these services clients are either anonymous or username/password identified, which is considered weak cryptographically material.&lt;br /&gt;&lt;br /&gt;However, also when a client X.509 is involved, nonrepudiation is not always guaranteed.&lt;br /&gt;For example, let's examine a Wcf service which uses WsHttpBinding with TransportWithMessageCredential and clientCredentialType="Certificate":&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE"&gt;&lt;br /&gt;&amp;lt;wsHttpBinding&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;                &amp;lt;binding name="WSHttpBinding_IService" &amp;gt;                    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                    &amp;lt;security mode="TransportWithMessageCredential"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                        &amp;lt;transport clientCredentialType="None" proxyCredentialType="None"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                            realm="" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                        &amp;lt;message clientCredentialType="Certificate" negotiateServiceCredential="true"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                            algorithmSuite="Default" establishSecurityContext="false" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                    &amp;lt;/security&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;                &amp;lt;/binding&amp;gt;&lt;br /&gt;            &amp;lt;/wsHttpBinding&amp;gt;&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;This is how the client request looks like:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE"&gt;&lt;br /&gt;&amp;lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"&amp;gt;&lt;br /&gt;&amp;nbsp;  &amp;lt;soap:Header&amp;gt;&lt;br /&gt;&amp;nbsp;    ...    &lt;br /&gt;&amp;nbsp;&amp;nbsp;    &amp;lt;To soap:mustUnderstand="1" u:Id="_1" xmlns="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&amp;gt;https://www.someService.co.il/&amp;lt;/To&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;    ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;    &amp;lt;o:Security soap:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;u:Timestamp u:Id="_0" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        &amp;lt;u:Created&amp;gt;2009-12-30T18:19:03.538Z&amp;lt;/u:Created&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        &amp;lt;u:Expires&amp;gt;2009-12-30T18:24:03.538Z&amp;lt;/u:Expires&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;/u:Timestamp&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;o:BinarySecurityToken u:Id="uuid-b29856c4-1be8-4cf6-94ef-b3e2818b9924-1" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&amp;gt;...&amp;lt;/o:BinarySecurityToken&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;Signature xmlns="http://www.w3.org/2000/09/xmldsig#"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        &amp;lt;SignedInfo&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          &amp;lt;CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          &amp;lt;SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          &amp;lt;Reference URI="#_0"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            &amp;lt;Transforms&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;              &amp;lt;Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            &amp;lt;/Transforms&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            &amp;lt;DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            &amp;lt;DigestValue&amp;gt;ExzPg2kUjOQz2nFBMlhm+OT3GNY=&amp;lt;/DigestValue&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          &amp;lt;/Reference&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          &amp;lt;Reference URI="#_1"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            &amp;lt;Transforms&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;              &amp;lt;Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            &amp;lt;/Transforms&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            &amp;lt;DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            &amp;lt;DigestValue&amp;gt;mN+2rmNLmjSJxbO4x+n/V6gGAb4=&amp;lt;/DigestValue&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          &amp;lt;/Reference&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        &amp;lt;/SignedInfo&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        &amp;lt;SignatureValue&amp;gt;...&amp;lt;/SignatureValue&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        &amp;lt;KeyInfo&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          &amp;lt;o:SecurityTokenReference&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            &amp;lt;o:Reference URI="#uuid-b29856c4-1be8-4cf6-94ef-b3e2818b9924-1" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          &amp;lt;/o:SecurityTokenReference&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        &amp;lt;/KeyInfo&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;/Signature&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;    &amp;lt;/o:Security&amp;gt;&lt;br /&gt;&amp;nbsp;  &amp;lt;/soap:Header&amp;gt;&lt;br /&gt;&amp;nbsp;  &amp;lt;soap:Body&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;    &amp;lt;EchoString xmlns="http://tempuri.org/"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;s&amp;gt;abcde&amp;lt;/s&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;    &amp;lt;/EchoString&amp;gt;&lt;br /&gt;&amp;nbsp;  &amp;lt;/soap:Body&amp;gt;&lt;br /&gt;&amp;lt;/soap:Envelope&amp;gt;&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The message body is not signed!&lt;/b&gt;&lt;br /&gt;This practically means anyone who has this message (for example the server) can extract the signed parts and resend them with a bogus body.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-4401667975540036874?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/swFiFjW8oLAp9YRGGv77QK7atPM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/swFiFjW8oLAp9YRGGv77QK7atPM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/swFiFjW8oLAp9YRGGv77QK7atPM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/swFiFjW8oLAp9YRGGv77QK7atPM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/HVJd8BDh9H8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/4401667975540036874/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=4401667975540036874" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/4401667975540036874?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/4401667975540036874?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/HVJd8BDh9H8/security-gotcha-nonrepudiation.html" title="Security Gotcha: Nonrepudiation" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/12/security-gotcha-nonrepudiation.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MGSHo6cCp7ImA9WxBSGEk.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-5920824141827755970</id><published>2009-12-26T08:29:00.000-08:00</published><updated>2009-12-26T08:37:09.418-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-26T08:37:09.418-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Unit Tests" /><category scheme="http://www.blogger.com/atom/ns#" term="NUnit" /><category scheme="http://www.blogger.com/atom/ns#" term="TDD" /><title>When your unit test is not implemented...</title><content type="html">When your unit test is not implemented yet you want to make sure everybody knows about it. One bad way is to throw an exception in the test first line:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE"&gt;&lt;br /&gt;[Test]&lt;br /&gt;public void MyNewTest()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; throw new NotImplementedException();&lt;br /&gt;}&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;The reason is that when you see in the report this failure you can never tell if the error comes from the unit test or the application under test...&lt;br /&gt;&lt;br /&gt;The good solution is to use a &lt;a href="http://webservices20.blogspot.com/2009/12/unit-test-legitimic-failures.html"&gt;build in feature&lt;/a&gt; of your unit test framework. For example, the &lt;a href="http://www.nunit.org/index.php?p=ignore&amp;r=2.2.10"&gt;Ignore attribute&lt;/a&gt; in NUnit. If for some reason you have to throw an exception (so the test will be red) at least throw some better error class like "new UnitTestNotImplementedException()".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-5920824141827755970?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/t0XHp8WVsh3HHXSnfDdjZ08YXW0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/t0XHp8WVsh3HHXSnfDdjZ08YXW0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/t0XHp8WVsh3HHXSnfDdjZ08YXW0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/t0XHp8WVsh3HHXSnfDdjZ08YXW0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/pXYht3WgYrA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/5920824141827755970/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=5920824141827755970" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/5920824141827755970?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/5920824141827755970?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/pXYht3WgYrA/when-your-unit-test-is-not-implemented.html" title="When your unit test is not implemented..." /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/12/when-your-unit-test-is-not-implemented.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8BQHo_fCp7ImA9WxBSGEk.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-5881954630514163973</id><published>2009-12-26T07:57:00.000-08:00</published><updated>2009-12-26T08:27:31.444-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-26T08:27:31.444-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Unit Tests" /><category scheme="http://www.blogger.com/atom/ns#" term="NUnit" /><category scheme="http://www.blogger.com/atom/ns#" term="TDD" /><title>Unit Test Legitimic Failures</title><content type="html">Our unit tests are expected to pass every time. When they fail we are expected to fix the regression. But in some cases it is ok for a test to temporarily not pass. For example, if the test is a small regression in a minor feature and we are currently employed with other critical missions. But while the test is failing we should at least make sure it will not cause any noise like spamming out the team.&lt;br /&gt;&lt;br /&gt;When we use NUnit, the solution is the &lt;a href="http://www.nunit.org/index.php?p=ignore&amp;r=2.2.10"&gt;Ignore&lt;/a&gt; attribute:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE"&gt;&lt;br /&gt;[Test]&lt;br /&gt;[Ignore]&lt;br /&gt;public void SomeTest()&lt;br /&gt;{&lt;br /&gt;//...&lt;br /&gt;}&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;The test is not red any more:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_6DvmzgV-o20/SzY5CfK46qI/AAAAAAAABGQ/4loVOCMtEu4/s1600-h/nunit.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 115px;" src="http://2.bp.blogspot.com/_6DvmzgV-o20/SzY5CfK46qI/AAAAAAAABGQ/4loVOCMtEu4/s400/nunit.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5419581916476664482" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-5881954630514163973?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gXL9arpHQPDIt9g-PNCug_ymWEQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gXL9arpHQPDIt9g-PNCug_ymWEQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gXL9arpHQPDIt9g-PNCug_ymWEQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gXL9arpHQPDIt9g-PNCug_ymWEQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/fSFxqMZHybk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/5881954630514163973/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=5881954630514163973" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/5881954630514163973?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/5881954630514163973?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/fSFxqMZHybk/unit-test-legitimic-failures.html" title="Unit Test Legitimic Failures" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_6DvmzgV-o20/SzY5CfK46qI/AAAAAAAABGQ/4loVOCMtEu4/s72-c/nunit.jpg" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/12/unit-test-legitimic-failures.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4CRn88eip7ImA9WxBSGEk.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-904109551258814845</id><published>2009-12-26T07:44:00.000-08:00</published><updated>2009-12-26T07:56:07.172-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-26T07:56:07.172-08:00</app:edited><title>The XmlReader state should be Interactive</title><content type="html">Recently I was parsing Xml in c# from an XmlReader to an XElement:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE"&gt;&lt;br /&gt;MemoryStream m = GetMemoryStream();&lt;br /&gt;XmlReader r = XmlReader.Create(m);&lt;br /&gt;XElement e = XElement.ReadFrom(r) as XElement;&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;The last line threw this exception:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE"&gt;&lt;br /&gt;System.InvalidOperationException&lt;br /&gt;The XmlReader state should be Interactive.&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;In MSDN &lt;a href="http://msdn.microsoft.com/en-us/library/fxtcxd31.aspx"&gt;ReadState.Interactive&lt;/a&gt; state is described as:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE"&gt;&lt;br /&gt;The Read method has been called. Additional methods may be called on the reader.&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;But why should I call read? It is the XElement responsibility to do it.&lt;br /&gt;&lt;br /&gt;The solution is pretty simple though:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE"&gt;&lt;br /&gt;MemoryStream m = GetMemoryStream();&lt;br /&gt;XmlReader r = XmlReader.Create(m);&lt;br /&gt;&lt;b&gt;//This is how we make the XmlReader interactive&lt;br /&gt;r.MoveToContent();&lt;/b&gt;&lt;br /&gt;XElement e = XElement.ReadFrom(r) as XElement;&lt;br /&gt;&lt;/fieldset&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-904109551258814845?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/SfYUwIoBRxXVcffHzC01JOYo3X8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SfYUwIoBRxXVcffHzC01JOYo3X8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/SfYUwIoBRxXVcffHzC01JOYo3X8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SfYUwIoBRxXVcffHzC01JOYo3X8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/n2dX3xgof1c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/904109551258814845/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=904109551258814845" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/904109551258814845?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/904109551258814845?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/n2dX3xgof1c/xmlreader-state-should-be-interactive.html" title="The XmlReader state should be Interactive" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/12/xmlreader-state-should-be-interactive.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQCR3c8fyp7ImA9WxBTE0U.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-8400561976534192453</id><published>2009-12-09T10:21:00.000-08:00</published><updated>2009-12-09T10:29:26.977-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-09T10:29:26.977-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WCF" /><title>Not all errors are red</title><content type="html">Here's some WCF service trace log. Is there a problem with the service the log belongs too?&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_6DvmzgV-o20/Sx_rkc_PWRI/AAAAAAAABFw/M7ya6mvC0TA/s1600-h/red.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 284px;" src="http://2.bp.blogspot.com/_6DvmzgV-o20/Sx_rkc_PWRI/AAAAAAAABFw/M7ya6mvC0TA/s400/red.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5413304288611883282" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Of course, we see an error in the red line.&lt;br /&gt;&lt;br /&gt;What about this service?&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_6DvmzgV-o20/Sx_rlL6cfrI/AAAAAAAABF4/uNzpcT4LoFo/s1600-h/left.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 313px;" src="http://2.bp.blogspot.com/_6DvmzgV-o20/Sx_rlL6cfrI/AAAAAAAABF4/uNzpcT4LoFo/s400/left.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5413304301208239794" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Well, nothing red here. Let's drill down into the "warning" details:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_6DvmzgV-o20/Sx_sOGb4H-I/AAAAAAAABGI/lVq-MP_tmQQ/s1600-h/right1.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 237px;" src="http://2.bp.blogspot.com/_6DvmzgV-o20/Sx_sOGb4H-I/AAAAAAAABGI/lVq-MP_tmQQ/s400/right1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5413305004112486370" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It seems WCF errors come in more than one color.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-8400561976534192453?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JTut5S1Z9f-nnDIErvxMz_vMKXk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JTut5S1Z9f-nnDIErvxMz_vMKXk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JTut5S1Z9f-nnDIErvxMz_vMKXk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JTut5S1Z9f-nnDIErvxMz_vMKXk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/45TO3haLrRQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/8400561976534192453/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=8400561976534192453" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/8400561976534192453?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/8400561976534192453?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/45TO3haLrRQ/not-all-errors-are-red.html" title="Not all errors are red" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_6DvmzgV-o20/Sx_rkc_PWRI/AAAAAAAABFw/M7ya6mvC0TA/s72-c/red.jpg" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/12/not-all-errors-are-red.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8GQng6cSp7ImA9WxNbF04.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-5073671304879879315</id><published>2009-11-20T08:30:00.000-08:00</published><updated>2009-11-20T08:33:43.619-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-20T08:33:43.619-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="rampart" /><category scheme="http://www.blogger.com/atom/ns#" term="AXIS2" /><category scheme="http://www.blogger.com/atom/ns#" term="ws-security" /><title>Axis 2 WS-Security (rampart) FAQ</title><content type="html">Rampart is the WS-Security module of Axis2.&lt;br /&gt;Prabath &lt;a href="http://blog.facilelogin.com/2009/11/httprampartfaqcom.html"&gt;summarizes&lt;/a&gt; all the current posts that were published in the &lt;a href="http://blog.rampartfaq.com/"&gt;rampart FAQ blog&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-5073671304879879315?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/90Qgor84q0xAt6REaYcYA6A9FQc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/90Qgor84q0xAt6REaYcYA6A9FQc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/90Qgor84q0xAt6REaYcYA6A9FQc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/90Qgor84q0xAt6REaYcYA6A9FQc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/8TixL3fWRSw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/5073671304879879315/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=5073671304879879315" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/5073671304879879315?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/5073671304879879315?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/8TixL3fWRSw/axis-2-ws-security-rampart-faq.html" title="Axis 2 WS-Security (rampart) FAQ" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/11/axis-2-ws-security-rampart-faq.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcGQn84eip7ImA9WxNbFkk.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-5863466622383012558</id><published>2009-11-19T07:16:00.000-08:00</published><updated>2009-11-19T07:20:23.132-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-19T07:20:23.132-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="c#" /><title>Generating meaningful names from a url</title><content type="html">A common programming task is to extract some meaningful name from a url.&lt;br /&gt;One example is saving the contents of a url to a file name on disk - we need to have the name for the file.&lt;br /&gt;Bellow there is a c# method that I have written that extracts this name + the results it produces on a few urls.&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE"&gt;&lt;br /&gt;&lt;b&gt;http://www.myServer.com/Services/Sanity.asmx?WSDL&lt;/b&gt; -  Sanity&lt;br /&gt;&lt;b&gt;http://www.myServer.com/Services/Sanity.asmx?wsdl=1&amp;xsd=2&lt;/b&gt; -  Sanity&lt;br /&gt;&lt;b&gt;http://www.myServer.com/Services/Sanity12345678901234567890123456789012345678901234567890123456789012.asmx&lt;/b&gt; -  Sanity1234567890123456789012345678901234567&lt;br /&gt;&lt;b&gt;http://www.myServer.com/Services/Sanity.asmx&lt;/b&gt; -  Sanity&lt;br /&gt;&lt;b&gt;http://www.myServer.com/Services/Sanity/&lt;/b&gt; -  Sanity&lt;br /&gt;&lt;b&gt;http://www.myServer.com/Services/Sanity&lt;/b&gt; -  Sanity&lt;br /&gt;&lt;b&gt;http://www.myServer.com/Services/Sanity?wsdl&lt;/b&gt; -  Sanity_wsdl&lt;br /&gt;&lt;b&gt;http://www.myServer.com/Services/Sanity/?wsdl&lt;/b&gt; -  Sanity    &lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE"&gt;&lt;br /&gt;        public static string GetSuggestedNameFromUrl(string url, string defaultValue)&lt;br /&gt;        {&lt;br /&gt;            &amp;nbsp;&amp;nbsp;const int MaxChars = 50;&lt;br /&gt;&lt;br /&gt;            &amp;nbsp;&amp;nbsp;string res = Path.GetFileNameWithoutExtension(url);&lt;br /&gt;&lt;br /&gt;            &amp;nbsp;&amp;nbsp;//check if there is no file name, i.e. just folder name + query string&lt;br /&gt;            &amp;nbsp;&amp;nbsp;if (String.IsNullOrEmpty(res) || IsNameOnlyQueryString(res))&lt;br /&gt;            &amp;nbsp;&amp;nbsp;{&lt;br /&gt;                &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;res = Path.GetDirectoryName(url);                &lt;br /&gt;                &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;res = Path.GetFileName(res);&lt;br /&gt;&lt;br /&gt;                &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (String.IsNullOrEmpty(res))&lt;br /&gt;                   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; res = defaultValue;&lt;br /&gt;            &amp;nbsp;&amp;nbsp;}&lt;br /&gt;            &lt;br /&gt;            &amp;nbsp;&amp;nbsp;res = ReplaceInvalidCharacters(res);&lt;br /&gt;            &lt;br /&gt;            &amp;nbsp;&amp;nbsp;if (res.Length &gt; MaxChars)&lt;br /&gt;              &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  res = res.Substring(0, MaxChars);&lt;br /&gt;&lt;br /&gt;            &amp;nbsp;&amp;nbsp;return res;            &lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;        private static string ReplaceInvalidCharacters(string res)&lt;br /&gt;        {&lt;br /&gt;            &amp;nbsp;&amp;nbsp;return Regex.Replace(res, @"[^\w]", "_", RegexOptions.Singleline);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;        private static bool IsNameOnlyQueryString(string res)&lt;br /&gt;        {&lt;br /&gt;            &amp;nbsp;&amp;nbsp;return !String.IsNullOrEmpty(res) &amp;&amp; res[0]=='?';&lt;br /&gt;        }&lt;br /&gt;&lt;/fieldset&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-5863466622383012558?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ujcHTEvQWmEq5qdYmnpULA50Vb0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ujcHTEvQWmEq5qdYmnpULA50Vb0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ujcHTEvQWmEq5qdYmnpULA50Vb0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ujcHTEvQWmEq5qdYmnpULA50Vb0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/8nthfX8wKwc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/5863466622383012558/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=5863466622383012558" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/5863466622383012558?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/5863466622383012558?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/8nthfX8wKwc/generating-meaningful-names-from-url.html" title="Generating meaningful names from a url" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/11/generating-meaningful-names-from-url.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cBQX4zfyp7ImA9WxNSEEs.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-2343305096232489822</id><published>2009-08-22T09:46:00.000-07:00</published><updated>2009-08-23T16:10:50.087-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-23T16:10:50.087-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="BindingBox" /><category scheme="http://www.blogger.com/atom/ns#" term="WCF" /><title>BindingBox: Convert WCF Bindings</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://webservices20.cloudapp.net"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 74px;" src="http://1.bp.blogspot.com/_6DvmzgV-o20/SpHKyel4gII/AAAAAAAABFg/URwfjJiJQXg/s400/logo+-+small.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5373298798983938178" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The WCF &lt;a href="http://webservices20.cloudapp.net/"&gt;BindingBox&lt;/a&gt; is here!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What is it?&lt;/b&gt;&lt;br /&gt;&lt;a href="http://webservices20.cloudapp.net/"&gt;BindingBox&lt;/a&gt; is an online application that converts WCF bindings to a customBinding configuration.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Why we need it?&lt;/b&gt;&lt;br /&gt;WCF bindings capture a general use case and allow us to customize it. For example, basicHttpBinding is good for interoperability with older soap stacks while WSHttpBinding fits WS-* based communication. However, there are cases where we can not use the out of the box bindings. For example:&lt;br /&gt;&lt;br /&gt;&lt;li&gt; We want to further customize the binding behind what it exposes. For example, we might want WSHttpBinding not to send a timestamp (for interoperability reasons) but this is not a built in option.&lt;br /&gt;&lt;br /&gt;&lt;li&gt; We have a special use case which is not captured by any of the out-of-the-box bindings. For example, we want to use binary encoding over http.&lt;br /&gt;&lt;br /&gt;In such cases we need to &lt;a href="http://webservices20.blogspot.com/2009/04/wcf-custombinding-equivalent-to.html"&gt;convert our binding&lt;/a&gt; into a custom binding. This is not a trivial process. In particular, some security settings can be very frustrating to translate.&lt;br /&gt;&lt;br /&gt;For this reason I have written the WCF &lt;a href="http://webservices20.cloudapp.net/"&gt;BindingBox&lt;/a&gt;. This is an online application which automatically converts any binding to a customBinding.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://webservices20.cloudapp.net/"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 204px;" src="http://4.bp.blogspot.com/_6DvmzgV-o20/SpHLMegvTKI/AAAAAAAABFo/IJyPsmT42gQ/s400/box.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5373299245638962338" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;How to use it - Tutorial&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 1&lt;/b&gt; - Get your current binding&lt;br /&gt;&lt;br /&gt;Just open your web.config or app.config file and navigate to the "&amp;lt;bindings&amp;gt;" element. Then copy its content to the clipboard. Be sure to copy the wrapping "&amp;lt;bindings&amp;gt;" element as well:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE"&gt;&lt;br /&gt;&amp;lt;bindings&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;  &amp;lt;wsHttpBinding&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;lt;binding name="MyBinding"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;security&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        &amp;lt;message clientCredentialType="UserName" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;/security&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;lt;/binding&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &amp;lt;/wsHttpBinding&amp;gt;&lt;br /&gt;&amp;lt;/bindings&amp;gt;&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 2&lt;/b&gt; - Convert your binding&lt;br /&gt;&lt;br /&gt;Just navigate to the &lt;a href="http://webservices20.cloudapp.net/"&gt;BindingBox &lt;/a&gt; and paste your binding from step 1. Then click on the "Convert to CustomBinding" button and copy to the clipboard your new binding. It may look like this:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE"&gt;&lt;br /&gt;&amp;lt;customBinding&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;  &amp;lt;binding name="NewBinding0"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;lt;transactionFlow /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;lt;security authenticationMode="SecureConversation" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;secureConversationBootstrap authenticationMode="UserNameForSslNegotiated" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;lt;/security&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;lt;textMessageEncoding /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;lt;httpTransport /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;  &amp;lt;/binding&amp;gt;&lt;br /&gt;&amp;lt;/customBinding&amp;gt;&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 3&lt;/b&gt; - Use the custom binding&lt;br /&gt;&lt;br /&gt;Basically, you now just need to use the BindingBox result as your binding configuration.&lt;br /&gt;&lt;br /&gt;In practice you would do it in one of the following ways:&lt;br /&gt;&lt;br /&gt;&lt;li&gt; In your .config file manually configure your endpoint to use a custom binding and set its configuration.&lt;br /&gt;&lt;li&gt; Use the WCF configuration editor to configure your endpoint to use a CustomBinding. then in your .config override the default customBinding configuraiton with the BindingBox result.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Currently supported bindings&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://webservices20.cloudapp.net/"&gt;BindingBox&lt;/a&gt; currently supports these bindings:&lt;br /&gt;&lt;br /&gt;&lt;li&gt; WSHttpBinding&lt;br /&gt;&lt;li&gt; WS2007HttpBinding&lt;br /&gt;&lt;li&gt; BasicHttpBinding&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;More to follow&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Stay tuned for these:&lt;br /&gt;&lt;br /&gt;&lt;li&gt; NetTcpBinding&lt;br /&gt;&lt;li&gt; NetNamedPipeBinding&lt;br /&gt;&lt;li&gt; WSFederationHttpBinding&lt;br /&gt;&lt;li&gt; WS2007FederationHttpBinding&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Known issues&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt; DefaultAlgorithmSuite is not converted&lt;br /&gt;&lt;li&gt; ReaderQuotas are not converted&lt;br /&gt;&lt;br /&gt;Please &lt;a href="mailto:yaronn01@gmail.com"&gt;report any bug&lt;/a&gt; you find. Also feel free to submit &lt;a href="mailto:yaronn01@gmail.com"&gt;an enhancement request&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;There is also a nice story behind &lt;a href="http://webservices20.cloudapp.net/"&gt;BindingBox&lt;/a&gt;: It uses cutting edge technologies such as &lt;a href="http://www.microsoft.com/azure/default.mspx"&gt;Windows Azure&lt;/a&gt; and &lt;a href="http://www.codeplex.com/MEF"&gt;MEF&lt;/a&gt;. More to come on this...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-2343305096232489822?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2ogzrENn3ZWRynXVjBBp5qeTiJs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2ogzrENn3ZWRynXVjBBp5qeTiJs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2ogzrENn3ZWRynXVjBBp5qeTiJs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2ogzrENn3ZWRynXVjBBp5qeTiJs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/gLvKgeianC8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/2343305096232489822/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=2343305096232489822" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/2343305096232489822?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/2343305096232489822?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/gLvKgeianC8/bindingbox-convert-wcf-bindings.html" title="BindingBox: Convert WCF Bindings" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_6DvmzgV-o20/SpHKyel4gII/AAAAAAAABFg/URwfjJiJQXg/s72-c/logo+-+small.PNG" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">5</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/08/bindingbox-convert-wcf-bindings.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08GSH0yeip7ImA9WxJbGEU.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-7749706855552071590</id><published>2009-07-28T10:45:00.000-07:00</published><updated>2009-07-29T10:50:29.392-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-29T10:50:29.392-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WCF" /><title>Debugging WCF</title><content type="html">j_saremi has posted a &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/59ed0a59-a86f-4e62-8eef-2f5fa613a727/"&gt;message&lt;/a&gt; in the WCF forum noticing that WCF source code can now be &lt;a href="http://referencesource.microsoft.com/netframework.aspx"&gt;downloaded from Microsoft&lt;/a&gt;. The source can be viewed using the &lt;a href="http://www.red-gate.com/products/reflector/"&gt;reflector&lt;/a&gt; since ever - no news here - but now it can actually be used to debug!&lt;br /&gt;&lt;br /&gt;Really, see:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_6DvmzgV-o20/SnCLT1OG_WI/AAAAAAAABEg/1OUAikN4c1Y/s1600-h/debug.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 208px;" src="http://4.bp.blogspot.com/_6DvmzgV-o20/SnCLT1OG_WI/AAAAAAAABEg/1OUAikN4c1Y/s400/debug.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5363940329018293602" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-7749706855552071590?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ExRnnpu75kxL97kL8z5jIOCV5fI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ExRnnpu75kxL97kL8z5jIOCV5fI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ExRnnpu75kxL97kL8z5jIOCV5fI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ExRnnpu75kxL97kL8z5jIOCV5fI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/wrU_9njI318" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/7749706855552071590/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=7749706855552071590" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/7749706855552071590?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/7749706855552071590?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/wrU_9njI318/debugging-wcf.html" title="Debugging WCF" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_6DvmzgV-o20/SnCLT1OG_WI/AAAAAAAABEg/1OUAikN4c1Y/s72-c/debug.JPG" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/07/debugging-wcf.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8NSX86cSp7ImA9WxJbGE0.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-185429164893074351</id><published>2009-07-28T10:29:00.000-07:00</published><updated>2009-07-28T10:41:38.119-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-28T10:41:38.119-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="X.509" /><category scheme="http://www.blogger.com/atom/ns#" term="WCF" /><title>Cryptic WCF error messages (part 6 of N)</title><content type="html">If you have followed the &lt;a href="http://webservices20.blogspot.com/2008/10/cryptic-wcf-error-messages-part-1-of-n.html"&gt;previous&lt;/a&gt; &lt;a href="http://webservices20.blogspot.com/2008/10/cryptic-wcf-error-messages-part-2-of-n.html"&gt;parts&lt;/a&gt; &lt;a href="http://webservices20.blogspot.com/2008/10/cryptic-wcf-error-messages-part-3-of-n.html"&gt;of&lt;/a&gt; &lt;a href="http://webservices20.blogspot.com/2008/10/cryptic-wcf-error-messages-part-4-of-n.html"&gt;this&lt;/a&gt; &lt;a href="http://webservices20.blogspot.com/2008/10/cryptic-wcf-error-messages-part-5-of-n.html"&gt;series&lt;/a&gt; you already know it tries to diminish the mystery of WCF errors.&lt;br /&gt;&lt;br /&gt;When X.509 certificates are used you might get this error:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE"&gt;&lt;br /&gt;The certificate 'CN=localhost' must have a private key that is capable of key exchange. The process must have access rights for the private key.&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;The second part of the error implies that you may need to set permissions on the private key. I'll deal with that in a separate post.&lt;br /&gt;&lt;br /&gt;The first part of the error means that the certificate was created with a private key that is not capable of key exchange. This can happen when you use makecert.exe to create a test certificate without specifying the correct flags. The correct way to use makecert is:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE"&gt;&lt;br /&gt;makecert -ss My -pe -n "CN=localhost" &lt;b&gt;-sky exchange&lt;/b&gt;&lt;br /&gt;&lt;/fieldset&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-185429164893074351?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ftHqRpcSTQ1BG02NML33ojjr5g4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ftHqRpcSTQ1BG02NML33ojjr5g4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ftHqRpcSTQ1BG02NML33ojjr5g4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ftHqRpcSTQ1BG02NML33ojjr5g4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/nXyNhBHRRdY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/185429164893074351/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=185429164893074351" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/185429164893074351?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/185429164893074351?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/nXyNhBHRRdY/cryptic-wcf-error-messages-part-6-of-n.html" title="Cryptic WCF error messages (part 6 of N)" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/07/cryptic-wcf-error-messages-part-6-of-n.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IFQHs5eyp7ImA9WxJbFU8.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-6994896714202061598</id><published>2009-07-25T02:46:00.000-07:00</published><updated>2009-07-25T04:31:51.523-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-25T04:31:51.523-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="log4net" /><title>log4net gotcha: AppDomains</title><content type="html">We are using the &lt;a href="http://logging.apache.org/log4net/index.html"&gt;log4net&lt;/a&gt; logging framework in a new project.&lt;br /&gt;In one initialization point of the application we init it:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;using log4net;&lt;br /&gt;using log4net.Config;&lt;br /&gt;&lt;br /&gt;XmlConfigurator.Configure(new FileInfo("log4net.config"));&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;And in many other locations we use it:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;ILog log = LogManager.GetLogger(typeof(SomeClass));&lt;br /&gt;log.Debug("some debugging message");&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;In one of my classes the messages I've logged did not appear in the log file (or in any of the other appenders). When I explicitly re-initialized log4net in the same class the messages were written successfully. A short investigation found the reason: This class is called from a different &lt;a href="http://msdn.microsoft.com/en-us/library/system.appdomain.aspx"&gt;AppDomain&lt;/a&gt; than the other classes. log4net's LogManager class is static, which limits its scope to the calling AppDomain. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion: log4net needs to be initialized once per AppDomain.&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-6994896714202061598?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/b0sAsvQ0cBbk7iZLxngX1Y2UH14/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/b0sAsvQ0cBbk7iZLxngX1Y2UH14/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/b0sAsvQ0cBbk7iZLxngX1Y2UH14/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/b0sAsvQ0cBbk7iZLxngX1Y2UH14/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/FNH3h3xIc9E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/6994896714202061598/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=6994896714202061598" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/6994896714202061598?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/6994896714202061598?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/FNH3h3xIc9E/log4net-gotcha-appdomains.html" title="log4net gotcha: AppDomains" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/07/log4net-gotcha-appdomains.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEHQX4zcSp7ImA9WxJbFUw.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-63124596717924803</id><published>2009-07-25T01:36:00.000-07:00</published><updated>2009-07-25T03:10:30.089-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-25T03:10:30.089-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WSE" /><category scheme="http://www.blogger.com/atom/ns#" term="EULA" /><title>Why lawyers make more money than programmers</title><content type="html">Recently I have checked the possibility to bring Microsoft's &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=018a09fd-3a74-43c5-8ec1-8d789091255d&amp;displaylang=en"&gt;Web Services Enhancements (WSE) 3.0&lt;/a&gt; in the installation of a product I author. I already know that Microsoft products cannot be dispatched as is and I need a special redistributable version. Luckily, WSE3 has a &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=9E59C3FB-E7BC-4D91-908E-411A8D329F3D&amp;displaylang=en"&gt;Redistributable Runtime MSI&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So I run this msi and the first stage in the installation wizard is the end user license agreement (EULA). Now I'm not a legalist but the beginning looks promising:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;These license terms are an agreement between Microsoft Corporation...and you. You may install and use one copy of the software on your device...&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;"Microsoft...and you" sounds good, and "you may install" is what I wanted to hear anyway. But the second item is suspicious:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;&lt;b&gt;SCOPE OF LICENSE&lt;/b&gt; &lt;br /&gt;...&lt;br /&gt;&lt;b&gt;You may not&lt;/b&gt;&lt;br /&gt;&lt;li&gt; work around any technical limitations in the software;&lt;br /&gt;&lt;br /&gt;&lt;li&gt; reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation;&lt;br /&gt;&lt;br /&gt;&lt;li&gt; make more copies of the software than specified in this agreement or allowed by applicable law, despite this limitation;&lt;br /&gt;&lt;br /&gt;&lt;li&gt; publish the software for others to copy;&lt;br /&gt;&lt;br /&gt;&lt;li&gt; rent, lease or lend the software;&lt;br /&gt;&lt;br /&gt;&lt;li&gt; &lt;b&gt;transfer the software or this agreement to any third party; or&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt; use the software for commercial software hosting services.&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;Now wait one second. If I may not transfer the software to any third party, then how can I redistribute this &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=9E59C3FB-E7BC-4D91-908E-411A8D329F3D&amp;displaylang=en"&gt;Redistributable Runtime MSI&lt;/a&gt;? Or is this EULA just an agreement between Microsoft and the third party, in which case where is the agreement between Microsoft and me? Am I not worth at least one or two vague terms? &lt;br /&gt;&lt;br /&gt;Anyway I passed this to our legal department. I better go work on some legacy code, which comparing to this looks more readable than ever...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-63124596717924803?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Gnb1hTGbtKlVPGRU35vcLDLYmFw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Gnb1hTGbtKlVPGRU35vcLDLYmFw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Gnb1hTGbtKlVPGRU35vcLDLYmFw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Gnb1hTGbtKlVPGRU35vcLDLYmFw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/PaO1MFHzBpQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/63124596717924803/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=63124596717924803" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/63124596717924803?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/63124596717924803?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/PaO1MFHzBpQ/why-lawyers-make-more-money-then.html" title="Why lawyers make more money than programmers" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/07/why-lawyers-make-more-money-then.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4HRXczfyp7ImA9WxJVFkk.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-5790342538091392797</id><published>2009-07-03T11:59:00.000-07:00</published><updated>2009-07-03T12:05:34.987-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-03T12:05:34.987-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WS-*" /><title>Security in SOA</title><content type="html">&lt;a href="http://blog.facilelogin.com/"&gt;Prabath&lt;/a&gt; gave a &lt;a href="http://blog.facilelogin.com/2009/07/security-in-soa.html"&gt;great presentation&lt;/a&gt; on SOA &amp; web services security in the &lt;a href="http://wso2.org/training"&gt;WSO2 summer school&lt;/a&gt;. It is particularily interesting for everyone who wants to understand what stands behind security related WS-* standards such as WS-Security and WS-Trust.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-5790342538091392797?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/pmyUJAmhWFKmepEap_El-X7qwcw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pmyUJAmhWFKmepEap_El-X7qwcw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/pmyUJAmhWFKmepEap_El-X7qwcw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pmyUJAmhWFKmepEap_El-X7qwcw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/AMx-7HaQ_Pg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/5790342538091392797/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=5790342538091392797" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/5790342538091392797?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/5790342538091392797?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/AMx-7HaQ_Pg/security-in-soa.html" title="Security in SOA" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/07/security-in-soa.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUFQHo9cCp7ImA9WxNUGEk.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-4472579391090730100</id><published>2009-06-28T10:54:00.000-07:00</published><updated>2009-11-10T01:43:31.468-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-10T01:43:31.468-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="blogging" /><title>Test Drive in Skydrive</title><content type="html">This one is for the bloggers among my readers but actually everyone can find it useful.&lt;br /&gt;&lt;br /&gt;You might have noticed recently how downloadable items in my blog appear. For example here is my &lt;a href="http://webservices20.blogspot.com/2009/06/unit-tests-presentation.html"&gt;unit tests presentation&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_6DvmzgV-o20/Ske9-atfpwI/AAAAAAAABDw/FwtY5p8sVWU/s1600-h/blog.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 246px;" src="http://2.bp.blogspot.com/_6DvmzgV-o20/Ske9-atfpwI/AAAAAAAABDw/FwtY5p8sVWU/s400/blog.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5352455562172802818" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;My file storage service is microsoft's &lt;a href="http://skydrive.live.com/"&gt;Skydrive&lt;/a&gt;. Basically you can upload there any file you want and share it with everyone. This is a free service.&lt;br /&gt;&lt;br /&gt;Generally I'm happy with it but here are some points to improve:&lt;br /&gt;&lt;br /&gt;&lt;li&gt; There is no direct link for download - users need to enter the "windows live" portal and download from there. I guess there is a traffic reason for this. But there may be alternatives, like having the link embedded in the consuming site with some logo/link to msn. &lt;b&gt;Update:&lt;/b&gt; &lt;a href="http://www.timacheson.com/"&gt;Tim Acheson&lt;/a&gt; has created an API to &lt;a href="http://www.timacheson.com/Blog/2009/oct/skydrive_api"&gt;get the direct link&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;li&gt; The download link in the live spaces portal is not explicit enough. Yes, the file is just one click away, but the image does not look clickable enough and the "download" link is pale:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_6DvmzgV-o20/Ske9-mzACKI/AAAAAAAABEA/kZcL6C9ybUU/s1600-h/skydrive.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 265px;" src="http://4.bp.blogspot.com/_6DvmzgV-o20/Ske9-mzACKI/AAAAAAAABEA/kZcL6C9ybUU/s400/skydrive.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5352455565417121954" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt; No statistics such as "how many users downloaded this file". Very important, in particular to bloggers.&lt;br /&gt;&lt;br /&gt;&lt;li&gt; The embedded files do not appear in feed readers (since they use IFrame):&lt;br /&gt;&lt;br /&gt;site:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_6DvmzgV-o20/Ske9-atfpwI/AAAAAAAABDw/FwtY5p8sVWU/s1600-h/blog.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 246px;" src="http://2.bp.blogspot.com/_6DvmzgV-o20/Ske9-atfpwI/AAAAAAAABDw/FwtY5p8sVWU/s400/blog.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5352455562172802818" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;reader:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_6DvmzgV-o20/Ske9-iRBbEI/AAAAAAAABD4/wGTOEA_5gSk/s1600-h/reader.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 189px;" src="http://1.bp.blogspot.com/_6DvmzgV-o20/Ske9-iRBbEI/AAAAAAAABD4/wGTOEA_5gSk/s400/reader.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5352455564200864834" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt; If you will surf to&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;http://skydrive.live.com/&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;before you'll notice it you'll be in&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;http://cid-4999e5d00449874d.skydrive.live.com/&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;which makes it hard to add skydrive to the browser favorites.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I know some Microsoft employees read my blog so hopefully these issues will be resolved in a future release ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-4472579391090730100?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QnnUeGXlSPn4FBUVdyP--tGqbJk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QnnUeGXlSPn4FBUVdyP--tGqbJk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QnnUeGXlSPn4FBUVdyP--tGqbJk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QnnUeGXlSPn4FBUVdyP--tGqbJk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/e5EZT1xMoFs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/4472579391090730100/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=4472579391090730100" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/4472579391090730100?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/4472579391090730100?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/e5EZT1xMoFs/test-drive-in-skydrive.html" title="Test Drive in Skydrive" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_6DvmzgV-o20/Ske9-atfpwI/AAAAAAAABDw/FwtY5p8sVWU/s72-c/blog.JPG" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/06/test-drive-in-skydrive.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEICQnY8fyp7ImA9WxJVEU4.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-1437389928201703765</id><published>2009-06-27T12:40:00.001-07:00</published><updated>2009-06-27T14:02:43.877-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-27T14:02:43.877-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web Services Interoperability" /><category scheme="http://www.blogger.com/atom/ns#" term="WSDL" /><title>Contract-First vs.Code-First, Still?</title><content type="html">Yes, &lt;a href="http://www.pluralsight.com/community/blogs/craig/archive/2005/04/27/7786.aspx"&gt;an&lt;/a&gt; &lt;a href="http://www.25hoursaday.com/weblog/CommentView.aspx?guid=e1ab8978-f0a9-4913-bee3-badc1cbefbe5"&gt;old&lt;/a&gt; &lt;a href="http://www.theserverside.com/news/thread.tss?thread_id=44966"&gt;debate&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;However it is interesting to see how it is still relevant even a few years later when new frameworks are around.&lt;br /&gt;&lt;br /&gt;The two common paradigms for building a web service are code-first and contract-first. The former means you start writing your c#/java/whatever service code and generate the contract (wsdl) from it. The latter means you first create the wsdl (either manually or using some tool) and then create the service code from it.&lt;br /&gt;&lt;br /&gt;So with code-first you write this:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;[WebMethod]&lt;br /&gt;    public string HelloWorld() {&lt;br /&gt;       &amp;nbsp;&amp;nbsp; return "Hello World";&lt;br /&gt;    }&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;And this is auto generated for you:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt; &amp;lt;s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/"&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;      &amp;lt;s:element name="HelloWorld"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        &amp;lt;s:complexType /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;      &amp;lt;/s:element&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;      &amp;lt;s:element name="HelloWorldResponse"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        &amp;lt;s:complexType&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          &amp;lt;s:sequence&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            &amp;lt;s:element minOccurs="0" maxOccurs="1" name="HelloWorldResult" type="s:string" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          &amp;lt;/s:sequence&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        &amp;lt;/s:complexType&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;      &amp;lt;/s:element&amp;gt;&lt;br /&gt;    &amp;lt;/s:schema&amp;gt;&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;While in contract-first you write the wsdl (possibly using a tool) and the code is generated. &lt;br /&gt;&lt;br /&gt;Pros for code-first:&lt;br /&gt;&lt;br /&gt;&lt;li&gt; Developers are already familiar with code so development is faster. Being veteran developers, architects are also code-savvy.&lt;br /&gt;&lt;li&gt; More online resources&lt;br /&gt;&lt;li&gt; You'll need to use it anyway&lt;br /&gt;&lt;br /&gt;Pros for contract first:&lt;br /&gt;&lt;br /&gt;&lt;li&gt; Better interoperability&lt;br /&gt;&lt;li&gt; Defers implementaiton details&lt;br /&gt;&lt;li&gt; You'll need to use it anyway&lt;br /&gt;&lt;br /&gt;Code first is the de-facto "default setting" in almost all frameworks - most tutorials and documentation use it. So contract-first is much more interesting from a "let's write an interesting post" POV.&lt;br /&gt;&lt;br /&gt;In the next series of posts I'll write on the contract-first approach using several frameworks.&lt;br /&gt;&lt;br /&gt;My opinion on the matter is that it does not really matter. Contract-first is important from the interoperability perspective, but most frameworks do not support all wsdl/schema artifacts. So ignoring the code you'll find yourself working with a perfectly interoperable wsdl that no framework can consume. For example &lt;i&gt;xsd:union&lt;/i&gt; is not supported in .Net and &lt;i&gt;xsd:choice&lt;/i&gt; isn't in Axis2 1.3. Contract without an implementation is useless. &lt;br /&gt;&lt;br /&gt;On the other hand, code-first also requires you to look in the generated wsdl and verify it is interoperable. A service that can't be consumed is also useless.&lt;br /&gt;&lt;br /&gt;So code-first or contract-first? Whatever, you'll need to do both anyway.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-1437389928201703765?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/SXkfcvWZ4ngBqNS_4HBTXuRXIZo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SXkfcvWZ4ngBqNS_4HBTXuRXIZo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/SXkfcvWZ4ngBqNS_4HBTXuRXIZo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SXkfcvWZ4ngBqNS_4HBTXuRXIZo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/XLXlZxB46fo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/1437389928201703765/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=1437389928201703765" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/1437389928201703765?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/1437389928201703765?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/XLXlZxB46fo/contract-first-vscode-first-still.html" title="Contract-First vs.Code-First, Still?" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/06/contract-first-vscode-first-still.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEGRX04eyp7ImA9WxJVEU4.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-8820972924343382016</id><published>2009-06-26T09:14:00.000-07:00</published><updated>2009-06-27T14:03:44.333-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-27T14:03:44.333-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WCF proxy" /><title>WCF proxy cleanup</title><content type="html">When working with a WCF client proxy we need to close it after usage.&lt;br /&gt;Failing to do so would of course affect our client performance. However it would also affect our server performance and in some cases might block new client from connecting to it. One example is when using sessions (which is the default wcf behavior): Since the open sessions number is limited a non-closed client might block a new client.&lt;br /&gt;&lt;br /&gt;However the simple way of closing a client:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;proxy.close();&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;is naive. The close may fail, for example due to the client not being able to release the session because of a server problem. For this reason we need to catch any possible exception.&lt;br /&gt;&lt;br /&gt;Pablo perfectly explains &lt;a href="http://weblogs.asp.net/cibrax/archive/2009/06/26/disposing-a-wcf-proxy.aspx"&gt;how to do it&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-8820972924343382016?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/WJ4XJv6-0hf7c7OW8_ogel7ydI8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WJ4XJv6-0hf7c7OW8_ogel7ydI8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/WJ4XJv6-0hf7c7OW8_ogel7ydI8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WJ4XJv6-0hf7c7OW8_ogel7ydI8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/sr_yzIP-6H0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/8820972924343382016/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=8820972924343382016" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/8820972924343382016?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/8820972924343382016?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/sr_yzIP-6H0/wcf-proxy-cleanup.html" title="WCF proxy cleanup" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/06/wcf-proxy-cleanup.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIFQHgyeip7ImA9WxJWGU4.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-9115801743425434795</id><published>2009-06-25T05:46:00.000-07:00</published><updated>2009-06-25T05:55:11.692-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-25T05:55:11.692-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Unit Tests" /><category scheme="http://www.blogger.com/atom/ns#" term="TDD" /><title>Unit Tests Presentation</title><content type="html">Yesterday I have conducted a session on Unit Testing.&lt;br /&gt;My &lt;a href="http://cid-4999e5d00449874d.skydrive.live.com/self.aspx/.Public/unit%20tests.ppt"&gt;presentation&lt;/a&gt; answers the most common questions on the matter:&lt;br /&gt;&lt;br /&gt;&lt;li&gt; What to test?&lt;br /&gt;&lt;li&gt; When to test?&lt;br /&gt;&lt;li&gt; How to write a good unit test?&lt;br /&gt;&lt;br /&gt;And most important the presentation is &lt;b&gt;full of examples&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;Download it from &lt;a href="http://cid-4999e5d00449874d.skydrive.live.com/self.aspx/.Public/unit%20tests.ppt"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe scrolling="no" marginheight="0" marginwidth="0" frameborder="0" style="width:240px;height:66px;margin:3px;padding:0;border:1px solid #dde5e9;background-color:#ffffff;" src="http://cid-4999e5d00449874d.skydrive.live.com/embedrowdetail.aspx/.Public/unit%20tests.ppt"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Feel free to use it or present it whether you are a developer, a tester or a TDD evangelist.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-9115801743425434795?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0WJVKENEE_2HfrUaBfjyGMkt-DM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0WJVKENEE_2HfrUaBfjyGMkt-DM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0WJVKENEE_2HfrUaBfjyGMkt-DM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0WJVKENEE_2HfrUaBfjyGMkt-DM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/D6Ynlaq-W6k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/9115801743425434795/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=9115801743425434795" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/9115801743425434795?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/9115801743425434795?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/D6Ynlaq-W6k/unit-tests-presentation.html" title="Unit Tests Presentation" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/06/unit-tests-presentation.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQNR3Y_fyp7ImA9WxJWF00.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-8550225975621864277</id><published>2009-06-22T13:40:00.001-07:00</published><updated>2009-06-22T13:43:16.847-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-22T13:43:16.847-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WSE VS2005" /><title>WSE2 With Visual Studio 2005, Anyone?</title><content type="html">I've just published a post on &lt;a href="http://webservices20.blogspot.com/2009/06/wse3-is-so-vs-2008.html"&gt;how to use WSE3 with Visual Studio 2008&lt;/a&gt;.&lt;br /&gt;I forgot to mention that the same technique can be used to have WSE2 and VS 2005 (or even VS 2008) working together.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-8550225975621864277?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vE8mJ_vJYF0TwJuA_kJaoEb7tsE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vE8mJ_vJYF0TwJuA_kJaoEb7tsE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vE8mJ_vJYF0TwJuA_kJaoEb7tsE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vE8mJ_vJYF0TwJuA_kJaoEb7tsE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/htzIvJcBumI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/8550225975621864277/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=8550225975621864277" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/8550225975621864277?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/8550225975621864277?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/htzIvJcBumI/wse2-with-visual-studio-2005-anyone.html" title="WSE2 With Visual Studio 2005, Anyone?" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/06/wse2-with-visual-studio-2005-anyone.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQDRHk8eSp7ImA9WxJWF00.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-9004337419190736235</id><published>2009-06-22T13:24:00.000-07:00</published><updated>2009-06-22T13:42:55.771-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-22T13:42:55.771-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WSE VS2008" /><title>WSE3 is so... VS 2008</title><content type="html">Microsoft has provided WSE3 a Visual Studio 2005 add-in with nice UI support. Look how nice it is:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_6DvmzgV-o20/Sj_oyeOs8UI/AAAAAAAABDg/Z2VsXe33P0g/s1600-h/policy.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 192px;" src="http://3.bp.blogspot.com/_6DvmzgV-o20/Sj_oyeOs8UI/AAAAAAAABDg/Z2VsXe33P0g/s400/policy.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5350250836145271106" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The less nice part is that there is no such support for Visual Studio 2008 as Microsoft is encouraging us to use WCF instead. Which is a good idea generally, but not alway feasible: The reality is that a lot of the WSE3 &amp; VS 2005 projects were migrated to VS2008 and lack this fundemental support. Also a lot of new projects need compatability with WSE3 which is not always possible with WCF.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;So how WSE3 can work with VS2008?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The truth is that the WSE run time is agnostic to the IDE version. IOW projects built with VS 2008 can use WSE3 in run time in the same way as VS 2005 projects. This means we are left with the tiny mission of actually developing these projects. Well, not so tiny but also not too hard. We have two options for our needs:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Option 1 - Trainer Wheels &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;We need to remember that configuring WSE infrastructure is mostly a one-time mission - we do not frequently alter it during development. So we can create a VS2005 project with WSE3 and migrate it to VS2008 as is using the VS migration wizard. Usually we would never need to look at the WSE configuration until late stages. Then we can open our VS2005 project, change what we want from UI, and notice that such changes only affect this section of our web.config/app.config:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;&amp;lt;microsoft.web.services3&amp;gt;&lt;br /&gt;...&lt;br /&gt;&amp;lt;/microsoft.web.services3&amp;gt;&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;So we can copy&amp;paste this part to our new project. In case we use a .policy file we can copy all of its contents to the new project. If this looks lame it's only because VS 2005 is strictly a trainer wheel here, we do not actually need it. For this we have:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Option 2 - Just 2008, Please&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;We can directly use WSE3 with VS2008 in the following way:&lt;br /&gt;&lt;br /&gt;1. In our project, add assembly reference to "Microsoft.Web.Services3.dll" (it's in the GAC and also in %Program Files%\Microsoft WSE\v3.0)&lt;br /&gt;&lt;br /&gt;2. If we are creating the client side we would like to use "add web reference". This is not available but luckily we have the option to use %Program Files%\Microsoft WSE\v3.0\Tools\WseWsdl3.exe:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;WseWsdl3.exe http://some.vendor/service.asmx?wsdl&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;This will create our proxy .cs file which we can add to our project. The file looks like this:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;public partial class OurServiceName : Microsoft.Web.Services3.Messaging.SoapClient&lt;br /&gt;{&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;So in our code we can create a new instance of this class and call the service:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;OurServiceName proxy = new OurServiceName();&lt;br /&gt;proxy.DoSomething();&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For the service side we can just create a new normal web service project, nothing special.&lt;br /&gt;&lt;br /&gt;3. We can now use the WseConfigEditor3.exe tool that comes with the WSE3 SDK to edit our app.config/web.config and even add a policy file. Then in our client code we can tell the proxy to use this policy:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;serviceProxy.SetPolicy("ClientPolicy"); &lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;This is the same we would do with VS 2005 so no news here.&lt;br /&gt;&lt;br /&gt;If we are on the server side we need to check both "Enable this project for Web Services Enhancements" and "Enable Microsoft Web Services Enhancements Soap Protocol Factory" in the configuration editor:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_6DvmzgV-o20/Sj_o5iPhYmI/AAAAAAAABDo/iSGmTB0oXG4/s1600-h/config.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 240px;" src="http://1.bp.blogspot.com/_6DvmzgV-o20/Sj_o5iPhYmI/AAAAAAAABDo/iSGmTB0oXG4/s400/config.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5350250957481534050" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Pretty easy after all...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-9004337419190736235?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nAFB1uN86jW9xLwtTH2C2_v17gQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nAFB1uN86jW9xLwtTH2C2_v17gQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nAFB1uN86jW9xLwtTH2C2_v17gQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nAFB1uN86jW9xLwtTH2C2_v17gQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/57sfC12VaPc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/9004337419190736235/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=9004337419190736235" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/9004337419190736235?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/9004337419190736235?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/57sfC12VaPc/wse3-is-so-vs-2008.html" title="WSE3 is so... VS 2008" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_6DvmzgV-o20/Sj_oyeOs8UI/AAAAAAAABDg/Z2VsXe33P0g/s72-c/policy.JPG" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/06/wse3-is-so-vs-2008.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UDR3Y8fSp7ImA9WxJWFUw.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-1305473874863943229</id><published>2009-06-20T07:26:00.000-07:00</published><updated>2009-06-20T09:27:56.875-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-20T09:27:56.875-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WCF" /><category scheme="http://www.blogger.com/atom/ns#" term="Performance" /><title>Are WCF defaults considered harmful?</title><content type="html">When we programmers see such an error message&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;quota 65536 too small please increase&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;or something along these lines, and have no idea what this quota is good for, we face the temptation to put there a ridiculously large number (like 6.10* 8^23) so we would never have to it again. We should hold ourselves from doing this and put a rational number based on our needs. See the story bellow.&lt;br /&gt;&lt;br /&gt;Ayende published &lt;a href="http://ayende.com/Blog/archive/2009/06/04/wcf-works-in-mysterious-ways.aspx"&gt;an interesting post&lt;/a&gt; on a case where he needed to send a large number of objects between a WCF client and server. For this he had to alter some server-side default:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;[ServiceBehavior(MaxItemsInObjectGraph = Int32.MaxValue)]&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;When he "update service reference" on his client he found out that this setting is not propagated to the clients which forces him to manually change this setting in each and every client (as stated in &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractserializer.maxitemsinobjectgraph.aspx"&gt;MSDN&lt;/a&gt;). &lt;br /&gt;&lt;br /&gt;Arnon follows this up &lt;a href="http://www.rgoarchitects.com/nblog/CommentView,guid,8617B551-E3A5-4AE2-987E-8F580687F4C9.aspx#820790dd-3267-4b50-93e9-568f69636081"&gt;in his post&lt;/a&gt; and claims the following:&lt;br /&gt;&lt;br /&gt;&lt;li&gt; This setting needs to be automatically propagated to clients&lt;br /&gt;&lt;li&gt; There are other settings which are not propagated and needs to be, for example message size limits&lt;br /&gt;&lt;li&gt; The default setting should be higher (although not infinite)&lt;br /&gt;&lt;br /&gt;I absolutely agree with the first claim. This setting is in effect both when sending and receiving data. Since in each call one party sends and another receives this setting has to be correlated between the parties. The way to dispatch this setting to clients would probably by extending the wsdl's &lt;a href="http://msdn.microsoft.com/en-us/library/ms996497.aspx"&gt;WS-Policy&lt;/a&gt; with this new setting (which would be msn proprietary for that matter).&lt;br /&gt;&lt;br /&gt;I only partially agree with Arnon's second statement. The MaxReceivedMessageSize setting (if it's the one he refers to) only affects the receiving side. There is no limit on the size of outgoing messages. Here it makes sense to have a different value for the client and the server since they probably have different capabilities in terms of hardware and they also need to handle different data.&lt;br /&gt;&lt;br /&gt;Going back to the opening paragraph, I want to make clear the rational behind all of these settings (and me and Arnon are probably in agreement on this). These settings are not meant to directly improve the performance of the service but rather they aim to block &lt;a href="http://en.wikipedia.org/wiki/Denial-of-service_attack"&gt;DOS&lt;/a&gt; attacks. So if the limit on this setting is too high an attacker can send an XML bomb which will consume large server resources. &lt;b&gt;These settings are much more important for the server then for the client&lt;/b&gt;, but as long as clients allow to customize them &lt;b&gt;the client values do not always have to be correlated with the server ones&lt;/b&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-1305473874863943229?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Jy-z1UdNchJF0gYo9QLbDITgY40/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Jy-z1UdNchJF0gYo9QLbDITgY40/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Jy-z1UdNchJF0gYo9QLbDITgY40/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Jy-z1UdNchJF0gYo9QLbDITgY40/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/uv4m0WsMqxQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/1305473874863943229/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=1305473874863943229" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/1305473874863943229?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/1305473874863943229?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/uv4m0WsMqxQ/are-wcf-defaults-considered-harmful.html" title="Are WCF defaults considered harmful?" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/06/are-wcf-defaults-considered-harmful.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcGQ34-fSp7ImA9WxJWFks.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-3799375161455847538</id><published>2009-06-19T13:40:00.000-07:00</published><updated>2009-06-22T03:37:02.055-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-22T03:37:02.055-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WCF VS2008" /><title>WCF Self Hosting Project Template</title><content type="html">Visual Studio 2008 comes with project templates for a WCF web site and a WCF service library. But what about &lt;a href="http://www.code-magazine.com/Article.aspx?quickid=0701041"&gt;self hosting&lt;/a&gt;?&lt;br /&gt;&lt;br /&gt;I've create a simple self hosting template which you can use when starting new projects. This is useful for real projects as well as for quick POC/prototyping projects. For the latter it brings the following advantages over the out of the box templates:&lt;br /&gt;&lt;br /&gt;&lt;li&gt; It encapsulates the service as an executable so it can be easily deployed without messing with IIS (xcopy is enough)&lt;br /&gt;&lt;li&gt; It enables to use transports which are not supported in web sites (e.g. netTcp).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Installation&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;1. Save this template&lt;br /&gt;&lt;br /&gt;&lt;iframe scrolling="no" marginheight="0" marginwidth="0" frameborder="0" style="width:240px;height:66px;margin:3px;padding:0;border:1px solid #dde5e9;background-color:#ffffff;" src="http://cid-4999e5d00449874d.skydrive.live.com/embedrowdetail.aspx/.Public/WCF%20Self%20Hosted%20Service.zip"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;(if you do not see the file use this &lt;a href="http://cid-4999e5d00449874d.skydrive.live.com/self.aspx/.Public/WCF%20Self%20Hosted%20Service.zip"&gt;direct link&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;in this location: &lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;%My Documents%\Visual Studio 2008\Templates\ProjectTemplates\Visual C#\WCF&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;Note 1: save the zip file itself, no need to extract it&lt;br /&gt;Note 2: If the WCF subfolder does not exist then create it&lt;br /&gt;&lt;br /&gt;2. The template now appears in VS "new project" window under the Visual C# \ WCF node.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_6DvmzgV-o20/Sjv5W_vMhTI/AAAAAAAABDY/vSHDicKSE-s/s1600-h/self+host.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 277px;" src="http://1.bp.blogspot.com/_6DvmzgV-o20/Sjv5W_vMhTI/AAAAAAAABDY/vSHDicKSE-s/s400/self+host.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5349143155894420786" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3. After you create the project press F5 to run it - all the information you need to know is printed to the console.&lt;br /&gt;&lt;br /&gt;Enjoy :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-3799375161455847538?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eI3c3J5QuSZ64rwmAFnc1db_daA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eI3c3J5QuSZ64rwmAFnc1db_daA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eI3c3J5QuSZ64rwmAFnc1db_daA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eI3c3J5QuSZ64rwmAFnc1db_daA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/ZFQ7dSWvHjY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/3799375161455847538/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=3799375161455847538" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/3799375161455847538?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/3799375161455847538?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/ZFQ7dSWvHjY/wcf-self-hosting-project-template.html" title="WCF Self Hosting Project Template" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_6DvmzgV-o20/Sjv5W_vMhTI/AAAAAAAABDY/vSHDicKSE-s/s72-c/self+host.JPG" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/06/wcf-self-hosting-project-template.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEACQX47cCp7ImA9WxNREUU.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-400671095745378797</id><published>2009-04-30T07:03:00.000-07:00</published><updated>2009-09-05T13:32:40.008-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-05T13:32:40.008-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Security" /><category scheme="http://www.blogger.com/atom/ns#" term="ClearUsernameBinding" /><category scheme="http://www.blogger.com/atom/ns#" term="WCF" /><title>Introducing WCF ClearUsernameBinding</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://code.google.com/p/wcf-clear-username-binding/"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 50px;" src="http://lh5.ggpht.com/_6DvmzgV-o20/SSg5hOf8ApI/AAAAAAAAAwc/t0LbTrLs3m0/clear%20username%20binding.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Using cleartext username/password is &lt;a href="http://webservices20.blogspot.com/2008/11/securing-web-services-with.html"&gt;usually not recommended&lt;/a&gt;. However it is sometimes required (&lt;a href="http://blog.hackedbrain.com/archive/2006/09/26/5281.aspx"&gt;like with F5's BIG-IP&lt;/a&gt;). WCF &lt;a href="http://webservices20.blogspot.com/2008/11/how-to-use-clear-usernamepassword-with.html"&gt;does not natively allow&lt;/a&gt; us to use such scenario. For this reason I have written &lt;a href="http://code.google.com/p/wcf-clear-username-binding/"&gt;ClearUsernameBinding&lt;/a&gt; - a WCF binding that enables to send cleartext username/password over HTTP.&lt;br /&gt;&lt;br /&gt;Full source code is available in &lt;a href="http://code.google.com/p/wcf-clear-username-binding/"&gt;google code&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So without any further preparations let's see how to use ClearUsernameBinding.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 1: Download latest release&lt;/b&gt;&lt;br /&gt;Download it &lt;a href="http://wcf-clear-username-binding.googlecode.com/files/ClearUsernameBinding%20v1.0.zip"&gt;here&lt;/a&gt; or go to &lt;a href="http://code.google.com/p/wcf-clear-username-binding/"&gt;google code&lt;/a&gt;.&lt;br /&gt;Then extract the zip to some folder, let's say C:\program files\ (the ClearUsernameBinding subfolder will be created when extracting the zip).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 2 (optional) - Run the sample project&lt;/b&gt;&lt;br /&gt;It can be useful to run the sample application.&lt;br /&gt;&lt;br /&gt;Run the server:&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;C:\program files\ClearUsernameBinding\TestService\bin\Release\TestService.exe&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_6DvmzgV-o20/SSg9aN6IDQI/AAAAAAAAAws/0zPlT9MiiwY/s1600-h/client.PNG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 199px;" src="http://3.bp.blogspot.com/_6DvmzgV-o20/SSg9aN6IDQI/AAAAAAAAAws/0zPlT9MiiwY/s400/client.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5271530884456516866" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And now the client:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;C:\program files\ClearUsernameBinding\TestClient\bin\Release\TestClient.exe&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_6DvmzgV-o20/SSg9Z3pkVEI/AAAAAAAAAwk/IXdVdom6i8k/s1600-h/server.PNG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 199px;" src="http://2.bp.blogspot.com/_6DvmzgV-o20/SSg9Z3pkVEI/AAAAAAAAAwk/IXdVdom6i8k/s400/server.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5271530878481486914" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And if everything went smoothly you have just seen ClearUsernameBinding in first action!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 3 (optional) - Investigate the sample project source code&lt;/b&gt;&lt;br /&gt;The best way to learn a new (and very simple in this case) technology is by looking at existing projects. Just open with VS 2008 the solution file:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;C:\program files\ClearUsernameBinding\ClearUsernameBinding.sln&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;And look at the source of the projects TestClient and TestService. These two projects are just normal WCF projects configured to use ClearUsernameBinding. In other words, &lt;b&gt;making a WCF client/service use ClearUsernameBinding is just a matter of changing web.config and does not require coding.&lt;/b&gt; We will see in the next steps how to do it from scratch.&lt;br /&gt;&lt;br /&gt;I'll probably have a separate post on the binding implementation itself. It is pretty straight forward and the handling of security is as I learned from &lt;a href="http://blogs.msdn.com/drnick/archive/2007/01/17/faking-channel-security.aspx"&gt;Nicholas Allen's&lt;/a&gt; blog.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 4 - Creating your own service&lt;/b&gt;&lt;br /&gt;For this step just create any normal WCF web site or a self hosted service. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 5 - Configure the service to use ClearUsernameBinding&lt;/b&gt;&lt;br /&gt;Add your project a dll reference to &lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;C:\Program Files\ClearUsernameBinding\ClearUserPassBinding\bin\Release\ClearUsernameBinding.dll&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;Then open web.config and register the ClearUsernameBinding under the system.ServiceModel section:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;        &amp;lt;extensions&amp;gt;&lt;br /&gt;&amp;nbsp;          &amp;lt;bindingExtensions&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;            &amp;lt;add name="clearUsernameBinding" type="WebServices20.BindingExtenions.ClearUsernameCollectionElement, ClearUsernameBinding" /&amp;gt;&lt;br /&gt;&amp;nbsp;          &amp;lt;/bindingExtensions&amp;gt;&lt;br /&gt;        &amp;lt;/extensions&amp;gt;&lt;br /&gt;&lt;br /&gt;      &amp;lt;bindings&amp;gt;&lt;br /&gt;&amp;nbsp;        &amp;lt;clearUsernameBinding&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;          &amp;lt;binding name="myClearUsernameBinding" messageVersion="Soap12"&amp;gt;            &lt;br /&gt;&amp;nbsp;&amp;nbsp;          &amp;lt;/binding&amp;gt;&lt;br /&gt;&amp;nbsp;        &amp;lt;/clearUsernameBinding&amp;gt;&lt;br /&gt;      &amp;lt;/bindings&amp;gt;&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;Finally configure your endpoint to use ClearUsernameBinging and its configuration:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;&amp;lt;endpoint binding="clearUsernameBinding" bindingConfiguration="myClearUsernameBinding"&lt;br /&gt;                    contract="WebServices20.SampleService.IEchoService" /&amp;gt;&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;An example of the complete web.config is inside &lt;a href="http://wcf-clear-username-binding.googlecode.com/files/ClearUsernameBinding%20v1.0.zip"&gt;the full project binary&amp;amp;source&lt;/a&gt; in &lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;C:\Program Files\ClearUsernameBinding\TestService\bin\Release\TestService.exe.config&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 6 (optional) - Configure the message version&lt;/b&gt;&lt;br /&gt;If you need to use a specific message version configure it in the "messageVersion" attribute in the above configuration. Valid values are: Soap11WSAddressing10, Soap12WSAddressing10, Soap11WSAddressingAugust2004, Soap12WSAddressingAugust2004, Soap11, Soap12, None, Default.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;          &amp;lt;binding name="myClearUsernameBinding" messageVersion="Soap12"&amp;gt;            &lt;br /&gt;          &amp;lt;/binding&amp;gt;&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 7 - Configure the username authentication&lt;/b&gt;&lt;br /&gt;This one needs to be done in any username/password authenticated service and not just one that uses ClearUsernameBinding. By default your server will authenticate the users against your active directory domain. If you want to do your own custom authentication you need to create a new class library project with a class that implements &lt;i&gt;System.IdentityModel.Selectors.UserNamePasswordValidator&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The class can look like this:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;   public class MyUserNameValidator : UserNamePasswordValidator&lt;br /&gt;    {&lt;br /&gt;&amp;nbsp;        public override void Validate(string userName, string password)&lt;br /&gt;&amp;nbsp;        {&lt;br /&gt;&amp;nbsp;&amp;nbsp;            if (userName != "yaron")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;                throw new SecurityTokenException("Unknown Username or Password");&lt;br /&gt;&amp;nbsp;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;Don't forget to add dll reference to &lt;i&gt;System.IdentityModel&lt;/i&gt; and &lt;i&gt;System.IdentityModel.Selectors&lt;/i&gt; or the project will not compile. Then add this project as a project reference to your service project/website and configure the latter to use this custom authenticator:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;&amp;lt;behaviors&amp;gt;&lt;br /&gt;&amp;nbsp;            &amp;lt;serviceBehaviors&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;                &amp;lt;behavior name="SampleServiceBehaviour"&amp;gt;&lt;br /&gt;...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;                    &amp;lt;serviceCredentials&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                        &amp;lt;userNameAuthentication &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;userNamePasswordValidationMode="Custom"&lt;br /&gt;                            &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;customUserNamePasswordValidatorType="WebServices20.Validators.MyUserNameValidator, MyUserNameValidator" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;                    &amp;lt;/serviceCredentials&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;                &amp;lt;/behavior&amp;gt;&lt;br /&gt;&amp;nbsp;            &amp;lt;/serviceBehaviors&amp;gt;&lt;br /&gt;        &amp;lt;/behaviors&amp;gt;&lt;br /&gt;...&lt;br /&gt;&amp;lt;service behaviorConfiguration="SampleServiceBehaviour" name="WebServices20.SampleService.EchoService"&amp;gt;&lt;br /&gt;...&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;Again the full sample is available for &lt;a href="http://wcf-clear-username-binding.googlecode.com/files/ClearUsernameBinding%20v1.0.zip"&gt;download&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 8 - Run the service&lt;/b&gt;&lt;br /&gt;Yes, the service is now ready to be activated, so run it when you are ready (run it directly from VS, just press F5).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 9 -Build a client&lt;/b&gt;&lt;br /&gt;A service is worth nothing if there are no clients to consume it.&lt;br /&gt;Create a new console application.&lt;br /&gt;Right click the "References" node in the solution explorer and choose "Add service reference". Specify the WSDL of the server. If you are running the server from the given sample then the wsdl is in &lt;i&gt;http://localhost:8087/SampleService/?WSDL&lt;/i&gt;. If you used your own server just run it and get the wsdl.&lt;br /&gt;&lt;br /&gt;Now add some client code that uses the proxy to call the service. Don't forget to specify your username/password. For example:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;ServiceReference1.EchoServiceClient client = new TestClient.ServiceReference1.EchoServiceClient();&lt;br /&gt;client.ClientCredentials.UserName.UserName = "yaron";&lt;br /&gt;client.ClientCredentials.UserName.Password = "1234";            &lt;br /&gt;client.EchoString("hello");&lt;br /&gt;&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 10 - Configure the client&lt;/b&gt;&lt;br /&gt;Configuring the client is as simple as configuring the service.&lt;br /&gt;Here is the full client app.config:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;system.serviceModel&amp;gt;&lt;br /&gt;&amp;nbsp;        &amp;lt;client&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;            &amp;lt;endpoint address="http://localhost.:8087/SampleService/" binding="clearUsernameBinding"&lt;br /&gt;&amp;nbsp;&amp;nbsp;                bindingConfiguration="myClearUsernameBinding" &amp;nbsp;&amp;nbsp;contract="ServiceReference1.IEchoService"&lt;br /&gt;&amp;nbsp;&amp;nbsp;                name="ClearUsernameBinding_IEchoService" /&amp;gt;&lt;br /&gt;&amp;nbsp;        &amp;lt;/client&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;      &amp;lt;extensions&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;        &amp;lt;bindingExtensions&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;          &amp;lt;add name="clearUsernameBinding" &amp;nbsp;&amp;nbsp;&amp;nbsp;type="WebServices20.BindingExtenions.ClearUsernameCollectionElement&amp;nbsp;&amp;nbsp;&amp;nbsp;, ClearUsernameBinding" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;        &amp;lt;/bindingExtensions&amp;gt;&lt;br /&gt;&amp;nbsp;      &amp;lt;/extensions&amp;gt;&lt;br /&gt;      &lt;br /&gt;&amp;nbsp;      &amp;lt;bindings&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;        &amp;lt;clearUsernameBinding&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;          &amp;lt;binding name="myClearUsernameBinding" messageVersion="Soap12"&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;          &amp;lt;/binding&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;        &amp;lt;/clearUsernameBinding&amp;gt;&lt;br /&gt;&amp;nbsp;      &amp;lt;/bindings&amp;gt;&lt;br /&gt;      &lt;br /&gt;    &amp;lt;/system.serviceModel&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 11 - Done, Done, Done!&lt;/b&gt;&lt;br /&gt;That's all. You can now run your client and see how WCF can be used to access a service with a cleartext username/password. Use a tool like fiddler to verify that indeed a clear username is sent (I've shorten some low-level stuff from bellow message):&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;&amp;lt;Envelope&amp;gt;&lt;br /&gt;&amp;nbsp;  &amp;lt;Header&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;    &amp;lt;Security&amp;gt;&lt;br /&gt;...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;UsernameToken&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        &amp;lt;Username&amp;gt;yaron&amp;lt;/Username&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        &amp;lt;Password&gt;1234&amp;lt;/Password&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;/UsernameToken&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;    &amp;lt;/Security&amp;gt;&lt;br /&gt;&amp;nbsp;  &amp;lt;/Header&amp;gt;&lt;br /&gt;&amp;nbsp;  &amp;lt;Body&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;    &amp;lt;EchoString xmlns="http://tempuri.org/"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;s&amp;gt;hello&amp;lt;/s&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;    &amp;lt;/EchoString&amp;gt;&lt;br /&gt;&amp;nbsp;  &amp;lt;/Body&amp;gt;&lt;br /&gt;&amp;lt;/Envelope&amp;gt;&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;Sending username/password on the clear is not available out of the box with WCF (for reasons mentioned above). If such a scenario is required then &lt;a href="http://code.google.com/p/wcf-clear-username-binding/"&gt;ClearUsernameBinding&lt;/a&gt; needs to be used.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-400671095745378797?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-T6w8591RZG1qyLMBvGG89Zb2Cs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-T6w8591RZG1qyLMBvGG89Zb2Cs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-T6w8591RZG1qyLMBvGG89Zb2Cs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-T6w8591RZG1qyLMBvGG89Zb2Cs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/JYUgTuqQVz4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/400671095745378797/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=400671095745378797" title="73 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/400671095745378797?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/400671095745378797?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/JYUgTuqQVz4/introducing-wcf-clearusernamebinding.html" title="Introducing WCF ClearUsernameBinding" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_6DvmzgV-o20/SSg9aN6IDQI/AAAAAAAAAws/0zPlT9MiiwY/s72-c/client.PNG" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">73</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2008/11/introducing-wcf-clearusernamebinding.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUADRXs_eyp7ImA9WxJSE0k.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-4519008229562427019</id><published>2009-04-29T06:20:00.000-07:00</published><updated>2009-05-03T02:42:54.543-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-03T02:42:54.543-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web Services Interoperability" /><category scheme="http://www.blogger.com/atom/ns#" term="XML Schema" /><category scheme="http://www.blogger.com/atom/ns#" term="WSDL" /><category scheme="http://www.blogger.com/atom/ns#" term="WCF" /><title>Interoperability Gotcha: Visual Studio 2008 Proxy Flavours</title><content type="html">The following interoperability issue can happen with a .Net 3.5 clients and older web services from various platforms (including Java. and .Net)&lt;br /&gt;&lt;br /&gt;Everyone knows that Visual Studio 2008 has a build-in support for WCF which is the latest generation of Microsoft soap stack. By default, when writing web service clients in VS 2008 a WCF-flavored proxy is generated. However WCF only supports &lt;a href="http://msdn.microsoft.com/en-us/library/ms733112.aspx"&gt;a subset of XML schema&lt;/a&gt; and WSDL patterns. For example it does not support RPC/Encoded WSDLs and XML attributes. Many older WSDLs use RPC/Encoded. With such WSDLs WCF is supposed to gracefully downgrade itself to .Net 2.0 which does support these WSDLs. I have noticed that in some cases this does not happen correctly. The result can be&lt;span style="font-weight:bold;"&gt; web service methods returning null instead of values&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The solution for such cases is to manually instruct VS 2008 to use its backward compatible proxy. All you need to do is:&lt;br /&gt;&lt;br /&gt;1. Press the "Add Service Reference" as usual&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_6DvmzgV-o20/SPtGhdkP7TI/AAAAAAAAAtU/t3e_ZcaxYK4/s1600-h/add+service+reference.PNG"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_6DvmzgV-o20/SPtGhdkP7TI/AAAAAAAAAtU/t3e_ZcaxYK4/s400/add+service+reference.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5258874530571480370" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2. Press the "Advanced..." button&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_6DvmzgV-o20/SPtGhi2MW2I/AAAAAAAAAts/DhzhwbC7N0Y/s1600-h/advanced.PNG"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_6DvmzgV-o20/SPtGhi2MW2I/AAAAAAAAAts/DhzhwbC7N0Y/s400/advanced.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5258874531988921186" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3. Select "Add Web Reference..."&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_6DvmzgV-o20/SPtGhvXZb-I/AAAAAAAAAtc/LAut1JgMWFU/s1600-h/add+web+reference.PNG"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_6DvmzgV-o20/SPtGhvXZb-I/AAAAAAAAAtc/LAut1JgMWFU/s400/add+web+reference.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5258874535349415906" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;4. Use the good old .Net 2.0 proxy flavours&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_6DvmzgV-o20/SPtGhu_SwGI/AAAAAAAAAtk/J_PWnBlADw8/s1600-h/adding+web+reference.PNG"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_6DvmzgV-o20/SPtGhu_SwGI/AAAAAAAAAtk/J_PWnBlADw8/s400/adding+web+reference.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5258874535248314466" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-4519008229562427019?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ii5P-lGxTCuklg7pJRyozVwabUU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ii5P-lGxTCuklg7pJRyozVwabUU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ii5P-lGxTCuklg7pJRyozVwabUU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ii5P-lGxTCuklg7pJRyozVwabUU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/GfCuy9ge5LQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/4519008229562427019/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=4519008229562427019" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/4519008229562427019?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/4519008229562427019?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/GfCuy9ge5LQ/interoperability-gotcha-visual-studio.html" title="Interoperability Gotcha: Visual Studio 2008 Proxy Flavours" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_6DvmzgV-o20/SPtGhdkP7TI/AAAAAAAAAtU/t3e_ZcaxYK4/s72-c/add+service+reference.PNG" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2008/10/interoperability-gotcha-visual-studio.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAMQH09fSp7ImA9WxJSE0k.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-5077280278374540718</id><published>2009-04-26T01:32:00.000-07:00</published><updated>2009-05-03T02:43:01.365-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-03T02:43:01.365-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web Services Interoperability" /><category scheme="http://www.blogger.com/atom/ns#" term="X.509" /><category scheme="http://www.blogger.com/atom/ns#" term="Cryptic error messages" /><category scheme="http://www.blogger.com/atom/ns#" term="WCF" /><title>Java, WCF &amp; Web Services Interoperability (part 2 of N): Know your X.509</title><content type="html">&lt;div&gt;&lt;br /&gt;&lt;span style="font-size:small"&gt;&lt;b&gt;So, you want to write an Axis2 web service and have .Net WCF clients too? Or maybe you already have a .Net 2.0 endpoint and want it to be consumed by WSIT? Yes, that’s possible, but there is some important stuff you should know about. Whether you are a .Net WCF, AXIS2, Metro or any other framework developer/tester – you want to stay tuned for this series.&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;When a Java client sends a request to a secured WCF service sometimes this soap fault can come back:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;An error occurred when verifying security for the message&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;Insdie the &lt;a href="http://blogs.msdn.com/madhuponduru/archive/2006/05/18/601458.aspx"&gt;WCF trace&lt;/a&gt; log these errors appear:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;Message security verification failed.&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;And the inner exception is:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;Cannot read the token from the 'BinarySecurityToken' element with the 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd' namespace for BinarySecretSecurityToken, with a 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v1' ValueType. If this element is expected to be valid, ensure that security is configured to consume tokens with the name, namespace and value type specified.&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;The problem is with the X.509 certificate/key that the client is using: It is of version 1 of X.509. WCF only supports version 3 certificates. We can see that the request strictly stated it was using v1:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&amp;lt;o:BinarySecurityToken u:Id="uuid-856599a5-7c38-465c-9ae8-69b59af419b7-1" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509&lt;b&gt;v1&lt;/b&gt;" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&amp;gt;MIIBxDCCAW6gA…&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;Interestingly enough, Wcf can work with the certificate content itself so if we could change the SOAP to have “v3” instead of “v1” everything would have worked. However the straight forward way to solve this is to use X.509V3 at the client side.&lt;br /&gt;BTW We can see the certificate version by double clicking its file in windows:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_6DvmzgV-o20/SPC5mLju7-I/AAAAAAAAAqQ/5ydYmlitJbg/s1600-h/X.509V3.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_6DvmzgV-o20/SPC5mLju7-I/AAAAAAAAAqQ/5ydYmlitJbg/s320/X.509V3.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5255904830730203106" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-5077280278374540718?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-AM6COwkDix6PS1dknmawc20Jxg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-AM6COwkDix6PS1dknmawc20Jxg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-AM6COwkDix6PS1dknmawc20Jxg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-AM6COwkDix6PS1dknmawc20Jxg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/bC2pYLhOvgs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/5077280278374540718/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=5077280278374540718" title="18 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/5077280278374540718?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/5077280278374540718?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/bC2pYLhOvgs/java-wcf-web-services-interoperability_11.html" title="Java, WCF &amp; Web Services Interoperability (part 2 of N): Know your X.509" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_6DvmzgV-o20/SPC5mLju7-I/AAAAAAAAAqQ/5ydYmlitJbg/s72-c/X.509V3.JPG" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">18</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2008/10/java-wcf-web-services-interoperability_11.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAMSXozcSp7ImA9WxJSE0k.&quot;"><id>tag:blogger.com,1999:blog-1482776199578137808.post-105223906996280080</id><published>2009-04-18T04:56:00.000-07:00</published><updated>2009-05-03T02:43:08.489-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-03T02:43:08.489-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Security" /><category scheme="http://www.blogger.com/atom/ns#" term="X.509" /><category scheme="http://www.blogger.com/atom/ns#" term="WCF" /><category scheme="http://www.blogger.com/atom/ns#" term="Performance" /><title>WCF Performance: Making your service run 3 times faster</title><content type="html">A lot of people use WCF default settings on production. In many cases changing these defaults can gear up the service throughput dramatically. &lt;br /&gt;&lt;br /&gt;Let's look at the following use case:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;&lt;li&gt;WsHttpBinding is used&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Message level security is used: X.509 certificate or windows authentication, where client can also use a username/password or be anonymous&lt;/li&gt;&lt;br /&gt;&lt;li&gt;(Optional assumption) A typical client makes one service call and then disconnects&lt;/li&gt;&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;The WsHttpBinding implicit defaults can be explicitly written as bellow:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;&amp;lt;wsHttpBinding&amp;gt;&lt;br /&gt;&amp;nbsp;        &amp;lt;binding name="BadPerformanceBinding"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;   &amp;lt;security mode="Message"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;            &amp;lt;message clientCredentialType="..."&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                     negotiateServiceCredential="&lt;b&gt;true&lt;/b&gt;"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                     establishSecurityContext="&lt;b&gt;true&lt;/b&gt;" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;          &amp;lt;/security&amp;gt;&lt;br /&gt;&amp;nbsp;        &amp;lt;/binding&amp;gt;&lt;br /&gt;&amp;lt;/wsHttpBinding&amp;gt;&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;Let's simulate a load on this service by employing many virtual users who constantly call the service one time and immediately disconnect. The number of users should be large enough such that service will use its max capacity.  The results are:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;&lt;b&gt;Transactions per second:&lt;/b&gt; 15.235&lt;br /&gt;&lt;b&gt;Average time of a transaction:&lt;/b&gt; 1.4 seconds&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Note:&lt;/b&gt; I didn't use a super strong server here but as we can see below it shouldn't matter for our needs. Also a load of just a few minutes was enough to prove our theory.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_6DvmzgV-o20/SWi3ujSLL8I/AAAAAAAAA_s/Kf0NUkUttWk/s1600-h/SC+-+count.PNG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 160px;" src="http://4.bp.blogspot.com/_6DvmzgV-o20/SWi3ujSLL8I/AAAAAAAAA_s/Kf0NUkUttWk/s400/SC+-+count.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5289679772719984578" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_6DvmzgV-o20/SWi32O7NNSI/AAAAAAAAA_8/PWPt3PHhUHc/s1600-h/SC+-+time.PNG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 160px;" src="http://4.bp.blogspot.com/_6DvmzgV-o20/SWi32O7NNSI/AAAAAAAAA_8/PWPt3PHhUHc/s400/SC+-+time.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5289679904693892386" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Those are not very good results of course.&lt;br /&gt;&lt;br /&gt;Now let's tweak the configuration a little bit:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;&amp;lt;wsHttpBinding&amp;gt;&lt;br /&gt;&amp;nbsp;        &amp;lt;binding name="BetterPerformanceBinding"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;   &amp;lt;security mode="Message"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;            &amp;lt;message clientCredentialType="..."&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                     negotiateServiceCredential="&lt;b&gt;false&lt;/b&gt;"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                     establishSecurityContext="&lt;b&gt;false&lt;/b&gt;" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;          &amp;lt;/security&amp;gt;&lt;br /&gt;&amp;nbsp;        &amp;lt;/binding&amp;gt;&lt;br /&gt;&amp;lt;/wsHttpBinding&amp;gt;&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;And with the same amount of virtual users we get these results:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;&lt;b&gt;Transactions per second:&lt;/b&gt; 51.833&lt;br /&gt;&lt;b&gt;Average time of a transaction:&lt;/b&gt; 0.384 seconds&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;That's 3.5 times faster!&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_6DvmzgV-o20/SWi3uMm_eoI/AAAAAAAAA_U/_jRS9Uhqy3w/s1600-h/no+sc+-+count.PNG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 172px;" src="http://2.bp.blogspot.com/_6DvmzgV-o20/SWi3uMm_eoI/AAAAAAAAA_U/_jRS9Uhqy3w/s400/no+sc+-+count.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5289679766633282178" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_6DvmzgV-o20/SWi3uRvmbvI/AAAAAAAAA_k/A6-b8qDN-sE/s1600-h/no+SC+-+time.PNG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 160px;" src="http://2.bp.blogspot.com/_6DvmzgV-o20/SWi3uRvmbvI/AAAAAAAAA_k/A6-b8qDN-sE/s400/no+SC+-+time.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5289679768011566834" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;So, what happened here?&lt;/b&gt;&lt;br /&gt;Since the only change we did is in two settings we need to analyze each of them.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;negotiateServiceCredential&lt;/b&gt;&lt;br /&gt;This setting determines whether the clients can get the service credential (e.g. certificate) using negotiation with the service. The credentials are used in order to authenticate the service and to protect (encrypt) the messages. When this setting is set to "true" a bunch of infrastructure soap envelopes are sent on the wire before the client sends its request. When set to "false" the client needs to have the service credentials out of band. &lt;br /&gt;&lt;br /&gt;The trade off here is better performance (using "false") versus more convenience (using "true"). Setting "false" has its hassles as we now need to propagate the service credential to clients. However, performance wise, setting "negotiateServiceCredential" to "false" is always better.&lt;br /&gt;&lt;br /&gt;Take a look at how many infrastructure messages are exchanged when negotiateServiceCredential is "true":&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_6DvmzgV-o20/SWi3usHCWGI/AAAAAAAAA_0/0tQeCbyEp7Q/s1600-h/SC+-+log.PNG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 280px;" src="http://3.bp.blogspot.com/_6DvmzgV-o20/SWi3usHCWGI/AAAAAAAAA_0/0tQeCbyEp7Q/s400/SC+-+log.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5289679775089186914" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;While when not negotiating life is much brighter:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_6DvmzgV-o20/SWi3uGdkusI/AAAAAAAAA_c/ckib6nOviA4/s1600-h/no+SC+-+log.PNG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 186px;" src="http://3.bp.blogspot.com/_6DvmzgV-o20/SWi3uGdkusI/AAAAAAAAA_c/ckib6nOviA4/s400/no+SC+-+log.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5289679764983167682" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;establishSecurityContext&lt;/b&gt;&lt;br /&gt;This setting determines whether WS-SecureConversation sessions are established between the client and the server. So what is a secure conversation anyway? In a very simplified manner we can say that a normal secured web service request requires one asymmetric encryption. Respectively, normal N requests require N asymmetric encryptions. Since asymmetric encryption is very slow, setting up a secure conversation is usually a good practice: It requires a one-time asymmetric encrypted message exchange in order to set up a session; Further calls in the session use symmetric encryption which is much faster.&lt;br /&gt;&lt;br /&gt;Now remember that in our case we assume that clients call the service just one time and disconnect. If a secure session is established the message exchange will look like this:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;&lt;b&gt;Message 1:&lt;/b&gt; Setting up a secure session (asymmetric encryption)&lt;br /&gt;&lt;b&gt;Message 2:&lt;/b&gt; The actual request (symmetric encryption)&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;If we do not use secure session we have:&lt;br /&gt;&lt;br /&gt;&lt;fieldset style="background-color: #EEEEEE; font-family:courier new; font-size:100%;"&gt;&lt;br /&gt;&lt;b&gt;Message 1:&lt;/b&gt; The actual request (asymmetric encryption)&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;So it is clear that we're better off in the latter case.&lt;br /&gt;&lt;br /&gt;With secure sessions there isn't really any trade off and the decision is quite scientific: When only one client request is expected set establishSecurityContext to "false".&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;br /&gt;Wisely changing WCF defaults can yield a significant improvement in your service performance. The exact changes need to be made and their exact effect are dependent in the scenario. The example above showed how to speed up a certain service 3 times faster.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1482776199578137808-105223906996280080?l=webservices20.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/yqxrA202eYUtwlbeFMI8vQOxRc0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yqxrA202eYUtwlbeFMI8vQOxRc0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/yqxrA202eYUtwlbeFMI8vQOxRc0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yqxrA202eYUtwlbeFMI8vQOxRc0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebServices20/~4/tfofeLQ6uFM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://webservices20.blogspot.com/feeds/105223906996280080/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=1482776199578137808&amp;postID=105223906996280080" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/105223906996280080?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1482776199578137808/posts/default/105223906996280080?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebServices20/~3/tfofeLQ6uFM/wcf-performance-gearing-up-your-service.html" title="WCF Performance: Making your service run 3 times faster" /><author><name>Yaron Naveh</name><uri>http://www.blogger.com/profile/11793800386245798442</uri><email>yaronn01@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="03441832839378384762" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_6DvmzgV-o20/SWi3ujSLL8I/AAAAAAAAA_s/Kf0NUkUttWk/s72-c/SC+-+count.PNG" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://webservices20.blogspot.com/2009/01/wcf-performance-gearing-up-your-service.html</feedburner:origLink></entry></feed>
