title: Why does WCF generated proxy wrap contract interface methods with new methods with different signatures?
body: <p>I'm subcsribing to the SQL Server 2008 SSRS web service ( .../reportserver/ReportService2005.asmx?wsdl) using WCF, with default WCF config options as far as I can tell.</p>
  
  <p>It does something weird when it generates the local proxy classes though.</p>
  
  <p>I'll use the ListChildren method as an example:</p>
  
  <p>On the client side, WCF generates an interface like this, as you would expect:</p>
  
  <pre><code>public interface ReportingService2005Soap {
  
      ListChildrenResponse ListChildren(ListChildrenRequest request);
  
  }
  </code></pre>
  
  <p>It also generates a 'client' proxy that implements that interface:</p>
  
  <pre><code>public partial class ReportingService2005SoapClient :
      System.ServiceModel.ClientBase&lt;ReportingService2005Soap&gt;, ReportingService2005Soap 
  {
  
      [EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
      ListChildrenResponse ReportingService2005Soap.ListChildren(ListChildrenRequest request) 
      {
          return base.Channel.ListChildren(request);
      }
  
      public ServerInfoHeader ListChildren(string Item, bool Recursive, out CatalogItem[] CatalogItems) {
          ListChildrenRequest inValue = new ListChildrenRequest();
          inValue.Item = Item;
          inValue.Recursive = Recursive;
          ListChildrenResponse retVal = ((ReportingService2005Soap)(this)).ListChildren(inValue);
          CatalogItems = retVal.CatalogItems;
          return retVal.ServerInfoHeader;
      }
  
  }
  </code></pre>
  
  <p>As you can see, the client proxy implements the interface and then 'hides' it from being used by explicitly implementing the interface (so you have to cast to get to the interface method) and additionally with a EditorBrowsableState.Advanced attribute.</p>
  
  <p>It then adds an extra wrapper method that uses 'out' parameters.</p>
  
  <p>Is there a way to stop if from doing that, and just have it implement the interface directly?</p>
  
  <p>What its doing here leads you down the path of using the wrapper methods with 'out' parameters, and then you find you can't mock the service very easily because the wrapper methods aren't virtual, and aren't defined in any interface.</p>
  
  <p>NB: I'm using the SSRS web service as an example here but I've seen WCF do this on other services as well.</p>