samedi 23 mars 2019

Why my webservice, created with the eclipse wizard, does not work if the service class implements an interface?

I'm new in java language and I try to use Web Service. I create Dynamic Web Project with Eclipse and I create a simple service class:

public ServiceImpl{
    public String sayHello(){
        return "Ciao!";
    }
}

Then, I create web service using Eclipse Wizard (new webservice-> CXF2 etc...). The problem is that when I use this class, the web service works and in the server is loaded the wsld file that I can use for my web Service client. If I use this, instead :

public ServiceImpl implements Service{

    public String sayHello(){

        return "Ciao!";

    }

}

where Service is

Interface Service{

String sayHello();

}

the eclipse wizard create wsld file, but the server can't load the service...

I try with different solution (I used Annotation too) but I can't do work it.

Is there One tha can help me?

Thanks so much.




Aucun commentaire:

Enregistrer un commentaire