In my C# program, I would like to consume the Java Web Service Method which replies the java.Util.ArrayList. I don't know how to convert the Java ArrayList to C# ArrayList.
This is Java Codes
@WebMethod
@WebResult(name = "GetLastMessages")
@SuppressWarnings("unchecked")
public ArrayList<Message> getLastMessages(@WebParam(name = "MessageCount")int count) {
....
....
return messages;
}
This is C# Codes
MessagesService.MessagesService service = new MessagesService.MessagesService();
System.Collections.ArrayList arr = (System.Collections.ArrayList)service.getLastMessages(10);
I got the following Error in C#
Cannot convert type 'WindowsFormsApplication1.MessagesService.arrayList' to 'System.Collections.ArrayList'
How can I cast these Java ArrayList to C# ArrayList