-1

So I have a web service published at location "http://localhost:8080/impl1?wsdl". I created a web application using servlets, and I want to call a method from the web service. This is how my web service class is:

package controller;

import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService(endpointInterface = "controller.Hello")
public class Hello
{
    @WebMethod
    public String abc()
    {
        return "Hello";
    }
}

I want to call this method from the service in a servlet like hello.abc(), in order to get the result. Is there any method?

1 Answers1

0

You have to build a proxy of the Web Service. That will allow you to call its methods from a client. There are many tools that take the wsdl as an input and create a proxy as an output.

Take a look at this question: Generating Web Service from WSDL File

Andres
  • 10,561
  • 4
  • 45
  • 63