You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by yulinxp <yu...@gmail.com> on 2008/02/13 17:58:41 UTC
how to configure HTTPConduit for client using java code
User's guide shows how to configure HTTPConduit for client using java code
http://cwiki.apache.org/CXF20DOC/client-http-transport-including-ssl-support.html
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.transport.http.HTTPConduit;
import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
...
Client client = ClientProxy.getClient(poltim);
HTTPConduit http = (HTTPConduit) client.getConduit();
Here the example uses org.apache.cxf.frontend.ClientProxy.
1) Do JAX-WS FrontEnd & Simple FrontEnd have anything to do with client?
2) how to configure HTTPConduit for client if client needs to set
AegisDatabinding using ClientProxyFactoryBean?
(Or how to set HTTPConduit & AegisDatabinding for client at the same time?)
ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
factory.setServiceClass(HelloWorld.class);
factory.setAddress("http://localhost:9090/spring_http/ServerEndPoint");
factory.getServiceFactory().setDataBinding(new AegisDatabinding());
HelloWorld hw = (HelloWorld)factory.create();
..... <---- how to set
HTTPConduit ???
String response = hw.sayHi("hello");
System.out.println("Response: " + response);
--
View this message in context: http://www.nabble.com/how-to-configure-HTTPConduit-for-client-using-java-code-tp15460135p15460135.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: how to configure HTTPConduit for client using java code
Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday 13 February 2008, yulinxp wrote:
> User's guide shows how to configure HTTPConduit for client using java
> code
>
> http://cwiki.apache.org/CXF20DOC/client-http-transport-including-ssl-s
>upport.html
>
> import org.apache.cxf.endpoint.Client;
> import org.apache.cxf.frontend.ClientProxy;
> import org.apache.cxf.transport.http.HTTPConduit;
> import
> org.apache.cxf.transports.http.configuration.HTTPClientPolicy; ...
>
> Client client = ClientProxy.getClient(poltim);
> HTTPConduit http = (HTTPConduit) client.getConduit();
>
> Here the example uses org.apache.cxf.frontend.ClientProxy.
>
> 1) Do JAX-WS FrontEnd & Simple FrontEnd have anything to do with
> client?
Nope. Shouldn't make any difference. The ClientProxy class is actually
in the simple frontend.
> 2) how to configure HTTPConduit for client if client needs to
> set AegisDatabinding using ClientProxyFactoryBean?
> (Or how to set HTTPConduit & AegisDatabinding for client at the same
> time?)
Same was as with jax-ws I would guess.
>
> ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
> factory.setServiceClass(HelloWorld.class);
>
> factory.setAddress("http://localhost:9090/spring_http/ServerEndPoint")
>; factory.getServiceFactory().setDataBinding(new AegisDatabinding());
> HelloWorld hw = (HelloWorld)factory.create();
>
> ..... <---- how to set
> HTTPConduit ???
Client client = ClientProxy.getClient(hw);
HTTPConduit http = (HTTPConduit) client.getConduit();
> String response = hw.sayHi("hello");
> System.out.println("Response: " + response);
--
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog
Re: how to configure HTTPConduit for client using java code
Posted by Benson Margulies <bi...@gmail.com>.
On Fri, Feb 15, 2008 at 10:17 AM, yulinxp <yu...@gmail.com> wrote:
>
> For server side, I understand. But I thought client shouldn't worry about
> the
> data binding at all.
>
>
> The CXF client has to use a data binding just like the server. How else
> can know how to map XML to Java for you.
>
Re: how to configure HTTPConduit for client using java code
Posted by yulinxp <yu...@gmail.com>.
For server side, I understand. But I thought client shouldn't worry about the
data binding at all.
willem.jiang wrote:
>
> Hi ,
>
> I think the default Data Binding in the ServiceFactory is JaxbDatabinding.
> That's why you need to do when you want to use AegisDatabinding.
>
> Willem.
>
> yulinxp wrote:
>> Why/when is it needed to set AegisDatabinding for client at all ?
>>
>> ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
>> factory.setServiceClass(HelloWorld.class);
>> factory.setAddress("xxxx");
>> factory.getServiceFactory().setDataBinding(new AegisDatabinding());
>> HelloWorld hw = (HelloWorld)factory.create();
>>
>
>
>
--
View this message in context: http://www.nabble.com/how-to-configure-HTTPConduit-for-client-using-java-code-tp15460135p15502436.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: how to configure HTTPConduit for client using java code
Posted by Willem Jiang <wi...@gmail.com>.
Hi ,
I think the default Data Binding in the ServiceFactory is JaxbDatabinding.
That's why you need to do when you want to use AegisDatabinding.
Willem.
yulinxp wrote:
> Why/when is it needed to set AegisDatabinding for client at all ?
>
> ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
> factory.setServiceClass(HelloWorld.class);
> factory.setAddress("xxxx");
> factory.getServiceFactory().setDataBinding(new AegisDatabinding());
> HelloWorld hw = (HelloWorld)factory.create();
>
Re: how to configure HTTPConduit for client using java code
Posted by yulinxp <yu...@gmail.com>.
Why/when is it needed to set AegisDatabinding for client at all ?
ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
factory.setServiceClass(HelloWorld.class);
factory.setAddress("xxxx");
factory.getServiceFactory().setDataBinding(new AegisDatabinding());
HelloWorld hw = (HelloWorld)factory.create();
--
View this message in context: http://www.nabble.com/how-to-configure-HTTPConduit-for-client-using-java-code-tp15460135p15489744.html
Sent from the cxf-user mailing list archive at Nabble.com.