Xifre超时机制

URL _url = new URL("http://124.133.52.173:80/sdyls/ws/NodeRegService?wsdl");
        HttpURLConnection httpConnection = (HttpURLConnection)_url.openConnection();
        httpConnection.setReadTimeout(60000);//设置http连接的读超时,单位是毫秒
 
        httpConnection.connect();
        Client _client = new Client(httpConnection.getInputStream(), null);
        _client.setProperty(CommonsHttpMessageSender.HTTP_TIMEOUT, String.valueOf(60000));//设置发送的超时限制,单位是毫秒;
        _client.setProperty(CommonsHttpMessageSender.DISABLE_KEEP_ALIVE, "true");
        _client.setProperty(CommonsHttpMessageSender.DISABLE_EXPECT_CONTINUE, "true");
        
        Object[] obj = new Object[]{nodeBaseXml}; 
        Object[] result=null;
        try{
        	result = _client.invoke("nodeBaseInfo", obj);
		System.out.println(results[0]);
        }catch(Exception e){
        	
        }

你可能感兴趣的:(xfire)