bean.getOutInterceptors().add(sigInterceptor);
bean.getInInterceptors().add(new XmlSigInInterceptor());
WebClient wc = bean.createWebClient();
try {
Book book;
if (!fromResponse) {
book = wc.post(new Book("CXF", 126L), Book.class);
} else {
book = wc.post(new Book("CXF", 126L)).readEntity(Book.class);
}
assertEquals(126L, book.getId());
} catch (WebApplicationException ex) {
fail(ex.getMessage());
} catch (ProcessingException ex) {
if (ex.getCause() != null && ex.getCause().getMessage() != null) {
fail(ex.getCause().getMessage());