// default namespace is http://tempuri.org
// default name is interface name
[ServiceContract(Namespace = "http://myNamespace", Name = "MyContract")]
interface IMyContract
{
// default name is method name
[OperationContract(Name = "MyOperation")]
string MyMethod(string text);
// Will not be part of the contract
string MyOtherMethod(string text);
}
class MyService : IMyContract
{
public string MyMethod(string text)
{
return "Hello " + text;
}
public string MyOtherMethod(string text)
{
return "Cannot call this method over WCF";
}
}