/// <summary>
        /// Used to bring back and parse the context response for a virtual machine
        /// </summary>
        /// <param name="webResponse">the Http web response</param>
        protected override void ResponseCallback(HttpWebResponse webResponse)
        {
            XDocument vmDocument;

            using (var reader = new StreamReader(webResponse.GetResponseStream()))
            {
                vmDocument = XDocument.Parse(reader.ReadToEnd());
            }
            var virtualMachine = new StatefulVirtualMachineSerialiser(vmDocument);

            PersistentVm = virtualMachine.GetVmRoles();
            SitAndWait.Set();
        }
コード例 #2
0
        /// <summary>
        /// Used to bring back and parse the context response for a virtual machine
        /// </summary>
        /// <param name="webResponse">the Http web response</param>
        protected override void ResponseCallback(HttpWebResponse webResponse)
        {
            XDocument vmDocument;

            using (var reader = new StreamReader(webResponse.GetResponseStream()))
            {
                vmDocument = XDocument.Parse(reader.ReadToEnd());
            }
            var virtualMachine = new StatefulVirtualMachineSerialiser(vmDocument);

            // issue occurring here which is not bubbling up the exception
            try
            {
                PersistentVm = virtualMachine.GetVmRoles();
            }
            catch (Exception ex)
            {
                ResponseStackTrace = ex.ToString();
            }
            SitAndWait.Set();
        }