Package com.esri.gpt.framework.http

Examples of com.esri.gpt.framework.http.HttpClientRequest.readResponseAsCharacters()


      sMsg = sErrPfx+"[HTTP "+nHttpResponseCode+"] "+httpClient.getResponseInfo().getResponseMessage();
      throw new ImsServiceException(sMsg,e);
    }
  }
 
  String response = httpClient.readResponseAsCharacters();
 
  // parse the response
  if (response.length() == 0) {
    throw new Exception(sErrPfx+"Empty response.");
  } else {
View Full Code Here


            url = url.replace(oldFParam, jsonFParam);
          }   
      }
      HttpClientRequest cr = new HttpClientRequest()
        cr.setUrl(url);
        String response = Val.chkStr(cr.readResponseAsCharacters());
        if(response.length() > 0){
          JSONObject jso = new JSONObject(response);
            String total = jso.has("total") ? jso.getString("total") : "-1";
            return Integer.parseInt(total);
        }
View Full Code Here

      url = url.substring(0,url.indexOf("?"));
      String params = "&id="+id+"f=json"
      url = url + params;
      HttpClientRequest cr = new HttpClientRequest();
      cr.setUrl(url);
      String response = Val.chkStr(cr.readResponseAsCharacters());
      if(response.length() > 0){
        JSONObject jso = new JSONObject(response);
          if(jso.has("results")){
            JSONArray results = jso.getJSONArray("results");
            for(int i=0; i < results.length(); i++){
View Full Code Here

        clientRequest.setCredentialProvider(credProvider);
      }
    }       
   
    clientRequest.execute();
    String response = clientRequest.readResponseAsCharacters();
    InputStream is = null;
    try {
      SearchXslProfile profile = this.readXslProfile();
      String js = Val.chkStr(profile.getResponsexslt());
      //String js = Val.chkStr(this.getFactoryAttributes().get("searchResponseJsT"));
View Full Code Here

    HttpClientRequest clientRequest = HttpClientRequest.newRequest(
        HttpClientRequest.MethodName.GET, url.toExternalForm());
    clientRequest.setConnectionTimeMs(getConnectionTimeoutMs());
    clientRequest.setResponseTimeOutMs(getResponseTimeoutMs());
    clientRequest.execute();
    String response = clientRequest.readResponseAsCharacters();
    LOG.log(Level.FINER, "Response from get Metadata url = {0}\n response = \n{1}", new Object[]{url.toExternalForm(), response});
    recordX = new SearchXslRecord();
    this.readXslProfile().readGetMetadataByIDResponse(response, recordX);
  } catch (MalformedURLException e) {
    ex = e;
View Full Code Here

          request.setConnectionTimeMs((int)parsePeriod(connectionTimeout, DEFAULT_CONNECTION_TIMEOUT).getValue());
          request.setResponseTimeOutMs((int)parsePeriod(responseTimeout, DEFAULT_RESPONSE_TIMEOUT).getValue());
          request.setUrl(sUrl);
          try {
            LOGGER.info("Checking: "+sUrl);
            String response = Val.chkStr(request.readResponseAsCharacters());
            LOGGER.info("Response from: "+sUrl+" ="+response);
            if (response.equalsIgnoreCase("true")) {
              info.numActive++;
            } else if (response.equalsIgnoreCase("false")) {
              info.numInactive++;
View Full Code Here

    String requestUrl = this.makeQueryUrl(address, city, state, zip);

    HttpClientRequest client = HttpClientRequest.newRequest();
    client.setUrl(requestUrl);
    String sResponse = Val.chkStr(client.readResponseAsCharacters());

    if (sResponse.length() > 0) {
      try {

        JSONObject jso = new JSONObject(sResponse);
View Full Code Here

        HttpClientRequest clientRequest = HttpClientRequest.newRequest(
            HttpClientRequest.MethodName.GET, url.toExternalForm());
        // clientRequest.setConnectionTimeOut(getConnectionTimeout());
        //clientRequest.setResponseTimeOut(getResponseTimeout());
        clientRequest.execute();
        String response = clientRequest.readResponseAsCharacters();
        LOG.finer("Response from get Metadata url = " + url.toExternalForm()
            +"\n response = \n"+ response);
        record.setFullMetadata(response);
      } catch (MalformedURLException e) {
        ex = e;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.