dimanche 11 octobre 2015

Call this post method using RestSharp

I have WCF Rest service , and I have below method with data contract class . I need to call this post method from my client application but I don't know how !

[OperationContract(Name = "PostSampleMethod")] 
[WebInvoke(Method = "POST", UriTemplate = "PostSampleMethod/New")]
string PostEmployee(Employee data);


[DataContract]
[XmlRoot(ElementName = "Employee")]
public class Employee
{
    [DataMember]
    public int EmployeeId { get; set; }

    [DataMember]
    public string Name { get; set; }    
}

I'm using C# to call this method .

Thanks a lot .




Aucun commentaire:

Enregistrer un commentaire