//--- setup get-record-by-id request
request = new GetRecordByIdRequest(sc);
request.setElementSetName(ElementSetName.FULL);
CswOperation oper = server.getOperation(CswServer.GET_RECORD_BY_ID);
// Use the preferred HTTP method and check one exist.
if (oper.getGetUrl() != null && Harvester.PREFERRED_HTTP_METHOD.equals("GET")) {
request.setUrl(oper.getGetUrl());
request.setMethod(GET);
} else if (oper.getPostUrl() != null && Harvester.PREFERRED_HTTP_METHOD.equals("POST")) {
request.setUrl(oper.getPostUrl());
request.setMethod(POST);
} else {
if (oper.getGetUrl() != null) {
request.setUrl(oper.getGetUrl());
request.setMethod(GET);
} else if (oper.getPostUrl() != null) {
request.setUrl(oper.getPostUrl());
request.setMethod(POST);
} else {
throw new OperationAbortedEx("No GET or POST DCP available in this service.");
}
}
if(oper.getPreferredOutputSchema() != null) {
request.setOutputSchema(oper.getPreferredOutputSchema());
}
if(oper.getPreferredServerVersion() != null) {
request.setServerVersion(oper.getPreferredServerVersion());
}
if (params.useAccount) {
request.setCredentials(params.username, params.password);
}