private BComGetPortOutsResponse lnpResponseWrapperStatus() { // Create an HTTPS_ Interface. HTTPS_Interface httpsInterface = new HTTPS_Interface(); // Send the request and get the response. BComGetPortOutsResponse response = httpsInterface.lnpResponseWrapper(); // Return the response. return(response); }
protected void Page_Load(object sender, EventArgs e) { // Clear the page. Response.Clear(); // Set the type to XML. Response.ContentType = "text/xml"; //Response.ContentType = "text/plain"; // For debuggin purposes. // Declare a response. this.response = new GetPortOutsReponse(); // Create a database interface. try { this.db = new DB(); } catch (Exception ex) { this.response.SetJeop( "Unable to open a database connection: " + ex.Message); Response.Write(this.response.ToXml()); this.db.Close(); return; } // Declare the response. BComGetPortOutsResponse lnpResponseWrapper = null; // Get the response. try { lnpResponseWrapper = lnpResponseWrapperStatus(); } catch (Exception Ex) { new ApplicationException("Cannot get Port Outs information from Bandwidth. " + Ex.Message); } if (lnpResponseWrapper.LNPResponseWrapper != null) { // Insert into database. foreach (lnpPortInfoForGivenStatus l in lnpResponseWrapper.LNPResponseWrapper) { try { db.UpdatePortOuts(l.accountId.SafeToString(), l.CountOfTNs.SafeToString(), l.userId.SafeToString(), l.lastModifiedDate.SafeToString(), l.OrderDate.SafeToString(), l.OrderId.SafeToString(), l.OrderType.SafeToString(), l.CompanyName.SafeToString(), l.ErrorCode.SafeToString(), l.ErrorMessage.SafeToString(), l.FullNumber.SafeToString(), l.ProcessingStatus.SafeToString(), l.RequestedFOCDate.SafeToString(), l.VendorId.SafeToString(), l.PON.SafeToString()); } catch (Exception Ex) { return; } } } // Set Action to Complete. this.response.SetComplete(); Response.Write(this.response.ToXml()); this.db.Close(); return; }