Error running Java Webservice

Asked

Viewed 341 times

0

I’m trying to run a Web Service SOAP by the server GlassFish Server 4.1.1 in the NetBeans 8.2. When trying to execute the following error is returned:

Methods of Web Service:

@WebService(serviceName = "CalculatorWS")
@Stateless()
public class CalculatorWS {

    @WebMethod(operationName = "hello")
    public String hello(@WebParam(name = "name") String txt) {
        return "Hello " + txt + " !";
    }

    @WebMethod(operationName = "add")
    public int add(@WebParam(name = "i") int i, @WebParam(name = "j") int j) {
        return i + j;
    }
}

I run the Web Service as follows:

inserir a descrição da imagem aqui

But the following error is returned:

inserir a descrição da imagem aqui

What to do ?

  • Check that the service has been deployed correctly, and that the server is running.

  • The server is started

  • Webresponde when Voce types http://localhost:8080 in the browser? And what happens if you type http://localhost:8080/Calculatorws/Calculatorws? Tester?

  • localhost:8080 in browser returns "Your server is now running".

  • if I type http://localhost:8080/Calculatorws/Calculatorws? Tester gives HTTP 404 - Not Found

  • Edit your question and post the entry of the Calculatorws page where the page receives the parameters.

  • post the method you say ?

Show 2 more comments

1 answer

0


Solved.

I had to Deploy the Web Service. I did it this way:

I right-clicked on the Project and clicked on Deploy, as follows the image:

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.