首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

cxf配备http:conduit

2012-07-01 
cxf配置http:conduit本次项目要通过https方式,调用外部的web service,所以在cxf的配置文件里进行配置如下:

cxf配置http:conduit
本次项目要通过https方式,调用外部的web service,所以在cxf的配置文件里进行配置如下:


结果发现影响了系统原有的web service客户端的功能

查看日志,异常信息如下:

2012-05-07 15:34:59,407 ERROR [STDERR] javax.xml.ws.soap.SOAPFaultException: Could not send Message.
2012-05-07 15:34:59,408 ERROR [STDERR] at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:138)
2012-05-07 15:34:59,409 ERROR [STDERR] at $Proxy146.invoke(Unknown Source)
2012-05-07 15:34:59,409 ERROR [STDERR] at com.huawei.nsm.framework.service.engine.impl.WsInvoker.invoke(WsInvoker.java:104)
2012-05-07 15:34:59,410 ERROR [STDERR] at com.huawei.nsm.framework.service.engine.ServiceEngine.invoke(ServiceEngine.java:69)
2012-05-07 15:34:59,411 ERROR [STDERR] at com.huawei.nsm.framework.service.ServiceAccessor.invoke(ServiceAccessor.java:49)
2012-05-07 15:34:59,412 ERROR [STDERR] at com.huawei.wfm.workforce.task.sch.service.calculatepriority.CalculatePriorityService.calculate(CalculatePriorityService.java:57)
2012-05-07 15:34:59,412 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2012-05-07 15:34:59,413 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
2012-05-07 15:34:59,414 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
2012-05-07 15:34:59,415 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
2012-05-07 15:34:59,415 ERROR [STDERR] at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
2012-05-07 15:34:59,416 ERROR [STDERR] at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:162)
2012-05-07 15:34:59,417 ERROR [STDERR] at com.huawei.nsm.framework.utils.ClassUtil.invokeMethod(ClassUtil.java:45)
2012-05-07 15:34:59,418 ERROR [STDERR] at com.huawei.nsm.datasource.service.impl.DatasourceSaveServiceImpl.initSchedulePriority(DatasourceSaveServiceImpl.java:917)
2012-05-07 15:34:59,419 ERROR [STDERR] at com.huawei.nsm.workflow.service.AfterTicketSubmitedAsyncService$AfterTicketSubmitedAsyncRunnable.initSchedulePriority(AfterTicketSubmitedAsyncService.java:267)
2012-05-07 15:34:59,419 ERROR [STDERR] at com.huawei.nsm.workflow.service.AfterTicketSubmitedAsyncService$AfterTicketSubmitedAsyncRunnable.run(AfterTicketSubmitedAsyncService.java:183)
2012-05-07 15:34:59,420 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
2012-05-07 15:34:59,421 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
2012-05-07 15:34:59,422 ERROR [STDERR] at java.lang.Thread.run(Thread.java:662)

2012-05-07 15:34:59,422 ERROR [STDERR] Caused by: org.apache.cxf.interceptor.Fault: Could not send Message.
2012-05-07 15:34:59,423 ERROR [STDERR] at org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:48)
2012-05-07 15:34:59,424 ERROR [STDERR] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:226)
2012-05-07 15:34:59,425 ERROR [STDERR] at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:449)
2012-05-07 15:34:59,426 ERROR [STDERR] at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279)
2012-05-07 15:34:59,426 ERROR [STDERR] at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:231)
2012-05-07 15:34:59,427 ERROR [STDERR] at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
2012-05-07 15:34:59,428 ERROR [STDERR] at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:117)
2012-05-07 15:34:59,428 ERROR [STDERR] ... 18 more

2012-05-07 15:34:59,429 ERROR [STDERR] Caused by: java.io.IOException: Illegal Protocol http for HTTPS URLConnection Factory.
2012-05-07 15:34:59,430 ERROR [STDERR] at org.apache.cxf.transport.https.HttpsURLConnectionFactory.createConnection(HttpsURLConnectionFactory.java:126)
2012-05-07 15:34:59,431 ERROR [STDERR] at org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:484)
2012-05-07 15:34:59,431 ERROR [STDERR] at org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46)
2012-05-07 15:34:59,432 ERROR [STDERR] ... 24 more

原来系统原有的web service客户端,走的http协议,但是配置文件里配置了
<http:conduit name="https://10.78.8.172:443/.*">

仅针对目标https地址的web service客户端进行配置,对原有的web service客户端就不会造成影响了

总结:

1、<http:conduit>标签是对cxf的客户端,即<jaxws:client>产生影响,对<jaxws:endpoint>没有影响

2、<http:conduit name="*.http-conduit">会对所有的cxf客户端都生效,可以通过name属性,来指定生效范围

热点排行