final String xmlResponse = prepareClient(APPLICATION).type(MediaType.MULTIPART_FORM_DATA_TYPE)
.post(String.class, form);
try {
if (!isCallSuccessful(xmlResponse)) {
throw new DeploymentException(getMessage(xmlResponse));
}
} catch (XPathExpressionException e) {
throw new DeploymentException("Error finding exit code or message", e);
}
// Call has been successful, now we need another call to get the list of servlets
final String subComponentsResponse = prepareClient(LIST_SUB_COMPONENTS + this.deploymentName).get(String.class);
return this.parseForProtocolMetaData(subComponentsResponse);
} catch (XPathExpressionException e) {
throw new DeploymentException("Error in creating / deploying archive", e);
}
}