Not all parameters in WCF data contract make it through the web service call

kakaka

New Member
While creating a WCF Rest service, I've noticed that not all the parameters in my web service are making it into my implementation.Here's the interface:\[code\][ServiceContract(Namespace="http://example.com/recordservice")]public interface IBosleySchedulingServiceImpl{ [OperationContract] [WebInvoke(UriTemplate = "Record/Create", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Bare, Method = "POST")] string CreateRecord(Record record);}[DataContract(Namespace="http://example.com/recordservice")]public class Appointment{ [DataMember] public int ResponseType { get; set; } [DataMember] public int ServiceType { get; set; } [DataMember] public string ContactId { get; set; } [DataMember] public string Location { get; set; } [DataMember] public string Time { get; set; } }\[/code\]I'm passing this XML in:\[code\]<Appointment xmlns="http://ngs.bosley.com/BosleySchedulingService"> <ContactId>1123-123</ContactId> <Location>Fresno</Location> <Time>2012-05-05T08:30:00</Time> <ResponseType>45</ResponseType> <ServiceType>45</ServiceType></Appointment>\[/code\]In my service, I'm just outputting the values to a log so I can verify the values are coming through for the time being:\[code\]logger.Debug("ContactId: " + appointment.ContactId);logger.Debug("Time Field: " + appointment.Time);logger.Debug("Location: " + appointment.Location);logger.Debug("Response Type: " + Convert.ToInt32(appointment.ResponseType));logger.Debug("ServiceType: " + Convert.ToInt32(appointment.ServiceType));\[/code\]However, in my output, the integer values are coming across as zeroes:\[code\]ContactId: 1123-123Time Field: 2012-05-05T08:30:00Location: FresnoResponse Type: 0ServiceType: 0\[/code\]When I remove the strings from the DataContract and the service implementation, the integer values come through without a problem. \[code\]Response Type: 45ServiceType: 45\[/code\]I am utterly confused by this and any help would be greatly appreciated.
 
Back
Top