}
throw ex;
}
// Create Result
RecoverDatabaseOperationCreateResponse result = null;
// Deserialize Response
InputStream responseContent = httpResponse.getEntity().getContent();
result = new RecoverDatabaseOperationCreateResponse();
DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance();
documentBuilderFactory2.setNamespaceAware(true);
DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder();
Document responseDoc = documentBuilder2.parse(new BOMInputStream(responseContent));
Element serviceResourceElement2 = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "ServiceResource");
if (serviceResourceElement2 != null) {
RecoverDatabaseOperation serviceResourceInstance = new RecoverDatabaseOperation();
result.setOperation(serviceResourceInstance);
Element requestIDElement = XmlUtility.getElementByTagNameNS(serviceResourceElement2, "http://schemas.microsoft.com/windowsazure", "RequestID");
if (requestIDElement != null) {
String requestIDInstance;
requestIDInstance = requestIDElement.getTextContent();
serviceResourceInstance.setId(requestIDInstance);
}
Element sourceServerNameElement2 = XmlUtility.getElementByTagNameNS(serviceResourceElement2, "http://schemas.microsoft.com/windowsazure", "SourceServerName");
if (sourceServerNameElement2 != null) {
String sourceServerNameInstance;
sourceServerNameInstance = sourceServerNameElement2.getTextContent();
serviceResourceInstance.setSourceServerName(sourceServerNameInstance);
}
Element sourceDatabaseNameElement2 = XmlUtility.getElementByTagNameNS(serviceResourceElement2, "http://schemas.microsoft.com/windowsazure", "SourceDatabaseName");
if (sourceDatabaseNameElement2 != null) {
String sourceDatabaseNameInstance;
sourceDatabaseNameInstance = sourceDatabaseNameElement2.getTextContent();
serviceResourceInstance.setSourceDatabaseName(sourceDatabaseNameInstance);
}
Element targetDatabaseNameElement2 = XmlUtility.getElementByTagNameNS(serviceResourceElement2, "http://schemas.microsoft.com/windowsazure", "TargetDatabaseName");
if (targetDatabaseNameElement2 != null) {
String targetDatabaseNameInstance;
targetDatabaseNameInstance = targetDatabaseNameElement2.getTextContent();
serviceResourceInstance.setTargetDatabaseName(targetDatabaseNameInstance);
}
Element nameElement = XmlUtility.getElementByTagNameNS(serviceResourceElement2, "http://schemas.microsoft.com/windowsazure", "Name");
if (nameElement != null) {
String nameInstance;
nameInstance = nameElement.getTextContent();
serviceResourceInstance.setName(nameInstance);
}
Element typeElement = XmlUtility.getElementByTagNameNS(serviceResourceElement2, "http://schemas.microsoft.com/windowsazure", "Type");
if (typeElement != null) {
String typeInstance;
typeInstance = typeElement.getTextContent();
serviceResourceInstance.setType(typeInstance);
}
Element stateElement = XmlUtility.getElementByTagNameNS(serviceResourceElement2, "http://schemas.microsoft.com/windowsazure", "State");
if (stateElement != null) {
String stateInstance;
stateInstance = stateElement.getTextContent();
serviceResourceInstance.setState(stateInstance);
}
}
result.setStatusCode(statusCode);
if (httpResponse.getHeaders("x-ms-request-id").length > 0) {
result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue());
}
if (shouldTrace) {
CloudTracing.exit(invocationId, result);
}