I will need to be able to receive this xml data from a Java WebService and I am not really sure what to expose in my WebMethod so I can consume it? It is just a basic order and items. In .Net I would just have passed an order object List.
I should expand a bit further. It is an Oracle BPEL process that will need to map to this exposed C# WebService. I would need to expose the OrderNumber, ItemNumber ,etc (as shown in XML). The issue I am having is that I would have 1 to Many items ,etc so I can’t just expose the basic items (string, int).
Probably pretty trivial for most the community here…just not sure how to do it? Any suggestions greatly appreciated.
I could do something like (build an order object and it appears to show the xml as I would expect?)
[WebMethod]
public static List<Orders> GetOrders(List<Orders> ordersList)
{
List<Orders oList = ordersList;
return oList;
}
XML:
<Order>
<OrderNumber>12345</OrderNumber>
<OrderDate>01/25/2010</OrderDate>
<OrderSource>Affiliate123</OrderSource>
<Items>
<ItemNumber>123478</ItemNumber>
<Qty>5</Qty>
<UOM>EA</UOM>
<Description>Test Item</Description>
</Items>
</Order>
You have answered your own question. The .NET web services framework will map a return type of
List<T>to a sequence ofTat the SOAP level, just as if you had used aT[](array ofT).When I write up a quick sample service just like yours, this is the XML it returns:
Your BPEL layer should be able to consume that pretty easily.