You need to create the client first or you can't get a real client.
So the code snippet should be
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
proxyFactory.setServiceClass(CustomerService.class);
proxyFactory.setAddress(serviceURL);
proxyFactory.setServiceName(serviceName);
// The Client instance will be created when call the proxyFactory's
create method.
CustomerService customerService = (CustomerService) proxyFactory.create();
Client client = ClientProxy.getClient(cusomerService);
HTTPConduit http = (HTTPConduit) client.getConduit();
....
Willem
Arul Dhesiaseelan wrote:
Hi,
I tried the below code in the client side to set the client timeout as
suggested in the documentation. I get a NPE when I try to get the
conduit from client. Am I missing something?
Please clarify.
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
proxyFactory.setServiceClass(CustomerService.class);
proxyFactory.setAddress(serviceURL);
proxyFactory.setServiceName(serviceName);
Client client = proxyFactory.getClientFactoryBean().getClient();
HTTPConduit http = (HTTPConduit) client.getConduit();//NPE occurs here
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout(36000);
httpClientPolicy.setAllowChunking(false);
httpClientPolicy.setReceiveTimeout(32000);
Thank you
Arul
Arul Dhesiaseelan wrote:
[EMAIL PROTECTED] wrote:
When debugging our services, sometimes the time spent debugging is
greater that the time-out period for the client call. How can I
increase the allowed time-out period?
Thanks...
Chris
_________________________________________________
Scanned by MessageLabs for the Super Flux Friends
_________________________________________________
Can you try adding this to your client?
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout(0);
httpClientPolicy.setAllowChunking(true);
((HTTPConduit)
proxyFactory.getClientFactoryBean().getClient().getConduit()).setClient(httpClientPolicy);
Cheers,
Arul
_________________________________________________
Scanned by MessageLabs for the Super Flux Friends
_________________________________________________