Comment annuler une chaîne de réponse JSON dans l'objet correct en utilisant le client de repos Apache CXF?Réponse unmarsal du client Apache CXF
Ci-dessous est ma mise en œuvre qui appelle le point de fin de repos. J'utilise Apache CXF 2.6.14
S'il vous plaît ne pas que l'état de la réponse me dira quel objet se déchaîner dans.
public Object redeem(String client, String token) throws IOException {
WebClient webClient = getWebClient();
webClient.path(redeemPath, client);
Response response = webClient.post(token);
InputStream stream = (InputStream) response.getEntity();
//unmarshal the value
String value = IOUtils.toString(stream);
if (response.getStatus() != 200) {
//unmarshall into Error object and return
} else {
//unmarshall into Token object and return
}
}