Hi all,
I have created a Client-Server using Web Services.
A method in the server (in the same package that Web Service Server) return an ArrayList<AP> where AP is the next class:
package Servidor;
import java.io.Serializable;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
@WebService()
public class AP implements Serializable{
private static final long serialVersionUID = 1L;
float lat, longitud ;
String idDispositivo = "" ;
public AP(){}
... ... ...
}
, this class implements gets & sets methods for all attributes.
The Web Service called ServerImpl.java implements the method who use the "AP" class:
@WebMethod
public ArrayList<AP> obtenAPs(@WebParam(name = "user") String user){
...
}
When I call the method in the Client appears a compilation error:
Server.ServerImplService service = new servidor.ServerImplService();
Server.ServerImpl port = servicio.getServerImplPort();
List<AP> accessPoints = vc.port.obtenAPs(user); <-- , appears here the compilation error
"found: java.util.List<Server.Ap>
required: java.util.List<Client.AP>"
In the Client package stays the same class (with the same methods and attributes) but it isn't a Web Service.
Thanks a lot.
................................................
4th January:
Hi,
I organized the packages in Client & Server and I created a same package (and class) in the two project called AccessPoint with his class AP.java:
Project Client --> AccessPoint\AP.java
--> Client\*.java --> All class typical of the client
Project Server --> AccessPoint\AP.java
--> Server\*.java --> All class typical of the server
I have to say your that in Netbeans I saw that in the directory web\classes of the Client appeared a package of Server and in this package included the AP classes!!! (Project Client --> \web\classes\Server\ ??? <--- Here it generated call to AP and it named Server.AP?!?!?!? Why!?!? I thought that it would use the "universal package" AccessPoint!
So that I think the compilation error was for this. But ... what is the solution for these? how do I return of the Server to the Client an ArrayList<AP> without compilation error? without execution error ?
Thanks.