cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jian wu" <hellojia...@gmail.com>
Subject Need Help: How to configure CXF Client use a CommonsHttpClientTransportFactory
Date Sat, 26 Jul 2008 08:35:21 GMT
Hi Dan and Ulhas,

Thanks a lot for answering my previous message!

I tried to create a simple CommonsHttpClientTransportFactory with a simple
CommonsHttpClientConduit, and I tried to follow the suggestion Dan gave
at:
  http://www.nabble.com/Using-HTTPClient-as-a-transport-td14715325.html#a16815394

I created a simple cxf-extension-commons-http.xml as:
===================================================
<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
<bean class="org.apache.cxf.transport.http.CommonsHTTPClientTransportFactory"
          id="org.apache.cxf.transport.http.CommonsHTTPClientTransportFactory"
          lazy-init="false"
          depends-on="org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory">
<property name="bus" ref="cxf"/>
<property name="transportIds">
<list>
<value>http://schemas.xmlsoap.org/soap/http</value>
<value>http://schemas.xmlsoap.org/wsdl/http/</value>
<value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
<value>http://www.w3.org/2003/05/soap/bindings/HTTP/</value>
<value>http://cxf.apache.org/transports/http/configuration</value>
<value>http://cxf.apache.org/bindings/xformat</value>
</list>
</property>
</bean>
====================================================

I created a simple WSDL2Java generated client, and I can see my
client logging output as:
====================================================
Jul 26, 2008 12:28:11 AM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[META-INF/cxf/cxf.xml]
Jul 26, 2008 12:28:12 AM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[META-INF/cxf/cxf-extension-commons-http.xml]
Jul 26, 2008 12:28:12 AM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[META-INF/cxf/cxf-extension-http.xml]
Jul 26, 2008 12:28:12 AM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[META-INF/cxf/cxf-extension-object-binding.xml]
====================================================

Also, from my registerWithBindingManager() method, I tried to ensure
that the following namespaces are registered with the new
CommonsHTTPClientTransportFactory as:
====================================================
For http://schemas.xmlsoap.org/soap/http,
org.apache.cxf.transport.http.CommonsHTTPClientTransportFactory
For http://schemas.xmlsoap.org/wsdl/http/,
org.apache.cxf.transport.http.CommonsHTTPClientTransportFactory
For http://schemas.xmlsoap.org/wsdl/soap/http,
org.apache.cxf.transport.http.CommonsHTTPClientTransportFactory
For http://www.w3.org/2003/05/soap/bindings/HTTP/,
org.apache.cxf.transport.http.CommonsHTTPClientTransportFactory
For http://cxf.apache.org/transports/http/configuration,
org.apache.cxf.transport.http.CommonsHTTPClientTransportFactory
For http://cxf.apache.org/bindings/xformat,
org.apache.cxf.transport.http.CommonsHTTPClientTransportFactory
===================================================

But, my client still uses the HTTPConduit as the following code snippet
==================================================
Client client = ClientProxy.getClient( port );
	    	
System.out.println( client.getConduit().getClass().getSimpleName() );
System.out.println( client.getConduitSelector().getClass().getSimpleName() );
System.out.println( client.getEndpoint().getEndpointInfo().getTransportId() );
==================================================
with output:

HTTPConduit
UpfrontConduitSelector
http://schemas.xmlsoap.org/soap/http

Is there any extra configuration steps required to let CXF Client use
my CommonsHttpClientConduit?

I really appreciate any tip and suggestion from your guys.

Thanks a lot for your help!

Jian

Mime
View raw message