}
throw ex;
}
// Create Result
VirtualMachineVMImageGetDetailsResponse result = null;
// Deserialize Response
InputStream responseContent = httpResponse.getEntity().getContent();
result = new VirtualMachineVMImageGetDetailsResponse();
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(true);
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
Element vMImageDetailsElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "VMImageDetails");
if (vMImageDetailsElement != null) {
Element nameElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "Name");
if (nameElement != null) {
String nameInstance;
nameInstance = nameElement.getTextContent();
result.setName(nameInstance);
}
Element labelElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "Label");
if (labelElement != null) {
String labelInstance;
labelInstance = labelElement.getTextContent();
result.setLabel(labelInstance);
}
Element categoryElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "Category");
if (categoryElement != null) {
String categoryInstance;
categoryInstance = categoryElement.getTextContent();
result.setCategory(categoryInstance);
}
Element descriptionElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "Description");
if (descriptionElement != null) {
String descriptionInstance;
descriptionInstance = descriptionElement.getTextContent();
result.setDescription(descriptionInstance);
}
Element oSDiskConfigurationElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "OSDiskConfiguration");
if (oSDiskConfigurationElement != null) {
VirtualMachineVMImageListResponse.OSDiskConfiguration oSDiskConfigurationInstance = new VirtualMachineVMImageListResponse.OSDiskConfiguration();
result.setOSDiskConfiguration(oSDiskConfigurationInstance);
Element nameElement2 = XmlUtility.getElementByTagNameNS(oSDiskConfigurationElement, "http://schemas.microsoft.com/windowsazure", "Name");
if (nameElement2 != null) {
String nameInstance2;
nameInstance2 = nameElement2.getTextContent();
oSDiskConfigurationInstance.setName(nameInstance2);
}
Element hostCachingElement = XmlUtility.getElementByTagNameNS(oSDiskConfigurationElement, "http://schemas.microsoft.com/windowsazure", "HostCaching");
if (hostCachingElement != null) {
String hostCachingInstance;
hostCachingInstance = hostCachingElement.getTextContent();
oSDiskConfigurationInstance.setHostCaching(hostCachingInstance);
}
Element oSStateElement = XmlUtility.getElementByTagNameNS(oSDiskConfigurationElement, "http://schemas.microsoft.com/windowsazure", "OSState");
if (oSStateElement != null) {
String oSStateInstance;
oSStateInstance = oSStateElement.getTextContent();
oSDiskConfigurationInstance.setOSState(oSStateInstance);
}
Element osElement = XmlUtility.getElementByTagNameNS(oSDiskConfigurationElement, "http://schemas.microsoft.com/windowsazure", "OS");
if (osElement != null) {
String osInstance;
osInstance = osElement.getTextContent();
oSDiskConfigurationInstance.setOperatingSystem(osInstance);
}
Element mediaLinkElement = XmlUtility.getElementByTagNameNS(oSDiskConfigurationElement, "http://schemas.microsoft.com/windowsazure", "MediaLink");
if (mediaLinkElement != null) {
URI mediaLinkInstance;
mediaLinkInstance = new URI(mediaLinkElement.getTextContent());
oSDiskConfigurationInstance.setMediaLink(mediaLinkInstance);
}
Element logicalDiskSizeInGBElement = XmlUtility.getElementByTagNameNS(oSDiskConfigurationElement, "http://schemas.microsoft.com/windowsazure", "LogicalDiskSizeInGB");
if (logicalDiskSizeInGBElement != null) {
int logicalDiskSizeInGBInstance;
logicalDiskSizeInGBInstance = DatatypeConverter.parseInt(logicalDiskSizeInGBElement.getTextContent());
oSDiskConfigurationInstance.setLogicalDiskSizeInGB(logicalDiskSizeInGBInstance);
}
}
Element dataDiskConfigurationsSequenceElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "DataDiskConfigurations");
if (dataDiskConfigurationsSequenceElement != null) {
for (int i1 = 0; i1 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(dataDiskConfigurationsSequenceElement, "http://schemas.microsoft.com/windowsazure", "DataDiskConfiguration").size(); i1 = i1 + 1) {
org.w3c.dom.Element dataDiskConfigurationsElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(dataDiskConfigurationsSequenceElement, "http://schemas.microsoft.com/windowsazure", "DataDiskConfiguration").get(i1));
VirtualMachineVMImageListResponse.DataDiskConfiguration dataDiskConfigurationInstance = new VirtualMachineVMImageListResponse.DataDiskConfiguration();
result.getDataDiskConfigurations().add(dataDiskConfigurationInstance);
Element nameElement3 = XmlUtility.getElementByTagNameNS(dataDiskConfigurationsElement, "http://schemas.microsoft.com/windowsazure", "Name");
if (nameElement3 != null) {
String nameInstance3;
nameInstance3 = nameElement3.getTextContent();
dataDiskConfigurationInstance.setName(nameInstance3);
}
Element hostCachingElement2 = XmlUtility.getElementByTagNameNS(dataDiskConfigurationsElement, "http://schemas.microsoft.com/windowsazure", "HostCaching");
if (hostCachingElement2 != null) {
String hostCachingInstance2;
hostCachingInstance2 = hostCachingElement2.getTextContent();
dataDiskConfigurationInstance.setHostCaching(hostCachingInstance2);
}
Element lunElement = XmlUtility.getElementByTagNameNS(dataDiskConfigurationsElement, "http://schemas.microsoft.com/windowsazure", "Lun");
if (lunElement != null && (lunElement.getTextContent() == null || lunElement.getTextContent().isEmpty() == true) == false) {
int lunInstance;
lunInstance = DatatypeConverter.parseInt(lunElement.getTextContent());
dataDiskConfigurationInstance.setLogicalUnitNumber(lunInstance);
}
Element mediaLinkElement2 = XmlUtility.getElementByTagNameNS(dataDiskConfigurationsElement, "http://schemas.microsoft.com/windowsazure", "MediaLink");
if (mediaLinkElement2 != null) {
URI mediaLinkInstance2;
mediaLinkInstance2 = new URI(mediaLinkElement2.getTextContent());
dataDiskConfigurationInstance.setMediaLink(mediaLinkInstance2);
}
Element logicalDiskSizeInGBElement2 = XmlUtility.getElementByTagNameNS(dataDiskConfigurationsElement, "http://schemas.microsoft.com/windowsazure", "LogicalDiskSizeInGB");
if (logicalDiskSizeInGBElement2 != null) {
int logicalDiskSizeInGBInstance2;
logicalDiskSizeInGBInstance2 = DatatypeConverter.parseInt(logicalDiskSizeInGBElement2.getTextContent());
dataDiskConfigurationInstance.setLogicalDiskSizeInGB(logicalDiskSizeInGBInstance2);
}
}
}
Element serviceNameElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "ServiceName");
if (serviceNameElement != null) {
String serviceNameInstance;
serviceNameInstance = serviceNameElement.getTextContent();
result.setServiceName(serviceNameInstance);
}
Element deploymentNameElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "DeploymentName");
if (deploymentNameElement != null) {
String deploymentNameInstance;
deploymentNameInstance = deploymentNameElement.getTextContent();
result.setDeploymentName(deploymentNameInstance);
}
Element roleNameElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "RoleName");
if (roleNameElement != null) {
String roleNameInstance;
roleNameInstance = roleNameElement.getTextContent();
result.setRoleName(roleNameInstance);
}
Element affinityGroupElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "AffinityGroup");
if (affinityGroupElement != null) {
String affinityGroupInstance;
affinityGroupInstance = affinityGroupElement.getTextContent();
result.setAffinityGroup(affinityGroupInstance);
}
Element locationElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "Location");
if (locationElement != null) {
String locationInstance;
locationInstance = locationElement.getTextContent();
result.setLocation(locationInstance);
}
Element createdTimeElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "CreatedTime");
if (createdTimeElement != null && (createdTimeElement.getTextContent() == null || createdTimeElement.getTextContent().isEmpty() == true) == false) {
Calendar createdTimeInstance;
createdTimeInstance = DatatypeConverter.parseDateTime(createdTimeElement.getTextContent());
result.setCreatedTime(createdTimeInstance);
}
Element modifiedTimeElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "ModifiedTime");
if (modifiedTimeElement != null && (modifiedTimeElement.getTextContent() == null || modifiedTimeElement.getTextContent().isEmpty() == true) == false) {
Calendar modifiedTimeInstance;
modifiedTimeInstance = DatatypeConverter.parseDateTime(modifiedTimeElement.getTextContent());
result.setModifiedTime(modifiedTimeInstance);
}
Element languageElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "Language");
if (languageElement != null) {
String languageInstance;
languageInstance = languageElement.getTextContent();
result.setLanguage(languageInstance);
}
Element imageFamilyElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "ImageFamily");
if (imageFamilyElement != null) {
String imageFamilyInstance;
imageFamilyInstance = imageFamilyElement.getTextContent();
result.setImageFamily(imageFamilyInstance);
}
Element recommendedVMSizeElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "RecommendedVMSize");
if (recommendedVMSizeElement != null) {
String recommendedVMSizeInstance;
recommendedVMSizeInstance = recommendedVMSizeElement.getTextContent();
result.setRecommendedVMSize(recommendedVMSizeInstance);
}
Element isPremiumElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "IsPremium");
if (isPremiumElement != null && (isPremiumElement.getTextContent() == null || isPremiumElement.getTextContent().isEmpty() == true) == false) {
boolean isPremiumInstance;
isPremiumInstance = DatatypeConverter.parseBoolean(isPremiumElement.getTextContent().toLowerCase());
result.setIsPremium(isPremiumInstance);
}
Element eulaElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "Eula");
if (eulaElement != null) {
String eulaInstance;
eulaInstance = eulaElement.getTextContent();
result.setEula(eulaInstance);
}
Element iconUriElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "IconUri");
if (iconUriElement != null) {
URI iconUriInstance;
iconUriInstance = new URI(iconUriElement.getTextContent());
result.setIconUri(iconUriInstance);
}
Element smallIconUriElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "SmallIconUri");
if (smallIconUriElement != null) {
URI smallIconUriInstance;
smallIconUriInstance = new URI(smallIconUriElement.getTextContent());
result.setSmallIconUri(smallIconUriInstance);
}
Element privacyUriElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "PrivacyUri");
if (privacyUriElement != null) {
URI privacyUriInstance;
privacyUriInstance = new URI(privacyUriElement.getTextContent());
result.setPrivacyUri(privacyUriInstance);
}
Element publisherNameElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "PublisherName");
if (publisherNameElement != null) {
String publisherNameInstance;
publisherNameInstance = publisherNameElement.getTextContent();
result.setPublisherName(publisherNameInstance);
}
Element publishedDateElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "PublishedDate");
if (publishedDateElement != null && (publishedDateElement.getTextContent() == null || publishedDateElement.getTextContent().isEmpty() == true) == false) {
Calendar publishedDateInstance;
publishedDateInstance = DatatypeConverter.parseDateTime(publishedDateElement.getTextContent());
result.setPublishedDate(publishedDateInstance);
}
Element showInGuiElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "ShowInGui");
if (showInGuiElement != null && (showInGuiElement.getTextContent() == null || showInGuiElement.getTextContent().isEmpty() == true) == false) {
boolean showInGuiInstance;
showInGuiInstance = DatatypeConverter.parseBoolean(showInGuiElement.getTextContent().toLowerCase());
result.setShowInGui(showInGuiInstance);
}
Element pricingDetailLinkElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "PricingDetailLink");
if (pricingDetailLinkElement != null) {
URI pricingDetailLinkInstance;
pricingDetailLinkInstance = new URI(pricingDetailLinkElement.getTextContent());
result.setPricingDetailLink(pricingDetailLinkInstance);
}
Element isCorruptedElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "IsCorrupted");
if (isCorruptedElement != null && (isCorruptedElement.getTextContent() == null || isCorruptedElement.getTextContent().isEmpty() == true) == false) {
boolean isCorruptedInstance;
isCorruptedInstance = DatatypeConverter.parseBoolean(isCorruptedElement.getTextContent().toLowerCase());
result.setIsCorrupted(isCorruptedInstance);
}
Element publishedNameElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "PublishedName");
if (publishedNameElement != null) {
String publishedNameInstance;
publishedNameInstance = publishedNameElement.getTextContent();
result.setPublishedName(publishedNameInstance);
}
Element sharingStatusElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "SharingStatus");
if (sharingStatusElement != null) {
String sharingStatusInstance;
sharingStatusInstance = sharingStatusElement.getTextContent();
result.setSharingStatus(sharingStatusInstance);
}
Element replicationProgressSequenceElement = XmlUtility.getElementByTagNameNS(vMImageDetailsElement, "http://schemas.microsoft.com/windowsazure", "ReplicationProgress");
if (replicationProgressSequenceElement != null) {
for (int i2 = 0; i2 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(replicationProgressSequenceElement, "http://schemas.microsoft.com/windowsazure", "ReplicationProgressElement").size(); i2 = i2 + 1) {
org.w3c.dom.Element replicationProgressElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(replicationProgressSequenceElement, "http://schemas.microsoft.com/windowsazure", "ReplicationProgressElement").get(i2));
VirtualMachineVMImageGetDetailsResponse.ReplicationProgressElement replicationProgressElementInstance = new VirtualMachineVMImageGetDetailsResponse.ReplicationProgressElement();
result.getReplicationProgress().add(replicationProgressElementInstance);
Element locationElement2 = XmlUtility.getElementByTagNameNS(replicationProgressElement, "http://schemas.microsoft.com/windowsazure", "Location");
if (locationElement2 != null) {
String locationInstance2;
locationInstance2 = locationElement2.getTextContent();
replicationProgressElementInstance.setLocation(locationInstance2);
}
Element progressElement = XmlUtility.getElementByTagNameNS(replicationProgressElement, "http://schemas.microsoft.com/windowsazure", "Progress");
if (progressElement != null) {
String progressInstance;
progressInstance = progressElement.getTextContent();
replicationProgressElementInstance.setProgress(progressInstance);
}
}
}
}
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);
}