Package com.google.greaze.definition

Examples of com.google.greaze.definition.WebServiceSystemException


    if (responseCode >= 400 || GreazeStrings.isNotEmpty(errorReason)) {
      ErrorReason reason = GreazeStrings.isEmpty(errorReason)
          ? ErrorReason.fromHttpResponseCode(responseCode)
              : ErrorReason.valueOf(errorReason);
      String msg = Streams.readAsString(conn.getInputStream());
      throw new WebServiceSystemException(reason, "Server input: " + msg);
    }
  }
View Full Code Here


  public void callAsync(WebServiceCallSpec callSpec, WebServiceRequest request,
      ResponseCallback responseCallback) {
    try {
      queue.put(new QueueEntry(callSpec, request, responseCallback));
    } catch (InterruptedException e) {
      throw new WebServiceSystemException(ErrorReason.UNEXPECTED_RETRYABLE_ERROR, e);
    }
  }
View Full Code Here

   static String decodeUrlParam(String urlParamValue) {
    try {
      return URLDecoder.decode(urlParamValue, "UTF-8");
    } catch (UnsupportedEncodingException e) {
      throw new WebServiceSystemException(e);
    }
  }
View Full Code Here

      R requestBody = requestData.hasRequestBody()
        ? (R) requestData.getRequestBody().getSimpleBody() : null;
      return createRequest(requestData.getMethod(), requestData.getHeaders(),
          requestData.getUrlParams(), resourceId, requestBody, requestData.isInlined());
    } catch (IOException e) {
      throw new WebServiceSystemException(e);
    } catch (JsonParseException e) {
      // Not a Web service request
      throw new WebServiceSystemException(e);
    }
  }
View Full Code Here

  public WebServiceRequest receive(HttpServletRequest request) {
    try {
      RequestData requestData = RequestData.create(request, spec, gson);
      return requestData.get();
    } catch (IOException e) {
      throw new WebServiceSystemException(e);
    } catch (JsonParseException e) {
      // Not a Web service request
      throw new WebServiceSystemException(e);
    }
  }
View Full Code Here

  public void send(HttpServletResponse conn, WebServiceResponse response) {
    try {
      sendHeaders(conn, response.getHeaders());
      sendBody(conn, response.getBody());
    } catch (IOException e) {
      throw new WebServiceSystemException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.google.greaze.definition.WebServiceSystemException

Copyright © 2018 www.massapicom. 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.