I'm trying to call a web service, and hitting a road block.
Here's a snippet in which I call the said web service in a console application to test (this works):
WSProxy.CancelOrderClient x = new CancelOrderClient();
WSProxy.OrderCancelObject y = new OrderCancelObject();
var z = new List<OrderNumberObject>();
var p = new OrderNumberObject();
p.OrderNumber = "100";
z.Add(p);
y.OrderNumberTbl = z.ToArray();
y.StoreNumber = "700";
var a = x.CancelOrder(y);
Console.WriteLine(a.ExResultMessage.Message);
Console.WriteLine(a.ExResultMessage.Code);
Console.ReadLine();
I want to put this in a separate static method to which the inputs are a List<string> for order numbers and a string for StoreNumber.
Each OrderNumberObject has just one string property, which is the OrderNumber which is of type string.
Given this context, I don't know how to convert/cast the List<string> to a List<OrderNumberObject>, where OrderNumberObject has a property called OrderNumber.
How do we do that? Unfortunately I have no freedom to modify the said web service I'm trying to call.
Hopefully that explained what I'm trying to do. Thank you.