Whaly's World tail -f /var/log/whaly

10Mar/100

Error 415 and WCF Compatibility between .Net 2.0 and 3.5

If you try to call a 3.5 WCF Service with the framework 2.0 and WCF 3.0, you will have an error 415 :

Cannot process the message because the content type 'text/xml; charset=utf-8' was not the expected type 'application/soap+xml; charset=utf-8'

'text/xml' is the content type for SOAP 1.1 while 'application/soap+xml' is the content type for SOAP 1.2 and your client WCF 3.0 use SOAP 1.1 while the service with WCF 3.5 use SOAP 1.2.

Here is the solution that worked for me. If you have access to the service config, you just have to change the binding to use SOAP 1.1 :

Add a new custom binding in the 'bindings' section

      <customBinding>
        <binding name="Soap11HttpBinding">
          <textMessageEncoding messageVersion="Soap11" />
          <httpTransport />
        </binding>
      </customBinding>

and don't forget to update your endpoint with the new binding :

    <endpoint ...
        binding="customBinding"
        bindingConfiguration="Soap11HttpBinding">
        ...
    </endpoint>

24Sep/090

WWW or NO-WWW ?

For my new domain "frederichusson.com" I used links without "www." like "http://frederichusson.com" mainly because I like when things are simple.

Then I realized that maybe it was a mistake and maybe a "www." site can get a better ranking in search engine.
Then I searched on this subject and came accross "www. is deprecated" and a little after on an article at sitepoint.com

And so I decided to stay without "www." and to take some actions :

  1. Keep my current link without the www.
  2. Add a .htaccess file to redirect (301) visitors from http://www.frederichusson.com to http://frederichusson.com (for help look at "How can I become Class B?")
  3. Use the Google Webmasters Tools to configure my favorite domain.