I have an asmx webservice in C# where the webmethod GetKeys()
returns a List<List<string>>
however when I consume the webmethod in my java client through my proxy GetKeys()
is of the type Object[]
. Because of this I cannot figure out a way to access the strings. Ideally I would like to parse the C# List<List<string>>
to an ArrayList<String[]> but I am open to easier solutions. I need to display the contents in a JTable.
Any help with this or tips on how I could solve this another way would be much appreciated.
Here are the relevant methods:
public class ProgAss5WebService : System.Web.Services.WebService
{
[WebMethod]
public List<List<string>> GetKeys()
{
return dal.GetKeysList();
}
} //End of C# WebService class
public class Controller { //Java client
public void getKeys() {
ArrayList<String[]> rowList = new ArrayList<String[]>();
try {
//This works
Object[] myArr = proxy.getKeys();
//This does not
rowList = proxy.getKeys();
}catch(RemoteException e) {
e.printStackTrace();
}
}
}//End of Controller class
I am still learning the proper way of SO so please tell me if more information is needed and correct any mistakes in my question. Thank you!