I rengo a case with a WCF that does not allow me to receive the data correctly when consuming it from an external tool, example (SOAP UI), I have the following DataContract
:
[DataContract]
public class Ticket
{
[DataMember]
public int TicketId { get; set; }
[DataMember]
public int TableNumber { get; set; }
[DataMember]
public int ServerId { get; set; }
[DataMember]
public DateTime Timestamp { get; set; }
}
This is my Contract:
[OperationContract]
[WebInvoke(BodyStyle = WebMessageBodyStyle.Wrapped)]
Task<int> ExecuteATransfer(Ticket TransferRequest);
When consuming the WCF from the SOAP UI this is the initial structure:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:wcf="http://schemas.datacontract.org/2004/07/wcfPCBApp">
<soapenv:Header/>
<soapenv:Body>
<tem:ExecuteATransfer>
<tem:TransferRequest>
<wcf:ServerId>100</wcf:ServerId>
<wcf:TableNumber>205</wcf:TableNumber>
<wcf:TicketId>5894</wcf:TicketId>
<wcf:Timestamp>2016-08-25</wcf:Timestamp>
</tem:TransferRequest>
</tem:ExecuteATransfer>
</soapenv:Body>
</soapenv:Envelope>
But if you invert one of the fields in the XML structure from the SopaUI such as the DataMenber ServerId with TableNumber:
When the consumption or request is made, the ServerId field arrives empty even though the SOAP UI is assigned a specific Value:
It is possible to appreciate that the value reaches 0 when it should be 100.