Java Endpoint类不适用于axis2库

时间:2013-10-10 08:57:57

标签: java web-services axis2

我尝试谷歌回答这个问题并检查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>

0 个答案:

没有答案