if (__log.isDebugEnabled()) {
__log.debug("request " + request.toString());
}
exp.bindItem(XQConstants.CONTEXT_ITEM, xqconn.createItemFromNode(requestNode, xqconn.createNodeType()));
XQResultSequence result = exp.executeQuery();
MockQueryResponseDocument response = MockQueryResponseDocument.Factory.parse(result.getSequenceAsStream());
{
XmlOptions opts = new XmlOptions();
List<Object> errors = new ArrayList<Object>();
opts.setErrorListener(errors);
if (!response.validate(opts)) {
__log.error("MockQuery response doesn't validate. Errors: " + errors + " Request: " + request.toString() + " Response: " + response.toString(), new Exception());
throw new IllegalStateException("MockQuery response doesn't validate.");
}
}
ResponseType response2 = response.getMockQueryResponse();
if (__log.isDebugEnabled()) {
__log.debug("mockQuery result " + response);
}