Results 1 to 1 of 1

Thread: REST WCF , how to consume it and return object types

Threaded View

  1. #1

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    REST WCF , how to consume it and return object types

    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; }
        
        }
    Last edited by Pirate; Mar 3rd, 2015 at 01:34 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width