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:
You import it as a Service Reference (with name space MData) instead Web Reference.
And use the below code,
MDataClient m = new MDataClient();
String helloWorld = m.HelloWorld();
int result = m.ReturnAnInt();
There is nothing wrong in your code. It should works fine if you add Service Reference and use the above snippet.