// String variables to hold the required client keys private const string product_dode = ""; // Convert the binary data in the uploaded file to Base64Encoded string data private string convertFileToBase64(string fileName) { string returnValue = fileName; if (File.Exists(fileName)) { FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); BinaryReader br = new BinaryReader(fs); byte[] binaryStream = br.ReadBytes((int)fs.Length); returnValue = Convert.ToBase64String(binaryStream); br.Close(); fs.Close(); fs.Dispose(); } return returnValue; } // Parse the resume on button click and display results in textarea protected void btn_parse_Click(object sender, EventArgs e) { // Instantiate the web service object com.resumeparser.processing.ParsingToolsService hireability = new com.resumeparser.processing.ParsingToolsService(); string encoded = null; string file_name = ""; if(file_upload.HasFile) try { file_upload.SaveAs("C:\\Resumes\\" + file_upload.FileName); encoded = convertFileToBase64("C:\\Resumes\\" + file_upload.FileName); file_name = file_upload.FileName; // Remove the file off server File.Delete("C:\\Resumes\\" + file_upload.FileName); // If the file contents are encoded, call the parsing request if (encoded != null) this.output.InnerText = hireability.ParseDocNew(product_code, file_name, encoded, "", "", "", ""); } catch (Exception ex) { error.InnerText = "ERROR: " + ex.Message.ToString(); } else { error.InnerText = "ERROR: You have not specified a file."; } } protected void btn_retrieve_Click(object sender, EventArgs e) { // Instantiate the web service object com.resumeparser.processing.ParsingToolsService hireability = new com.resumeparser.processing.ParsingToolsService(); try { this.output.InnerText = hireability.retrieveCompletedDocsNew(product_code, "", ""); } catch(Exception ex) { error.InnerText = "ERROR: " + ex.Message.ToString(); } }