I am writing a simple C# SOAP client to send an API request but I am receiving a NullPointerException when trying to send a value which looks like it is on a different 'level' of the API request.
I have written the following code to create an instance of the API request:
CreateOrderRequest createOrder = new CreateOrderRequest();
When using SOAP UI ,the XML request contains the following extract:
<data:ProductCode>RX888</data:ProductCode>
<data:Orders>
<!--Zero or more repetitions:-->
<data:OrderLine>
<!--Optional:-->
<data:OrderAmount>157.65</data:OrderAmount>
<data:OrderRef>test</data:OrderRef>
</data:OrderLine>
</data:Orders>
In my code, I can specify a value to use for the product code by writing the following:
createOrder.ProductCode = "RX888";
When I try to specify a value for the OrderAmount I get a nullpointer exception if I do `createOrder.OrderAmount = "5.99";
I get the same if I try to specify a value for the OrderRef too.
Can anybody help me to get this to work please?!