/// <summary> /// Retrieve a previously accepted Package from the GSCCCA Real Estate eFiling system /// </summary> /// <param name="gscccaID">The GSCCCAID of the Accepted package being requested</param> /// <returns>A Package object that contains infromation about the Accepted package including filings /// and recording informations. If the Package /// could not be retrieved, does not exist, or is not Accepted, a NULL package Object is returned. Check the Status property of the FilingHandler /// and the RawXMLResponse Property for more information</returns> public Package GetAcceptedPackage(Guid gscccaID) { //reset variables clearStatus(); this.rawrequest = "<getAcceptedPackage>" + gscccaID.ToString() + "</getAcceptedPackage>"; //make the request and record the reponse string xml = PRIARetrieveRecordedPackage(gscccaID.ToString()); this.rawresponse = xml; //process the response. Package p = null; bool responseOK = processResponse(xml, "RECORDED"); if (responseOK) { PRIA_RESPONSE_GROUP_Type response = createPriaResponse(xml); if (response.RESPONSE[0].RESPONSE_DATA != null && response.RESPONSE[0].RESPONSE_DATA.Count > 0 && response.RESPONSE[0].RESPONSE_DATA[0] != null && response.RESPONSE[0].RESPONSE_DATA[0].PACKAGE != null) { p = Package.FromPriaPackage(response.RESPONSE[0].RESPONSE_DATA[0].PACKAGE); } else { this.status = "Error in response package. Please check the xml that was returned"; } } return(p); }
/// <summary> /// Retrieve a previously rejected package from the GSCCCA Real Estate eFiling systme /// </summary> /// <param name="gscccaID">The GSCCCAID of the rejected package being requested</param> /// <returns>A Package object that contains information about the rejected package. THe package object will NOT contain /// filings, rather only the reasons provided for rejected. If the package /// could not be retrieved, does not exist, or is not rejected, a NULL package Object is returned. Check the Status property of the FilingHandler /// and the RawXMLResponse Property for more information</returns> public Package GetRejectedPackage(Guid gscccaID) { //reset variables clearStatus(); this.rawrequest = "<getRejectedPackage>" + gscccaID.ToString() + "</getRejectedPackage>"; //make the request and record the reponse string xml = PRIARetrieveRejectedPackage(gscccaID.ToString()); this.rawresponse = xml; //process the response. Package p = null; bool responseOK = processResponse(xml, "REJECTED"); if (responseOK) { p = new Package(); p.GSCCCAID = gscccaID; PRIA_RESPONSE_GROUP_Type response = createPriaResponse(xml); if (response.RESPONSE[0].STATUS[0].RECORDING_ERROR != null) { foreach (PRIA_RECORDING_ERROR_Type err in response.RESPONSE[0].STATUS[0].RECORDING_ERROR) { RejectionReason r = new RejectionReason(err._Description); p.ReasonsForRejection.Add(r); } } } return(p); }
/// <summary> /// Given an xml pria response, checks the status string of the response and compares it to a user provided desired response. The status text of the /// status document can be found in the Status property of this object after this method is called. /// </summary> /// <param name="xml">The xml of a pria response document</param> /// <param name="desiredResponse">The status description used to compare against the status actually contained with the status document</param> /// <returns>True if the response matches the user specified desired response, false otherwise</returns> private bool processResponse(string xml, string desiredResponse) { bool okResponse = false; PRIA_RESPONSE_GROUP_Type response = createPriaResponse(xml); if (response == null) { status = "Error parsing response from GSCCCA. Please review the XML returned from GSCCCA."; } else { string description = ""; if (response.RESPONSE != null && response.RESPONSE.Count > 0 && response.RESPONSE[0] != null && response.RESPONSE[0].STATUS != null && response.RESPONSE[0].STATUS.Count > 0 && response.RESPONSE[0].STATUS[0] != null) { description = response.RESPONSE[0].STATUS[0]._Description.Trim().ToUpper(); status = description; if (description == desiredResponse.Trim().ToUpper()) { okResponse = true; } } } return(okResponse); }
/// <summary> /// Retrieves a pending Real estate package from the GSCCCA eFiling system. /// </summary> /// <param name="gscccaID">The GSCCCAID of the package being requested.</param> /// <returns>A Package object that contains infromation about the pending filings including document images. If the package /// could not be retrieved or does not exist, a NULL Package Object is returned. Check the Status property of the FilingHandler /// and the RawXMLResponse Property for more information</returns> public Package GetPendingPackage(Guid gscccaID) { //reset variables clearStatus(); this.rawrequest = "<getPendingPackage>" + gscccaID.ToString() + "</getPendingPackage>"; //make the request and record the reponse string xml = PRIAGetPendingPackage(gscccaID.ToString()); this.rawresponse = xml; //process the response. Package p = null; bool responseOK = processResponse(xml, "RECEIVED"); if (responseOK) { PRIA_RESPONSE_GROUP_Type response = createPriaResponse(xml); if (response.RESPONSE[0].RESPONSE_DATA != null && response.RESPONSE[0].RESPONSE_DATA.Count > 0 && response.RESPONSE[0].RESPONSE_DATA[0] != null && response.RESPONSE[0].RESPONSE_DATA[0].PACKAGE != null) { p = Package.FromPriaPackage(response.RESPONSE[0].RESPONSE_DATA[0].PACKAGE); if (p == null) { this.status = "Error in response package. Please check the xml that was returned"; } else { //set the filer informatoin if (response.RESPOND_TO_PARTY != null) { FilingParty filer = FilingParty.FromPriaRespondToParty(response.RESPOND_TO_PARTY); p.OriginalFiler = filer; } } } else { this.status = "Error in response package. Please check the xml that was returned"; } } return(p); }
/// <summary> /// Creates a strongly typed PRIA_RESPONSE_GROUP object from the xml provided /// </summary> /// <param name="xml">XML string representing a pria response</param> /// <returns>A strongly typed PRIA_RESPONSE_GROUP object if the xml was parsable, null otherwise</returns> private PRIA_RESPONSE_GROUP_Type createPriaResponse(string xml) { PRIA_RESPONSE_GROUP_Type priaResponse = null; try { StringReader sr; XmlReader reader; XmlSerializer xs; XmlReaderSettings settings; sr = new StringReader(xml); settings = new XmlReaderSettings(); settings.IgnoreWhitespace = true; reader = XmlReader.Create(sr, settings); xs = new XmlSerializer(typeof(PRIA_RESPONSE_GROUP_Type)); priaResponse = (PRIA_RESPONSE_GROUP_Type)xs.Deserialize(reader); } catch { } return(priaResponse); }
/// <summary> /// Creates a List of strings representing GSCCCAIDs of all pending packages on the GSCCCA real estate eFiling portal /// </summary> /// <param name="xml">The xml of the pria response containing the document list</param> /// <returns>A List of strings of GSCCCAIDs of all pending packages</returns> private List <string> createPackageList(string xml) { List <string> filings = null; bool responseExpected = processResponse(xml, "RECEIVED"); if (responseExpected) { filings = new List <string>(); PRIA_RESPONSE_GROUP_Type response = createPriaResponse(xml); if (response.RESPONSE[0].RESPONSE_DATA != null && response.RESPONSE[0].RESPONSE_DATA.Count > 0) { foreach (PRIA_RESPONSE_Type priaResponse in response.RESPONSE[0].RESPONSE_DATA) { if (priaResponse.PACKAGE != null) { filings.Add(priaResponse.PACKAGE._Identifier); } } } } return(filings); }