6

I am trying to implement soap web service by using Java. It is showing package javax.jws does not exist. I have added the path to jdk also. I am new to Java, please help me.

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
@WebService
@SOAPBinding(style=SOAPBinding.Style.RPC)
public class Hello {
    public String sayHello(String name) {
        return "Hello " + name;
    }
}

1 Answer 1

9

Please read the java 9 migration guide. Or see Replacements for deprecated JPMS modules with Java EE APIs.

Short version: use the reference implementation of JAX-WS.

<dependency>
  <groupId>com.sun.xml.ws</groupId>
  <artifactId>jaxws-ri</artifactId>
  <version>2.3.0</version>
  <type>pom</type>
</dependency>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.