Jos*_*son 6 java axis2 web-services
我正在尝试将一些Web服务存根从Metro移动到Axis2,但是在使用wsdl2java生成我的存根之后,每当我尝试进行服务调用时,我都会出现404错误.
16/12/2010 11:14:57 AM org.apache.axis2.deployment.ModuleDeployer deploy
INFO: Deploying module: addressing-1.5.3-jar - file:/C:/Users/xxx/.m2/repository/org/apache/axis2/axis2/1.5.3/axis2-1.5.3-jar.jar
16/12/2010 11:14:57 AM org.apache.axis2.transport.http.HTTPSender sendViaPost
INFO: Unable to sendViaPost to url[xxxx]
org.apache.axis2.AxisFault: Transport error: 404 Error: Not Found
at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:307)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:200)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:438)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at au.com.jpaterso.betcalc.axis2.tab.LoginStub.getKey(LoginStub.java:184)
at au.com.jpaterso.betcalc.axis2.tab.Test.main(Test.java:13)
Exception in thread "main" org.apache.axis2.AxisFault: Transport error: 404 Error: Not Found
at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:307)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:200)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:438)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at au.com.jpaterso.betcalc.axis2.tab.LoginStub.getKey(LoginStub.java:184)
at au.com.jpaterso.betcalc.axis2.tab.Test.main(Test.java:13)
Run Code Online (Sandbox Code Playgroud)
它尝试连接的URL肯定是正确的,因为我可以通过我的浏览器/ SoapUI访问它.
任何帮助将不胜感激!
谢谢,约瑟夫.
您没有提供有关您尝试部署 WS 的环境的太多信息。例如,这是在 Tomcat/JBoss 下运行的 Web 应用程序,还是使用 Axis2 部署的独立服务器?
从您发布的跟踪来看,我认为与您的服务器存在连接,但您的 WS 未成功部署。我假设您可以使用独立服务器进行测试,我建议:
转到您的 WS 存储库。在我的测试机器上,这将类似于 ~/axis2-xxx/repository/services 并确保您的服务在那里(.aar 文件或解压版本)。
启动服务器并检查您的服务是否真正部署。例如,在我的安装中,服务器将生成以下输出(不完整):
me@melinuxpc:~/axis2-1.5.1/bin> ./axis2server.sh
使用 AXIS2_HOME: xxx
使用 JAVA_HOME: xxx 使用
JAVA_OPTS: -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n侦听地址为 8000 的传输 dt_socket [INFO] [SimpleAxisServer] 正在启动 [INFO] [SimpleAxisServer] 使用 Axis2 存储库 xxx [SimpleAxisServer] 使用 Axis2 存储库 xxx [SimpleAxisServer] 使用 Axis2 配置文件 xxx [INFO] 集群已被禁用[信息] 部署模块:xxx [信息] 部署 Web 服务:MyTestService - 文件:~/axis2-1.5.1/repository/services/MyTestService/
检查您的 Web 服务是否已部署并且没有错误。您可以检查服务的 WSDL 是否在“浏览器中”可用。在我的测试机器上,URL 为:
http://localhost:8080/axis2/services/MyTestService?wsdl
虽然可以在以下位置看到包含所有已部署服务的列表:
http://localhost:8080/axis2/services/
并且不要太快放弃 Axis2 ;)
祝你好运!
归档时间: |
|
查看次数: |
23074 次 |
最近记录: |