D4Science D4Science Don't have a D4Science account? Create one Could not find what you are looking for? Contact us.

Files and Libraries

Java JSON Client Library

Created May 9, 2022

groupId
org.gcube.social-networking
artifactId
auto-social-client

The Java client-side library is used to provide the set of Java objects that can be serialized to/from JSON using Jackson. This is useful for accessing the JSON REST endpoints that are published by this application.

Resources Example (Raw JAXB)
java.net.URL url = new java.net.URL(baseURL + "/2/messages/write-message");
ObjectMapper mapper = new ObjectMapper();
java.net.URLConnection connection = url.openConnection();
connection.setDoOutput(true);
connection.connect();

mapper.writeValue(connection.getOutputStream(), messageInputBean);
Object result = (Object) mapper.readValue( connection.getInputStream(), Object.class );
//handle the result as needed...
    
Resources Example (Jersey client)
javax.ws.rs.client.Client client = javax.ws.rs.client.ClientBuilder.newClient();

Object result = client.target(baseUrl + "/2/messages/write-message")
  .post(javax.ws.rs.client.Entity.entity(messageInputBean, "application/json"), Object.class);

//handle the result as needed...
    

Files
name size description
social-service-client.jar 52.89K The binaries for the Java JSON client library.