Examples of HostedServiceCheckNameAvailabilityResponse


Examples of com.microsoft.windowsazure.management.compute.models.HostedServiceCheckNameAvailabilityResponse

                }
                throw ex;
            }
           
            // Create Result
            HostedServiceCheckNameAvailabilityResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new HostedServiceCheckNameAvailabilityResponse();
            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
           
            Element availabilityResponseElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "AvailabilityResponse");
            if (availabilityResponseElement != null) {
                Element resultElement = XmlUtility.getElementByTagNameNS(availabilityResponseElement, "http://schemas.microsoft.com/windowsazure", "Result");
                if (resultElement != null) {
                    boolean resultInstance;
                    resultInstance = DatatypeConverter.parseBoolean(resultElement.getTextContent().toLowerCase());
                    result.setIsAvailable(resultInstance);
                }
               
                Element reasonElement = XmlUtility.getElementByTagNameNS(availabilityResponseElement, "http://schemas.microsoft.com/windowsazure", "Reason");
                if (reasonElement != null) {
                    String reasonInstance;
                    reasonInstance = reasonElement.getTextContent();
                    result.setReason(reasonInstance);
                }
            }
           
            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);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.