Quantcast
Channel: VBForums - WPF, WCF, WF
Viewing all articles
Browse latest Browse all 256

REST WCF , how to consume it and return object types

$
0
0
hi

I have my service contract below and implementation in other calls . Anyways , in the browser it's working find but when I try it in Windows Application it errors out . How can i use XML deserializer to get result out of both methods .

Code:


 [ServiceContract]
    public interface ISer
    {

        [OperationContract(Name = "SayHi")]
        [WebInvoke(Method = "GET", UriTemplate = "SayHi/{Name}")]
        string SayHi(string Name);



        [WebGet(BodyStyle = WebMessageBodyStyle.Wrapped,UriTemplate="/getEmployee")]
        Employee getEmployee();
    }



    [DataContract]
    public class Employee
    {
        [DataMember]
        public int EmployeeId { get; set; }


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


Viewing all articles
Browse latest Browse all 256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>