Thanks Willem,you are right.The ClientProxy has been GCed.

but i want to config the timeout in the client side

so i use the ClientProxy,and use the HTTPConduit to set timeout info

if i want to set the timeout ,what i should to do.

The  wrong  code is:

    protected org.apache.cxf.endpoint.Client initClient() {

        int connectTimeout=10;
        int receiveTimeout=60;

        HelloWorld helloWorld = new HelloWorld();
        HelloWorldPortType port = helloWorld.getHelloWorldPort()                
    
;

        org.apache.cxf.endpoint.Client client = ClientProxy.getClient(port);

        HTTPConduit httpConduit = (HTTPConduit) client.getConduit();
        HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
        httpClientPolicy.setConnectionTimeout(connectTimeout);
        httpClientPolicy.setAllowChunking(false);
        httpClientPolicy.setReceiveTimeout(receiveTimeout);
        httpConduit.setClient(httpClientPolicy);
        client.getInInterceptors().add(new LoggingInInterceptor());
        client.getOutInterceptors().add(new LoggingOutInterceptor());
        return client;
    }



--
View this message in context: 
http://cxf.547215.n5.nabble.com/ClientProxy-throws-NullPointerException-when-invoking-its-invoke-tp5723532p5723564.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to