} \r
if (cfg != null) {\r
try {\r
- client = new Pazpar2ClientGeneric(cfg); \r
+ client = new Pazpar2ClientGeneric(cfg); \r
} catch (ProxyErrorException pe) {\r
logger.error("Could not configure Pazpar2 client: " + pe.getMessage());\r
throw new ConfigurationException("Could not configure Pz2Client: "+ pe.getMessage(),pe);\r
pz2HttpResponse = client.executeCommand(clientCommand, baos);\r
if (pz2HttpResponse.getStatusCode()==200 && pz2HttpResponse.getContentType().contains("xml")) {\r
commandResponse = new ClientCommandResponse(pz2HttpResponse,baos);\r
+ } else if (pz2HttpResponse.getStatusCode()==200 && pz2HttpResponse.getContentType().contains("octet-stream")) {\r
+ commandResponse = new ClientCommandResponse(pz2HttpResponse,baos);\r
+ logger.info("Content type: " + commandResponse.getContentType() + ". isBinary?: " + commandResponse.isBinary());\r
} else if (pz2HttpResponse.getStatusCode()==417) {\r
logger.error("Pazpar2 status code 417: " + baos.toString("UTF-8"));\r
commandResponse = new ClientCommandResponse(pz2HttpResponse.getStatusCode(),CommandError.insertErrorXml(command.getCommandName(), String.valueOf(pz2HttpResponse.getStatusCode()) ,"Pazpar2: Expectation failed (417)", baos.toString("UTF-8")),"text/xml"); \r
\r
@Override \r
public void setServiceUrl (String serviceUrl) { \r
- cfg.PAZPAR2_URL = serviceUrl;\r
- \r
+ cfg.PAZPAR2_URL = serviceUrl; \r
+ }\r
+ \r
+ public String getServiceId () {\r
+ return cfg.PAZPAR2_SERVICE_ID;\r
+ }\r
+ \r
+ public void setServiceId(String serviceId) {\r
+ cfg.PAZPAR2_SERVICE_ID = serviceId;\r
+ try {\r
+ client = new Pazpar2ClientGeneric(cfg); \r
+ } catch (ProxyErrorException pe) {\r
+ logger.error("Could not configure Pazpar2 client: " + pe.getMessage()); \r
+ }\r
}\r
\r
}\r