}
throw ex;
}
// Create Result
SubscriptionGetResponse result = null;
// Deserialize Response
InputStream responseContent = httpResponse.getEntity().getContent();
result = new SubscriptionGetResponse();
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(true);
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
Element subscriptionElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "Subscription");
if (subscriptionElement != null) {
Element subscriptionIDElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "SubscriptionID");
if (subscriptionIDElement != null) {
String subscriptionIDInstance;
subscriptionIDInstance = subscriptionIDElement.getTextContent();
result.setSubscriptionID(subscriptionIDInstance);
}
Element subscriptionNameElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "SubscriptionName");
if (subscriptionNameElement != null) {
String subscriptionNameInstance;
subscriptionNameInstance = subscriptionNameElement.getTextContent();
result.setSubscriptionName(subscriptionNameInstance);
}
Element subscriptionStatusElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "SubscriptionStatus");
if (subscriptionStatusElement != null) {
SubscriptionStatus subscriptionStatusInstance;
subscriptionStatusInstance = SubscriptionStatus.valueOf(subscriptionStatusElement.getTextContent());
result.setSubscriptionStatus(subscriptionStatusInstance);
}
Element accountAdminLiveEmailIdElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "AccountAdminLiveEmailId");
if (accountAdminLiveEmailIdElement != null) {
String accountAdminLiveEmailIdInstance;
accountAdminLiveEmailIdInstance = accountAdminLiveEmailIdElement.getTextContent();
result.setAccountAdminLiveEmailId(accountAdminLiveEmailIdInstance);
}
Element serviceAdminLiveEmailIdElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "ServiceAdminLiveEmailId");
if (serviceAdminLiveEmailIdElement != null) {
String serviceAdminLiveEmailIdInstance;
serviceAdminLiveEmailIdInstance = serviceAdminLiveEmailIdElement.getTextContent();
result.setServiceAdminLiveEmailId(serviceAdminLiveEmailIdInstance);
}
Element maxCoreCountElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "MaxCoreCount");
if (maxCoreCountElement != null) {
int maxCoreCountInstance;
maxCoreCountInstance = DatatypeConverter.parseInt(maxCoreCountElement.getTextContent());
result.setMaximumCoreCount(maxCoreCountInstance);
}
Element maxStorageAccountsElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "MaxStorageAccounts");
if (maxStorageAccountsElement != null) {
int maxStorageAccountsInstance;
maxStorageAccountsInstance = DatatypeConverter.parseInt(maxStorageAccountsElement.getTextContent());
result.setMaximumStorageAccounts(maxStorageAccountsInstance);
}
Element maxHostedServicesElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "MaxHostedServices");
if (maxHostedServicesElement != null) {
int maxHostedServicesInstance;
maxHostedServicesInstance = DatatypeConverter.parseInt(maxHostedServicesElement.getTextContent());
result.setMaximumHostedServices(maxHostedServicesInstance);
}
Element currentCoreCountElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "CurrentCoreCount");
if (currentCoreCountElement != null) {
int currentCoreCountInstance;
currentCoreCountInstance = DatatypeConverter.parseInt(currentCoreCountElement.getTextContent());
result.setCurrentCoreCount(currentCoreCountInstance);
}
Element currentStorageAccountsElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "CurrentStorageAccounts");
if (currentStorageAccountsElement != null) {
int currentStorageAccountsInstance;
currentStorageAccountsInstance = DatatypeConverter.parseInt(currentStorageAccountsElement.getTextContent());
result.setCurrentStorageAccounts(currentStorageAccountsInstance);
}
Element currentHostedServicesElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "CurrentHostedServices");
if (currentHostedServicesElement != null) {
int currentHostedServicesInstance;
currentHostedServicesInstance = DatatypeConverter.parseInt(currentHostedServicesElement.getTextContent());
result.setCurrentHostedServices(currentHostedServicesInstance);
}
Element maxVirtualNetworkSitesElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "MaxVirtualNetworkSites");
if (maxVirtualNetworkSitesElement != null) {
int maxVirtualNetworkSitesInstance;
maxVirtualNetworkSitesInstance = DatatypeConverter.parseInt(maxVirtualNetworkSitesElement.getTextContent());
result.setMaximumVirtualNetworkSites(maxVirtualNetworkSitesInstance);
}
Element currentVirtualNetworkSitesElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "CurrentVirtualNetworkSites");
if (currentVirtualNetworkSitesElement != null) {
int currentVirtualNetworkSitesInstance;
currentVirtualNetworkSitesInstance = DatatypeConverter.parseInt(currentVirtualNetworkSitesElement.getTextContent());
result.setCurrentVirtualNetworkSites(currentVirtualNetworkSitesInstance);
}
Element maxLocalNetworkSitesElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "MaxLocalNetworkSites");
if (maxLocalNetworkSitesElement != null) {
int maxLocalNetworkSitesInstance;
maxLocalNetworkSitesInstance = DatatypeConverter.parseInt(maxLocalNetworkSitesElement.getTextContent());
result.setMaximumLocalNetworkSites(maxLocalNetworkSitesInstance);
}
Element maxDnsServersElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "MaxDnsServers");
if (maxDnsServersElement != null) {
int maxDnsServersInstance;
maxDnsServersInstance = DatatypeConverter.parseInt(maxDnsServersElement.getTextContent());
result.setMaximumDnsServers(maxDnsServersInstance);
}
Element currentLocalNetworkSitesElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "CurrentLocalNetworkSites");
if (currentLocalNetworkSitesElement != null) {
int currentLocalNetworkSitesInstance;
currentLocalNetworkSitesInstance = DatatypeConverter.parseInt(currentLocalNetworkSitesElement.getTextContent());
result.setCurrentLocalNetworkSites(currentLocalNetworkSitesInstance);
}
Element currentDnsServersElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "CurrentDnsServers");
if (currentDnsServersElement != null) {
int currentDnsServersInstance;
currentDnsServersInstance = DatatypeConverter.parseInt(currentDnsServersElement.getTextContent());
result.setCurrentDnsServers(currentDnsServersInstance);
}
}
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);
}