title: Consuming .NET webservice in Java
body: <p>Previoysly I wrote a C# client to consume a conventional web service, which accepts an object of an OrderInfo class as a parameter. OrderInfo class has CustomerID and SpecialInstructions fields and a List. Product has ProductID, Quantity and optional PriceOverride.</p>
  
  <p>It was very simple to create those and pass to WS in C# as in the below sample:</p>
  
  <pre><code>OrderEntryService s = new OrderEntryService();
  
  OrderInfo o = new OrderInfo();
  
  o.CustomerId = 1;
  o.Items.Add(new ProductInfo(2, 4));
  o.Items.Add(new ProductInfo(1, 2, 3.95m));
  
  checkBox1.Checked = s.CreateOrder(o);
  </code></pre>
  
  <p>Now in Java I only have access to the get and set methods and it is a bit confusing, as I can only obtain an ArrayOfProductInfo by calling o.getItems() instead of being able to add ProductInfo directly to a list in OrderInfo. How can I add products to the order in Java?</p>
  
  <p>Thank you!</p>