Hello!
I'm new in the worl of web services. I want to try the simple web service example, but don't work:
package example;
import javax.jws.WebService;
import javax.jws.WebService;
import javax.xml.ws.Endpoint;
@WebService
public class Calculator {
@WebMethod
public int add(int a, int b) {
return a+b;
}
public static void main(String[] args){
// create and publish an endpoint
Calculator calculator = new Calculator();
Endpoint endpoint = Endpoint.publish("http://localhost:8080/calculator", calculator);
}
}
I'm using the apt commando of jdk1.6.0_10. And the error is the following.
*warning: Annotation types without processors: [WebMethod]*
*1 warning*
*warning: Annotation types without processors: [javax.xml.bind.annotation.XmlRoot*
Element, javax.xml.bind.annotation.XmlAccessorType, javax.xml.bind.annotation.Xm
lType, javax.xml.bind.annotation.XmlElement]
*1 warning*
Calculator.java:8: cannot find symbol
symbol : class WebMethod
location: class example.Calculator
*@WebMethod*
*^*
*1 error*
It doesn't found the @WebServce annotation, but .. the rt.jar is in my classpath. I don't know why don' found it. I just to know how I could generate WSDL file, because I tried with the tools wscompile and I didn't get anythigs.
Thanks