Package com.google.greaze.definition.webservice

Examples of com.google.greaze.definition.webservice.WebServiceResponse


      HeaderMapSpec paramSpec = spec.getHeadersSpec();
      ResponseBodySpec bodySpec = spec.getBodySpec();
      // read response
      HeaderMap responseParams = readResponseHeaders(conn, paramSpec);
      ResponseBody responseBody = readResponseBody(conn, bodySpec);
      return new WebServiceResponse(responseParams, responseBody);
    } catch (IOException e) {
      throw new WebServiceSystemException(e);
    }
  }
View Full Code Here


    }
  }

  private void consume(QueueEntry entry) {
    try {
      WebServiceResponse response = client.getResponse(entry.callSpec, entry.request, gson);
      WebServiceCall call = new WebServiceCall(entry.callSpec, entry.request, response);
      if (entry.responseCallback != null) {
        entry.responseCallback.handleResponse(call);
      }
    } catch (WebServiceSystemException e) {
View Full Code Here

    RequestBody requestBody = new RequestBody.Builder(requestSpec.getBodySpec())
      .build();
    UrlParams urlParams = new UrlParams.Builder(requestSpec.getUrlParamsSpec(), query).build();
    WebServiceRequest request = new WebServiceRequest(
        HttpMethod.GET, requestHeadersBuilder.build(), urlParams, requestBody, inlined);
    WebServiceResponse response = stub.getResponse(callSpec, request, gson);
    ResponseBody body = response.getBody();
    // Using a local variable for listBody otherwise Maven freaks out while compiling
    List<Object> listBody = body.getListBody();
    return (List)listBody;
  }
View Full Code Here

      .setListBody(resourceQuery.getResourceType())
      .build();
    ResponseBody responseBody = new ResponseBody.Builder(bodySpec)
      .setListBody(results)
      .build();
    WebServiceResponse response = new WebServiceResponse(responseHeaders, responseBody);
    Gson gson = gsonBuilder.get()
        .registerTypeAdapterFactory(new ResponseBodyGsonTypeAdapterFactory(bodySpec))
        .create();
    ResponseSender responseSender = new ResponseSender(gson);
    responseSender.send(res, response);
View Full Code Here

  RequestBody requestBody = new RequestBody.Builder(spec.getRequestSpec().getBodySpec())
      .put(TypedKeys.RequestBody.CART, cart)
      .build();
  WebServiceRequest request = new WebServiceRequest(
      HttpMethod.POST, requestHeaders, urlParams, requestBody, false);
  WebServiceResponse response = wsClient.getResponse(spec, request, gson);
  return response.getBody().get(TypedKeys.ResponseBody.ORDER);
  }
View Full Code Here

    Gson gson = injector.getInstance(GsonBuilder.class)
        .registerTypeAdapterFactory(new ResponseBodyGsonTypeAdapterFactory(responseSpec.getBodySpec()))
        .create();
    ResponseSender responseSender = new ResponseSender(gson);
    WebServiceResponse response = buildResponse(responseSpec, webServiceRequest);
    responseSender.send(res, response);
  }
View Full Code Here

    // Empty headers per the spec
    HeaderMap responseHeaders = new HeaderMap.Builder(responseSpec.getHeadersSpec()).build();
    ResponseBody responseBody = new ResponseBody.Builder(responseSpec.getBodySpec())
        .put(TypedKeys.ResponseBody.ORDER, order)
        .build();
    return new WebServiceResponse(responseHeaders, responseBody);
  }
View Full Code Here

TOP

Related Classes of com.google.greaze.definition.webservice.WebServiceResponse

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.