hello guys how r u ?
my question is that, i am creating the wcf application, in that application i am using property instead of methods in the IService interface so i am using [OperationContract] as signature for property so there is an error comes "[OperationContract] is only use for methods" so what would be the signature for property ???
Reply Soon
thanks.
Loading

Hemant KumarRank #1,202 · 1.5K reputationPosted Oct 19, 2011, 10:58 PM EDT
You need to give the Signature of a Property in WCF like this
I would recommend you to refer this link for begginers which are excellent for freshers.
http://www.codeproject.com/KB/WCF/first_WCF_Service.aspx
http://wcftutorial.net/
Faisal AnsariRank #3,366 · 427 reputationPosted Oct 19, 2011, 11:09 PM EDT
IService1.cs
-------------
[ServiceContract]
public interface IService1
{
[OperationContract]
string Name { get; set; }
}
Service1.svc.cs
---------------
public class Service1 : IService1
{
public string name;
public string Name
{
get
{
return name;
}
set
{
name = value;
}
}
}
i am doing like this ... but same error occuring
VulpesRank #55 · 29.2K reputationPosted Oct 20, 2011, 12:46 AM EDT
Faisal AnsariRank #3,366 · 427 reputationPosted Oct 20, 2011, 2:53 AM EDT
it means that, there is no any usage of property in wcf application right ?
VulpesRank #55 · 29.2K reputationPosted Oct 20, 2011, 3:02 AM EDT
Fortunately, properties are just methods 'under the hood' anyway so it's not difficult to work around this apparent limitation.
VulpesRank #55 · 29.2K reputationPosted Oct 20, 2011, 5:44 AM EDT