title: WCF will not return an int
body: <p>I am building a WCF in C#, and a client to consume it at the same time. For some reason I am having trouble getting a method to return an int. Here is my contract:</p>
  
  <pre><code>[ServiceContract]
  public interface IMData
  {
    [OperationContract]
    int ReturnAnInt();
  
    [OperationContract]
    String HelloWorld();
  }
  </code></pre>
  
  <p>Here is where I have implemented it:</p>
  
  <pre><code>public class MData : IMData
  {
    public String HelloWorld()
    {
      return "Hello World";
    }
  
    public int ReturnAnInt()
    {
      return 5;
    }
  }
  </code></pre>
  
  <p>I'm using Visual Studio, and for the client, I imported this WCF as a Web Reference. Now for some reason when I declare an instance of MData and try to call HelloWorld, there is no problem, but I get a compile error when calling ReturnAnInt.</p>
  
  <pre><code>MData m = new MData();
  String helloWorld = m.HelloWorld();
  int result = m.ReturnAnInt();
  </code></pre>
  
  <p>The error I get with ReturnAnInt is:
  "No overload for method 'ReturnAnInt' takes 0 arguments"
  So then I mouse over to see what Visual Studio is expecting, and it says that the method should look like:</p>
  
  <pre><code>void MData.ReturnAnInt(out int ReturnAnIntResult, out bool ReturnAnIntResultSpecified)
  </code></pre>
  
  <p>I have been banging my head against a wall over this for hours now and can find nothing on Google, and it has my coworkers baffled as well. Why did it add two out parameters that aren't in the definition, and change the return type? Any help would be greatly appreciated. I apologize if I left out any information that would be helpful.</p>