<p>I'm just getting into creating some WCF services, but I have a requirement to make them backward compatible for legacy (.NET 1.1 and 2.0) client applications.  </p>

<p>I've managed to get the services to run correctly for 3.0 and greater clients, but when I publish the services using a basicHttpBinding endpoint (which I believe is required for the compatibility I need), the service refactors my method signatures.  e.g.</p>

<pre><code>public bool MethodToReturnTrue(string seedValue);
</code></pre>

<p>appears to the client apps as</p>

<pre><code>public void MethodToReturnTrue(string seedValue, out bool result, out bool MethodToReturnTrueResultSpecified);
</code></pre>

<p>I've tried every configuration parameter I can think of in the app.config for my self-hosting console app, but I can't seem to make this function as expected.  I suppose this might lead to the fact that my expectations are flawed, but I'd be surprised that a WCF service is incapable of handling a bool return type to a down-level client.</p>

<p>My current app.config looks like this.</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;configuration&gt;  
  &lt;system.serviceModel&gt;
    &lt;services&gt;
      &lt;service behaviorConfiguration="MyServiceTypeBehaviors" Name="MyCompany.Services.CentreService.CentreService"&gt;
        &lt;clear /&gt;
        &lt;endpoint address="http://localhost:8080/CSMEX"    binding="basicHttpBinding" bindingConfiguration="" contract="IMetadataExchange" /&gt;
        &lt;endpoint address="http://localhost:8080/CentreService" binding="basicHttpBinding" bindingName="Compatible" name="basicEndpoint" contract="MyCompany.Services.CentreService.ICentreService" /&gt;
      &lt;/service&gt;
    &lt;/services&gt;
    &lt;behaviors&gt;
      &lt;serviceBehaviors&gt;
        &lt;behavior name="MyServiceTypeBehaviors" &gt;
            &lt;serviceMetadata httpGetEnabled="true" /&gt;
        &lt;/behavior&gt;
      &lt;/serviceBehaviors&gt;
    &lt;/behaviors&gt;
  &lt;/system.serviceModel&gt;
&lt;/configuration&gt;
</code></pre>

<p>Can anyone advise, please?</p>

[{'answer_id': 6997, 'author': 'Esteban Araya', 'author_id': 781, 'author_profile': 'https://Stackoverflow.com/users/781', 'pm_score': 2, 'selected': False, 'text': '<p>Ah, this is killing me! I did this at work about 3 months ago, and now I can\'t remember all the details.</p>\n\n<p>I do remember, however, that you need basicHttpBinding, and you can\'t use the new serializer (which is the default); you have to use the "old" XmlSerializer.</p>\n\n<p>Unfortunately, I don\'t work at the place where I did this anymore, so I can\'t go look at the code. I\'ll call my boss and see what I can dig up.</p>\n'}, {'answer_id': 15966, 'author': 'ZombieSheep', 'author_id': 377, 'author_profile': 'https://Stackoverflow.com/users/377', 'pm_score': 3, 'selected': True, 'text': '<p>OK, we needed to resolve this issue in the short term, and so we came up with the idea of a "interop", or compatibility layer.</p>\n\n<p>Baiscally, all we did was added a traditional ASMX web service to the project, and called the WCF service from that using native WCF calls.  We were then able to return the appropriate types back to the client applications without a significant amount of re-factoring work.  I know it was a hacky solution, but it was the best option we had with such a large legacy code-base.  And the added bonus is that it actually works surprisingly well. :)</p>\n'}, {'answer_id': 3810639, 'author': 'Christian Hayter', 'author_id': 115413, 'author_profile': 'https://Stackoverflow.com/users/115413', 'pm_score': 0, 'selected': False, 'text': '<p>You do have to use the XmlSerializer. For example:</p>\n\n<pre><code>[ServiceContract(Namespace="CentreServiceNamespace")]\n[XmlSerializerFormat(Style=OperationFormatStyle.Document, SupportFaults=true, Use=OperationFormatUse.Literal)]\npublic interface ICentreService {\n    [OperationContract(Action="CentreServiceNamespace/MethodToReturnTrue")]\n    bool MethodToReturnTrue(string seedValue);\n}\n</code></pre>\n\n<p>You have to manually set the operation action name because the auto-generated WCF name is constructed differently from the ASMX action name (WCF includes the interface name as well, ASMX does not).</p>\n\n<p>Any data contracts you use should be decorated with <code>[XmlType]</code> rather than <code>[DataContract]</code>.</p>\n\n<p>Your config file should not need to change.</p>\n'}]
['https://Stackoverflow.com/questions/5863', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/377/']