Java端点类不适用于axis2库

Java端点类不适用于axis2库,java,web-services,axis2,Java,Web Services,Axis2,我试图用谷歌搜索这个问题的答案,并查看了StackOverFlow中的相关主题,但找不到任何有助于解决此问题的内容 我正在尝试使用Java7端点类。我的简单代码运行良好: import javax.jws.WebMethod; import javax.jws.WebService; @WebService public class TestWebService { @WebMethod public void printName(String name) { System.out.

我试图用谷歌搜索这个问题的答案,并查看了StackOverFlow中的相关主题,但找不到任何有助于解决此问题的内容

我正在尝试使用Java7端点类。我的简单代码运行良好:

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>
org.apache.axis2.AxisFault:找不到端点引用(EPR)/服务的服务/
位于org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:65)
位于org.apache.axis2.engine.Phase.invoke(Phase.java:333)
位于org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:264)
在org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:163)上
位于org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:136)
位于org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:130)
位于org.apache.axis2.transport.http.HTTPWorker.service(HTTPWorker.java:257)
位于org.apache.axis2.transport.http.server.AxisHttpService.doService(AxisHttpService.java:281)
位于org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(AxisHttpService.java:187)
位于org.apache.axis2.transport.http.server.HttpServiceProcessor.run(HttpServiceProcessor.java:82)
位于edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
位于edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
位于java.lang.Thread.run(未知源)