本帖最后由 hutao93 于 2014-04-03 20:58:54 编辑

解决方案 »

  1.   

    没什么的,就用httpclient请求服务器的Webservice
      

  2.   

    参考
    /**
     * a http request with given url
     * @param strUrl the url you want to request
     * @return
     */
    public static String request(String strUrl){ logger.debug(CommonHTTPRequest.class.getName() + ", request url is : " + strUrl);

    String userHome = System.getProperty("user.home");
    if(userHome.contains("eacfgjl")){
    useProxy = true;
    }

    if(useProxy){
    initProxy();
    }
            URL url = null;
            String result = "";
            HttpURLConnection urlConn = null;
            InputStreamReader in = null;
            try {
    url = new URL(strUrl);
    urlConn = (HttpURLConnection) url.openConnection();
    in = new InputStreamReader(urlConn.getInputStream());
    BufferedReader br = new BufferedReader(in);

    String readerLine = null;
    while((readerLine=br.readLine())!=null){
    result += readerLine;
    }
    in.close();
    urlConn.disconnect();
    } catch (MalformedURLException e) {
    e.printStackTrace();
    logger.error(ExceptionUtil.getTrace(e));
    } catch (IOException e) {
    e.printStackTrace();
    logger.error(ExceptionUtil.getTrace(e));
    } finally {
    try {
    in.close();
    } catch (IOException e) {
    e.printStackTrace();
    logger.error(ExceptionUtil.getTrace(e));
    }
    urlConn.disconnect();
    }
            
            return result;
    }
      

  3.   

    http://blog.csdn.net/baiyuliang2013/article/details/21979037