Martin Kalin の著書「Web Services Up and running」の第 4 章に取り組んでいます。
HttpResponse
RestfulTeams の演習では、次のような安らかな WSの単純な値を返すメソッドがあります。
private Source response_to_client(String msg) {
HttpResponse response = new HttpResponse();
response.setResponse(msg);
ByteArrayInputStream stream = encode_to_stream(response);
return new StreamSource(stream);
}
しかし、クラスを取得できるJavaのライブラリは見つかりませんでしたHttpResponse
(ただし、上記の方法のようにこのオブジェクトを直接作成できるとは思いません)。
これを修正する方法についての説明は役に立ちます。