From: Niels Erik G. Nielsen Date: Wed, 29 May 2013 17:12:26 +0000 (-0400) Subject: Fixes bug in return of non-record XML response X-Git-Tag: v0.0.7~72 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=d73c24bbd690902b2b87cd2bc6d5169f98d60cd2;p=mkjsf-moved-to-github.git Fixes bug in return of non-record XML response --- diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/RecordCommand.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/RecordCommand.java index c163aba..e9c4b54 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/RecordCommand.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/RecordCommand.java @@ -30,21 +30,21 @@ public class RecordCommand extends Pazpar2Command implements ServiceProxyCommand responseObject = ResponseParser.getParser().getDataObject((ClientCommandResponse)commandResponse); if (ResponseParser.docTypes.contains(responseObject.getType())) { logger.debug("Storing " + responseObject.getType() + " in pzresp. "); - } else { + } else { logger.debug("Command was 'record' but response not '' - assuming raw record response."); - ResponseDataObject recordResponse = new RecordResponse(); + ResponseDataObject recordResponse = new RecordResponse(); recordResponse.setType("record"); - recordResponse.setXml(responseObject.getXml()); - recordResponse.setAttribute("activeclients", "0"); + recordResponse.setXml(responseObject.getXml()); + recordResponse.setAttribute("activeclients", "0"); + responseObject = recordResponse; } } else if (commandResponse.isBinary()) { - responseObject = new RecordResponse(); + responseObject = new RecordResponse(); responseObject.setType(getCommandName()); logger.info("Binary response"); responseObject.setAttribute("activeclients", "0"); responseObject.setXml("binary response"); responseObject.setBinary(commandResponse.getBytes()); - } else { logger.error("Response was not found to be XML or binary. The response was not handled."); }