11
What you are looking for is DataContract attribute. See also: MSDN Using Data Contracts.
A data contract is a formal agreement between a service and a client that abstractly describes the data to be exchanged. That is, to communicate, the client and the service do not have to share the same types, only the same data contracts. A data contract precisely defines, for each parameter or return type, what data is serialized (turned into XML) to be exchanged.
Your service contract:
[ServiceContract]
public interface IApplicationRegistration
{
// Sends the application information
[OperationContract]
bool RegisterApplication(AppInfo appInfo);
}
The data to exchange:
[DataContract]
public class AppInfo
{
private int _processID;
private string _processName;
[DataMember]
public int ProcessID
{
get { return _processID; }
set { _processID = value; }
}
[DataMember]
public string ProcessName
{
get { return _processName; }
set { _processName= value; }
}
}