package javax.jws does not exist

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

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

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like