Exemplo n.º 1
0
  private static DemoRestService2 client() {

    final JSONProvider jsonProvider = new JSONProvider();
    jsonProvider.setDropRootElement(true);
    jsonProvider.setSupportUnwrapped(true);
    jsonProvider.setDropCollectionWrapperElement(true);
    jsonProvider.setSerializeAsArray(true);

    final List<JSONProvider> providers = newArrayList(jsonProvider);

    return JAXRSClientFactory.create(
        "http://localhost:8080/rest/v2.0/", DemoRestService2.class, providers);
  }
 private void registerJsonProvider() {
   JSONProvider jsonProvider = new JSONProvider();
   jsonProvider.setSupportUnwrapped(false);
   jsonProvider.setSerializeAsArray(true);
   ProviderFactory.getSharedInstance().registerUserProvider(jsonProvider);
 }