How to run Web Service?
I have created following small web service (see below). I want to deploy it to JBoss Server but a WAR file is not created.
ERROR:
failed to parse runtime descriptor: runtime modeler error: Wrapper class example.jaxws.jaxws.GetRate is not found. Have you run APT to generate them?
com.sun.xml.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class example.jaxws.jaxws.GetRate is not found. Have you run APT to generate them?
-
By the way, what to put in web.xml and what to put in the sun..xml file? Should we not touch the web.xml? I cannot find any documentation / tutorial describing creating a web service in IntelliJ.
-
package example.jaxws;
import java.util.HashMap;
import javax.jws.*;
@WebService
public class SalesTax {
private HashMap tax;
public SalesTax() {
init();
}
public void init() {
tax = new HashMap();
tax.put("CA", 7.75);
tax.put("NH", 0.0);
}
@WebMethod
public double getRate(String state) {
Double rate = tax.get(state);
if (rate == null) rate = -1.0;
return rate;
}
}
Web.XML:
com.sun.xml.ws.transport.http.servlet.WSServletContextListener
JAX-WS endpoint
WSServlet
WSServlet
com.sun.xml.ws.transport.http.servlet.WSServlet
1
WSServlet
/services/*
sun-jaxws.xml:
]]>
Please sign in to leave a comment.