我试图用谷歌搜索这个问题的答案并检查 StackOverFlow 中的相关主题,但找不到任何有助于解决这个问题的东西。
我正在尝试使用 Java 7 Endpoint 类。我的简单代码工作正常:
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService
public class TestWebService {
@WebMethod
public void printName(String name) {
System.out.println("Hello " + name);
}
}
而我的主要:
import javax.xml.ws.Endpoint;
public class Main {
public static void main(String Args[]){
Endpoint endPoint = Endpoint.publish("http://localhost:8099/andy", new TestWebService());
}
}
但是当我将axis2库添加到我的项目并运行它时,当我尝试通过浏览器(或SoapUI)访问我的端点时出现以下错误有人可以告诉我如何解决这个问题吗?
<Exception>org.apache.axis2.AxisFault: The service cannot be found for the endpoint reference (EPR) /services/
at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:65)
at org.apache.axis2.engine.Phase.invoke(Phase.java:333)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:264)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:163)
at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:136)
at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:130)
at org.apache.axis2.transport.http.HTTPWorker.service(HTTPWorker.java:257)
at org.apache.axis2.transport.http.server.AxisHttpService.doService(AxisHttpService.java:281)
at org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(AxisHttpService.java:187)
at org.apache.axis2.transport.http.server.HttpServiceProcessor.run(HttpServiceProcessor.java:82)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Unknown Source)
</Exception>