首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

cxf超时设立

2012-06-29 
cxf超时设置http://download.oracle.com/docs/cd/E20686_01/English/Technical_Documentation/Web_Service

cxf超时设置
http://download.oracle.com/docs/cd/E20686_01/English/Technical_Documentation/Web_Services/ProgrammersGuide/helpmain.htm?toc.htm?34314.htm

        //调用WebService
        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setServiceClass(IHelloWorldService.class);
        factory.setAddress("http://localhost:9000/helloWorld");
        IHelloWorldService client = (IHelloWorldService) factory.create();
       
        ///开始超时设置
        Client proxy = ClientProxy.getClient(client);
        HTTPConduit conduit = (HTTPConduit) proxy.getConduit();
        HTTPClientPolicy policy = new HTTPClientPolicy();
        policy.setConnectionTimeout(CXF_CLIENT_TIME_OUT);
        policy.setReceiveTimeout(CXF_CLIENT_TIME_OUT);
        conduit.setClient(policy);
        ///结束超时设置
           
        System.out.println(client.sayHello("test"));

热点排行