Hello I have a school project where we created webmethods using web service with an ordinary .asmx
file.
The programs I made in .Net C# have no problem with the return being a List<Project>
.
However, I try to get the Java to work, and I tried Object[][] = wws.SelectAllProject()
and so forth.
Here's the webmethod:
[WebMethod]//Ska vara collection
public List<Project> SelectAllProjects()
{
Controller contr = new Controller();
List<Project> project = contr.SelectAllProjects();
return project;
}
Here's the Project.cs file:
public class Project
{
public string pId { get; set; }
public string pName { get; set; }
public string pDescript { get; set; }
public Project()
{
this.pId = pId;
this.pName = pName;
this.pDescript = pDescript;
}
}
So in Java how shall I call the method? I can call my other methods that are void which are ADD/Remove project...
public void SelectAllProjects () {
WebService webService = new WebService();
wws = webService.getWebServiceSoap12();
//Anropar webservice och får en Collection av Project
String[] columnNames = {"Project ID:", "Project Name:", "Project Description:"};
Object[][] = wws.selectAllProjects();
//Array[]test = wws.selectAllProjects();
}
Now I want to return something from this method (it should not be void) that which I can use to fill out a JTable in my view class (using MVC). The webmethod you see and returns a list of project. How shall I make this in Java? Tried googling, but I don't seem to find anything that is close to my project.
Thanks.