I’m having trouble using properties in a WCF service. I can define a property in the interface as:
[ServiceContract(Namespace = "http://some-url.com/")]
interface ISomeInterface
{
[OperationContract]
int SomeMethod(string someArg);
int SomeProperty
{
[OperationContract]
get;
}
}
But when consumed by a client, the property’s underlying method get_SomeProperty() is exposed, rather than as a getter property. Is there a way to tell the client to see it as a property? (Or must I just abandon the use of properties in service contracts?)
In WCF, all you can do is send messages between client and server.
The client never has direct rpc-style access to the server object – therefore, you cannot surface properties or anything like that.
All you can do is serialize messages and send them to a method with the
[OperationContract]on them. This cannot be applied to setter methods of properties, I believe.Marc