Buscar este blog

domingo, 21 de agosto de 2016

CXF - Determine conduit name

If you need to know the conduit name that Apache CXF uses with some webservice, the easiest way is to let him to tell you.
Conduit configuration allows you to define some useful parameters, like proxy configuration, http authentication, SSL configuration, etc.

For example, I want to determine the condouit name for the currency convertor service http://www.webservicex.com/CurrencyConvertor.asmx. My CXF configuration looks like this:

<jaxws:client id="currencyConversorClient"
 name="{http://www.webserviceX.NET}CurrencyConvertorSoap12" 
 serviceClass="net.webservicex.CurrencyConvertorSoap"
 address="http://www.webservicex.com/CurrencyConvertor.asmx"> 
</jaxws:client>


<http:conduit name="???????.http-conduit">
 <http:client ReceiveTimeout="60000" ConnectionTimeout="30000">
 (...)
</http:conduit>

So, how do I know the conduit name? Just put CXF in debug I look for a message like "Could not find a definition for bean with id ...". This is the name CXF is trying to use.

17:23:35,516 INFO  [stdout] (http-localhost/127.0.0.1:8080-5) [2016-08-21 17:23:35,515] (ConfigurerImpl.java:179) DEBUG http-localhost/127.0.0.1:8080-5 org.apache.cxf.configuration.spring.ConfigurerImpl Could not find a definition for bean with id {http://www.webserviceX.NET/}CurrencyConvertorSoapPort.http-conduit - no injection will be performed.

17:23:35,517 INFO  [stdout] (http-localhost/127.0.0.1:8080-5) [2016-08-21 17:23:35,516] (ConfigurerImpl.java:179) DEBUG http-localhost/127.0.0.1:8080-5 org.apache.cxf.configuration.spring.ConfigurerImpl Could not find a definition for bean with id http://www.webservicex.com/CurrencyConvertor.asmx - no injection will be performed.

No hay comentarios:

Publicar un comentario