public Transferable doService(Transferable request, Credential credential, URL facadeUrl, String dcpType, LicenseReference licenseReference) throws ServiceException {
String additionalPathInfo = (String) request.getAttributeValue(TransferAttribute.PATHINFO_ATTR);
if (additionalPathInfo == null) {
additionalPathInfo = "";
}
String additionalQueryString = (String) request.getAttributeValue(TransferAttribute.QUERY_STRING_ATTR);
if (additionalQueryString == null) {
additionalQueryString = "";
}
List<HttpHeaderAttribute> headersList = new LinkedList<>();
for (TransferAttribute attrib : request.getAttributes()) {
if (attrib instanceof HttpHeaderAttribute) {
headersList.add((HttpHeaderAttribute) attrib);
}
}
HttpHeaderAttribute[] headers = headersList.toArray(new HttpHeaderAttribute[headersList.size()]);
String postXML = createPostXML("1.1", credential, request, facadeUrl, dcpType, licenseReference);
String uri = MessageFormat.format("{0}{1}?{2}", getWssURLString(), additionalPathInfo, additionalQueryString);
HTTPContentRequest httpRequest = httpClientFactory.create(uri).post().contentType("text/xml", "UTF-8");
for (HttpHeaderAttribute httpHeaderAttribute : headers) {
if (headerNameIs(httpHeaderAttribute, "Content-Type") || headerNameIs(httpHeaderAttribute, "Content-Encoding")) {
continue;
}
httpRequest.header(httpHeaderAttribute.getName(), (String) httpHeaderAttribute.getValue());
}
httpRequest.content(postXML);
return execute(httpRequest);
}