From d73c24bbd690902b2b87cd2bc6d5169f98d60cd2 Mon Sep 17 00:00:00 2001 From: "Niels Erik G. Nielsen" Date: Wed, 29 May 2013 13:12:26 -0400 Subject: [PATCH] Fixes bug in return of non-record XML response --- .../indexdata/mkjsf/pazpar2/commands/RecordCommand.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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."); } -- 1.7.10.4