I have created a rest service and it is working perfectly with my get operation, but i am trying to implement a POST, but when the xml data reaches the service it looks like this (missing half the objects and priority changes to 0 instead of 8888) :
="1.0"="utf-8"
<DVBAlertDetails xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SessionID>9999</SessionID>
<Priority>0</Priority>
</DVBAlertDetails>
and the class just has the dvbtriple and error as null
my code is as follows :
Call :
[OperationContract]
[WebInvoke(Method = "POST",
ResponseFormat = WebMessageFormat.Xml,
RequestFormat = WebMessageFormat.Xml,
BodyStyle = WebMessageBodyStyle.Bare,
UriTemplate = "DVBAlert")]
DVBAlertResponse DVBAlert(DVBAlertDetails AlertDetails);
Classes :
[DataContract(Namespace = "")]
public class DVBTriple
{
[DataMember]
public int NetworkId { get; set; }
[DataMember]
public int ServiceId { get; set; }
[DataMember]
public int TransponderId { get; set; }
}
[DataContract(Namespace = "")]
public class Error
{
[DataMember]
public string ErrorType { get; set; }
[DataMember]
public string ErrorDescription { get; set; }
}
[DataContract(Namespace = "")]
public class DVBAlertDetails
{
[DataMember]
public int SessionID { get; set; }
[DataMember]
public DVBTriple DVBTriple { get; set; }
[DataMember]
public int Priority { get; set; }
[DataMember]
public List<Error> Errors { get; set; }
}
XMl Being posted :
<DVBAlertDetails xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SessionID>9999</SessionID>
<DVBTriple>
<NetworkId>3</NetworkId>
<ServiceId>4</ServiceId>
<TransponderId>5</TransponderId>
</DVBTriple>
<Priority>8888</Priority>
<Errors>
<Error>
<ErrorType>Type</ErrorType>
<ErrorDescription>Descr</ErrorDescription>
</Error>
</Errors>
</DVBAlertDetails>
Any help would be apreciated