}
throw ex;
}
// Create Result
ServiceObjectiveGetResponse result = null;
// Deserialize Response
InputStream responseContent = httpResponse.getEntity().getContent();
result = new ServiceObjectiveGetResponse();
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(true);
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
Element serviceResourceElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "ServiceResource");
if (serviceResourceElement != null) {
ServiceObjective serviceResourceInstance = new ServiceObjective();
result.setServiceObjective(serviceResourceInstance);
Element idElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "Id");
if (idElement != null) {
String idInstance;
idInstance = idElement.getTextContent();
serviceResourceInstance.setId(idInstance);
}
Element isDefaultElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "IsDefault");
if (isDefaultElement != null) {
boolean isDefaultInstance;
isDefaultInstance = DatatypeConverter.parseBoolean(isDefaultElement.getTextContent().toLowerCase());
serviceResourceInstance.setIsDefault(isDefaultInstance);
}
Element isSystemElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "IsSystem");
if (isSystemElement != null) {
boolean isSystemInstance;
isSystemInstance = DatatypeConverter.parseBoolean(isSystemElement.getTextContent().toLowerCase());
serviceResourceInstance.setIsSystem(isSystemInstance);
}
Element descriptionElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "Description");
if (descriptionElement != null) {
String descriptionInstance;
descriptionInstance = descriptionElement.getTextContent();
serviceResourceInstance.setDescription(descriptionInstance);
}
Element enabledElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "Enabled");
if (enabledElement != null) {
boolean enabledInstance;
enabledInstance = DatatypeConverter.parseBoolean(enabledElement.getTextContent().toLowerCase());
serviceResourceInstance.setEnabled(enabledInstance);
}
Element dimensionSettingsSequenceElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "DimensionSettings");
if (dimensionSettingsSequenceElement != null) {
for (int i1 = 0; i1 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(dimensionSettingsSequenceElement, "http://schemas.microsoft.com/windowsazure", "ServiceResource").size(); i1 = i1 + 1) {
org.w3c.dom.Element dimensionSettingsElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(dimensionSettingsSequenceElement, "http://schemas.microsoft.com/windowsazure", "ServiceResource").get(i1));
ServiceObjective.DimensionSettingResponse serviceResourceInstance2 = new ServiceObjective.DimensionSettingResponse();
serviceResourceInstance.getDimensionSettings().add(serviceResourceInstance2);
Element idElement2 = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "Id");
if (idElement2 != null) {
String idInstance2;
idInstance2 = idElement2.getTextContent();
serviceResourceInstance2.setId(idInstance2);
}
Element descriptionElement2 = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "Description");
if (descriptionElement2 != null) {
String descriptionInstance2;
descriptionInstance2 = descriptionElement2.getTextContent();
serviceResourceInstance2.setDescription(descriptionInstance2);
}
Element ordinalElement = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "Ordinal");
if (ordinalElement != null) {
byte ordinalInstance;
ordinalInstance = DatatypeConverter.parseByte(ordinalElement.getTextContent());
serviceResourceInstance2.setOrdinal(ordinalInstance);
}
Element isDefaultElement2 = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "IsDefault");
if (isDefaultElement2 != null) {
boolean isDefaultInstance2;
isDefaultInstance2 = DatatypeConverter.parseBoolean(isDefaultElement2.getTextContent().toLowerCase());
serviceResourceInstance2.setIsDefault(isDefaultInstance2);
}
Element nameElement = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "Name");
if (nameElement != null) {
String nameInstance;
nameInstance = nameElement.getTextContent();
serviceResourceInstance2.setName(nameInstance);
}
Element typeElement = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "Type");
if (typeElement != null) {
String typeInstance;
typeInstance = typeElement.getTextContent();
serviceResourceInstance2.setType(typeInstance);
}
Element stateElement = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "State");
if (stateElement != null) {
String stateInstance;
stateInstance = stateElement.getTextContent();
serviceResourceInstance2.setState(stateInstance);
}
}
}
Element nameElement2 = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "Name");
if (nameElement2 != null) {
String nameInstance2;
nameInstance2 = nameElement2.getTextContent();
serviceResourceInstance.setName(nameInstance2);
}
Element typeElement2 = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "Type");
if (typeElement2 != null) {
String typeInstance2;
typeInstance2 = typeElement2.getTextContent();
serviceResourceInstance.setType(typeInstance2);
}
Element stateElement2 = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "State");
if (stateElement2 != null) {
String stateInstance2;
stateInstance2 = stateElement2.getTextContent();
serviceResourceInstance.setState(stateInstance2);
}
}
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);
}