相关疑难解决方法(0)

JAX-WS,Axis2和CXF之间的区别

有什么区别:

  1. JAX-WS
  2. Axis2的
  3. CXF

这三个都可用于在Java中创建Web服务.
据我所知,JAX-WS是一个规范,Axis2和CXF是实现,但是如果我没有错,Java 1.6就会实现JAX-WS.

那么可以使用Java 1.6来开发JAX-WS Web服务而无需使用Axis2或CXF吗?那么Axis2,CXF的用途是什么?

java axis2 cxf jax-ws

127
推荐指数
3
解决办法
9万
查看次数

Apache CXF异常:java.lang.RuntimeException:找不到地址的管道启动器

我想从java调用.net SOAP Web服务..net服务有ws-security模块,我使用apache CXF来设置用户名和密码(以后可能是X.509证书).我使用的代码是:

    ITaxOrganService wsHttpBindingITaxOrganService = new TaxOrganService().getWSHttpBindingITaxOrganService();
    Endpoint endpoint = ClientProxy.getClient(wsHttpBindingITaxOrganService).getEndpoint();

    Map<String,Object> outProps = new HashMap<>();
    outProps.put(WSHandlerConstants.ACTION,WSHandlerConstants.USERNAME_TOKEN);
    outProps.put(WSHandlerConstants.USER,"*****");
    outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
    outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS, ShahrdariPasswordCallback.class.getName());

    WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
    endpoint.getOutInterceptors().add(wssOut);
    PermissionPrintDS permissionPrintDS = wsHttpBindingITaxOrganService.providePermissionInfoByPermNo(10000198);
Run Code Online (Sandbox Code Playgroud)

但java在最后一行抛出一个异常:

    Caused by: java.lang.RuntimeException: Could not find conduit initiator for address: http://urbanservices.iri/Services/xxyzService/xxyzService.svc and transport: http://schemas.xmlsoap.org/soap/http
    at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:224) ~[cxf-rt-bindings-soap-3.1.0.jar:3.1.0]
    at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:229) ~[cxf-rt-bindings-soap-3.1.0.jar:3.1.0]
    at org.apache.cxf.endpoint.AbstractConduitSelector.createConduit(AbstractConduitSelector.java:145) ~[cxf-core-3.1.0.jar:3.1.0]
    at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:107) ~[cxf-core-3.1.0.jar:3.1.0]
    at org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:63) ~[cxf-core-3.1.0.jar:3.1.0]
    at org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:853) ~[cxf-core-3.1.0.jar:3.1.0]
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:511) ~[cxf-core-3.1.0.jar:3.1.0]
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:425) ~[cxf-core-3.1.0.jar:3.1.0]
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326) ~[cxf-core-3.1.0.jar:3.1.0]
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279) ~[cxf-core-3.1.0.jar:3.1.0]
    at …
Run Code Online (Sandbox Code Playgroud)

java soap wsdl web-services cxf

8
推荐指数
1
解决办法
2万
查看次数

Apache CXF + JavaFX找不到命名空间的管道启动器

我正在尝试使用CXF运行JavaFX Rest客户端。一个非常简单的测试。当我尝试获取URL时,出现org.apache.cxf.BusException:未找到命名空间http://cxf.apache.org/transports/http的管道启动器。我在这里看了一些相关的问题,但是没有运气。任何帮助,将不胜感激。然后,我添加的唯一Maven依赖项是cxf-rt-rs-client 3.1.0。代码为:

WebClient client = WebClient.create("http://www.stackoverflow.com"); client.type("text/html").accept("text/html"); System.out.println(client.get());

堆栈跟踪:

Caused by: org.apache.cxf.BusException: No conduit initiator was found for the namespace http://cxf.apache.org/transports/http.
at org.apache.cxf.bus.managers.ConduitInitiatorManagerImpl.getConduitInitiator(ConduitInitiatorManagerImpl.java:110)
at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:104)
at org.apache.cxf.endpoint.UpfrontConduitSelector.selectConduit(UpfrontConduitSelector.java:77)
at org.apache.cxf.message.ExchangeImpl.getConduit(ExchangeImpl.java:159)
at org.apache.cxf.interceptor.MessageSenderInterceptor.getConduit(MessageSenderInterceptor.java:71)
at org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
at org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:624)
at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1100)
Run Code Online (Sandbox Code Playgroud)

apache javafx cxf

4
推荐指数
2
解决办法
2388
查看次数

如果从服务器调用Web服务客户端失败:如果从Junit(本地)调用,则成功调用

我正在使用jboss 7并使用CXF框架构建webservice客户端.

我编写了一个特定的Web服务客户端来调用部署在远程服务器中的Web服务.

如果从Junit测试用例调用此Web服务客户端,则webservice调用成功,我们从服务器获得有效的xml响应.

但是如果从服务器调用相同的webservice客户端(webservice客户端本身被部署为webapp),那么它会抛出异常:

Caused by: javax.xml.ws.soap.SOAPFaultException: Could not find conduit initiator for address: 
                                http://10.100.20.101/metavante1/ConnectwareWS/DPAcctTxnInqWSV1
                         and transport: http://schemas.xmlsoap.org/soap/http
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156)
        at sun.proxy.$Proxy137.dpAcctTxnInq(Unknown Source)
        at webservice.client.hsa.MetavanteHSAPort.getAccountDetails(MetavanteHSAPort.java:1785) [webserviceclient.jar:]
        ... 34 more
Caused by: java.lang.RuntimeException: Could not find conduit initiator for address: 
                                http://10.100.20.101/metavante1/ConnectwareWS/DPAcctTxnInqWSV1
                         and transport: http://schemas.xmlsoap.org/soap/http
        at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:225)
        at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:110)
        at org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:63)
        at org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:850)
        at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:525)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
        at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)
        ... 36 more
Run Code Online (Sandbox Code Playgroud)

在这种情况下,URL http://10.100.20.101/metavante1/ConnectwareWS/DPAcctTxnInqWSV1是从一个在XML文件中设置的spring bean中获取的.

以下是webservice客户端的代码:

public HSAAccountDetailsBn getAccountDetails(String bankAccNum)
            throws ServiceException
    {
        HSAAccountDetailsBn …
Run Code Online (Sandbox Code Playgroud)

java spring web-services http java-ee

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

cxf ×3

java ×3

web-services ×2

apache ×1

axis2 ×1

http ×1

java-ee ×1

javafx ×1

jax-ws ×1

soap ×1

spring ×1

wsdl ×1