WebService之CXF注解报错(三)
来源:互联网 发布:vb程序设计是什么 编辑:程序博客网 时间:2024/06/05 00:38
WebService之CXF注解
1、具体错误如下
五月 04, 2014 11:29:28 下午 org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean buildServiceFromClass信息: Creating Service {http://service.you.com/}IServiceService from class com.you.service.IService五月 04, 2014 11:29:29 下午 org.apache.cxf.services.IServiceService.IServicePort.IService信息: Outbound Message---------------------------ID: 1Address: http://localhost:8686/PortalService/services/testEncoding: UTF-8Http-Method: POSTContent-Type: text/xmlHeaders: {Accept=[*/*], SOAPAction=[""]}Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:test xmlns:ns2="http://service.you.com/"><arg0><age>18</age><name>张三</name></arg0></ns2:test></soap:Body></soap:Envelope>--------------------------------------五月 04, 2014 11:29:30 下午 org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging警告: Interceptor for {http://service.you.com/}IServiceService#{http://service.you.com/}test has thrown exception, unwinding noworg.apache.cxf.interceptor.Fault: Could not send Message.at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:502)at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:411)at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:314)at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:267)at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:137)at $Proxy39.test(Unknown Source)at com.test.service.IServiceTest.main(IServiceTest.java:50)Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '404: Not Found' when communicating with http://localhost:8686/PortalService/services/testat org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1565)at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1520)at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1326)at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:50)at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:223)at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:635)at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)... 9 moreException in thread "main" javax.xml.ws.WebServiceException: Could not send Message.at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:148)at $Proxy39.test(Unknown Source)at com.test.service.IServiceTest.main(IServiceTest.java:50)Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '404: Not Found' when communicating with http://localhost:8686/PortalService/services/testat org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1565)at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1520)at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1326)at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:50)at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:223)at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:635)at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:502)at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:411)at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:314)at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:267)at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:137)... 2 more
2、错误原因
Webservice项目中的测试文件中的路径出现问题,原来的是这样的:
http://localhost:8686/IPservice/services/test
而项目的名称是Webservice,不是IPservice
3、解决办法
修改路径:http://localhost:8686/Webservice/services/test
4、正确运行结果
五月 05, 2014 9:54:07 下午 org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean buildServiceFromClass信息: Creating Service {http://service.you.com/}IServiceService from class com.you.service.IService五月 05, 2014 9:54:09 下午 org.apache.cxf.services.IServiceService.IServicePort.IService信息: Outbound Message---------------------------ID: 1Address: http://localhost:8686/Webservice/services/testEncoding: UTF-8Http-Method: POSTContent-Type: text/xmlHeaders: {Accept=[*/*], SOAPAction=[""]}Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:test xmlns:ns2="http://service.you.com/"><arg0><age>18</age></arg0></ns2:test></soap:Body></soap:Envelope>--------------------------------------五月 05, 2014 9:54:10 下午 org.apache.cxf.services.IServiceService.IServicePort.IService信息: Inbound Message----------------------------ID: 1Response-Code: 200Encoding: UTF-8Content-Type: text/xml;charset=UTF-8Headers: {Content-Length=[210], content-type=[text/xml;charset=UTF-8], Date=[Mon, 05 May 2014 13:54:10 GMT], Server=[Apache-Coyote/1.1]}Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:testResponse xmlns:ns2="http://service.you.com/"><return>年龄:18</return></ns2:testResponse></soap:Body></soap:Envelope>--------------------------------------年龄:18
2 0
- WebService之CXF注解报错(三)
- WebService之CXF注解报错(一)
- WebService之CXF注解报错(二)
- webservice之CXF注解实现(三)
- webservice之CXF注解实现(一)
- webservice之CXF注解实现(二)
- WebService之CXF注解之三(Service接口实现类)
- CXF webservice报错
- webService之(三)CXF服务端
- WebService之CXF注解之二(Service接口)
- WebService之CXF注解之四(测试类)
- WebService之CXF注解之五(配置文件)
- WebService之CXF+Spring集成(使用注解)
- WebService之CXF注解之一(封装类)
- (三)WebService之CXF发布Web服务
- webService(cxf)生成客户端报错解决
- cxf webservice部署servlet容器报错
- webservice CXF 客户端调用报错
- 怎样用boost::serialization去序列化派生模板类(续)
- 【读书笔记】代码整洁之道 第3章函数1
- Exercice_3.14
- ZOJ-2193
- 离殇
- WebService之CXF注解报错(三)
- Android Input设备debug 查看底层时间上报和对应的设备技巧
- php几个常用预定义变量,有关路径的
- 我真的不懂路由器和交换机的区别
- 第9周项目2
- 【读书笔记】编程匠艺 第1章
- [30天自制操作系统]day_2
- 架构设计中服务层的简单理解
- Word Search