Search code examples
c#xmlsoapwebservice-client

C# - SOAP XML TAGS with decimal data values disappearing during POST


Im having challenges posting a soap msg specifically using C#, but I tested the same with Java and its working fine.

The challenge is my xml request is dropping all tags that have decimal data, eg amount , etc hence am getting Mandatory field missing exception.

When I try with java this is how im assigning the values to the decimal type xml elements : body.setTXNAMT(new BigDecimal(10));

In C# then I do this : body.TXNAMT = new decimal(10.00);

But then the C# client will drop this tag from the xml.

I have traced the request using WireShark only to realise that the xml has missing tags.

Kindly assist


Solution

  • It has happened to me too, then I discovered the existence of a bool field that indicated or not the presence of the deciamal field. Once the latter has been set to true, I have seen the decimal field appear in the xml.