You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "krn1231@gmail.com" <kr...@gmail.com> on 2011/11/23 05:12:50 UTC

Writing Webservice client without any dependencies

>From my webservice , i am calling another WebService .

So inside my webservice code , i am writing the code this way

JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
 factory.setServiceClass(MyWebService.class);
String host = "refers to another webservce/address "
 factory.setAddress(host);
     MyWebService client = (MYWebService) factory.create();
     Client clientProxy = ClientProxy.getClient(client);
     HTTPConduit conduit = (HTTPConduit) clientProxy.getConduit();
     HTTPClientPolicy policy = new HTTPClientPolicy();
     policy.setConnectionTimeout(0L);
     policy.setReceiveTimeout(0L);
     conduit.setClient(policy);
The problem is that , we dont have MyWebService class with us . my question
can we write a client , without dependencies ??


--
View this message in context: http://cxf.547215.n5.nabble.com/Writing-Webservice-client-without-any-dependencies-tp5015504p5015504.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Writing Webservice client without any dependencies

Posted by Glen Mazza <gm...@talend.com>.
Links #1 (WSDL-first SOAP client) and #51 (Dispatch) may help you here: 
http://www.jroller.com/gmazza/entry/blog_article_index

For link #1, it shows how you can code MyWebService even if you don't 
immediately have it at the time of compilation.  If you have the WSDL 
Maven can generate that class for you, then use that class during 
compilation.

HTH,
Glen

On 11/22/2011 11:34 PM, Freeman Fang wrote:
> Hi,
>
> In this case if you know what's the on-wire soap message looks like, 
> you can use jaxws dispatch which can send a soap message directly to 
> the server.
> You may need take a look at jaxws_dispatch_provider example shipped 
> with kit.
>
> Freeman
> On 2011-11-23, at 下午12:12, krn1231@gmail.com wrote:
>
>> From my webservice , i am calling another WebService .
>>
>> So inside my webservice code , i am writing the code this way
>>
>> JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
>> factory.setServiceClass(MyWebService.class);
>> String host = "refers to another webservce/address "
>> factory.setAddress(host);
>>     MyWebService client = (MYWebService) factory.create();
>>     Client clientProxy = ClientProxy.getClient(client);
>>     HTTPConduit conduit = (HTTPConduit) clientProxy.getConduit();
>>     HTTPClientPolicy policy = new HTTPClientPolicy();
>>     policy.setConnectionTimeout(0L);
>>     policy.setReceiveTimeout(0L);
>>     conduit.setClient(policy);
>> The problem is that , we dont have MyWebService class with us . my 
>> question
>> can we write a client , without dependencies ??
>>
>>
>> -- 
>> View this message in context: 
>> http://cxf.547215.n5.nabble.com/Writing-Webservice-client-without-any-dependencies-tp5015504p5015504.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>
> ---------------------------------------------
> Freeman Fang
>
> FuseSource
> Email:ffang@fusesource.com
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
>
>
>
>
>
>
>
>
>
>


-- 
Glen Mazza
Talend Community Coders
http://coders.talend.com
blog: http://www.jroller.com/gmazza


Re: Writing Webservice client without any dependencies

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

In this case if you know what's the on-wire soap message looks like,  
you can use jaxws dispatch which can send a soap message directly to  
the server.
You may need take a look at jaxws_dispatch_provider example shipped  
with kit.

Freeman
On 2011-11-23, at 下午12:12, krn1231@gmail.com wrote:

> From my webservice , i am calling another WebService .
>
> So inside my webservice code , i am writing the code this way
>
> JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
> factory.setServiceClass(MyWebService.class);
> String host = "refers to another webservce/address "
> factory.setAddress(host);
>     MyWebService client = (MYWebService) factory.create();
>     Client clientProxy = ClientProxy.getClient(client);
>     HTTPConduit conduit = (HTTPConduit) clientProxy.getConduit();
>     HTTPClientPolicy policy = new HTTPClientPolicy();
>     policy.setConnectionTimeout(0L);
>     policy.setReceiveTimeout(0L);
>     conduit.setClient(policy);
> The problem is that , we dont have MyWebService class with us . my  
> question
> can we write a client , without dependencies ??
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Writing-Webservice-client-without-any-dependencies-tp5015504p5015504.html
> Sent from the cxf-user mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com