DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
InOut me = client.createInOutExchange();
me.setService(new QName("urn:test", "xquery-dynamic"));
me.getInMessage().setContent(new StreamSource(getClass().getResourceAsStream("/books.xml")));
me.getInMessage().setProperty("xquery.source", getClass().getResource("/query.xq"));
client.sendSync(me);
if (me.getStatus() == ExchangeStatus.ERROR) {
if (me.getError() != null) {
throw me.getError();
} else {
fail("Received ERROR status");