This week's book giveaway is in the Cloud forum.
We're giving away four copies of The Business Blockchain and have William Mougayar on-line!
See this thread for details.
Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem using JAX-WS in Netbeans

pakkk jijiji
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.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 implements the method who use the "AP" class:

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:


I organized the packages in Client & Server and I created a same package (and class) in the two project called AccessPoint with his class

Project Client --> AccessPoint\
--> Client\*.java --> All class typical of the client

Project Server --> AccessPoint\
--> 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 ?

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic