private void JobSubmitRequestSMStoList_Click(object sender, EventArgs e) { //JobSubmitRequest SMS to List // setup Authentication objects EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.Authentication EMAuthentication = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.Authentication(); EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.XDDSAuthType XDDSAuth = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.XDDSAuthType(); // init Authentication objects XDDSAuth.Password = txtAccessCode.Text; XDDSAuth.RequesterID = txtUserId.Text; EMAuthentication.XDDSAuth = XDDSAuth; // Setup MessageObject EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.MessageType[] JS_Message = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.MessageType[1]; JS_Message[0] = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.MessageType(); // Setup JobOptions - CREF, Billing Code, FAX EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.JobOptionsType JS_JobOptions = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.JobOptionsType(); EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.EncodableStringType JS_CRef = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.EncodableStringType(); EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.EncodableStringType JS_BCode = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.EncodableStringType(); EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.SmsOptionsType JS_SMSOptions = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.SmsOptionsType(); // set CREF and Billing Code if (txtBC.Text.Length > 0) { JS_BCode.Value = txtBC.Text; JS_JobOptions.BillingCode = JS_BCode; } // BC if (txtCRef.Text.Length > 0) { JS_CRef.Value = txtCRef.Text; JS_JobOptions.CustomerReference = JS_CRef; } // CRef // Set JobOptions as SMSOptions JS_JobOptions.SmsOptions = JS_SMSOptions; // Set Message Object JS_Message[0].JobOptions = JS_JobOptions; // Free Objects JS_JobOptions = null; JS_SMSOptions = null; JS_CRef = null; JS_BCode = null; // Setup Documents EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.DocumentType[] JS_Documents = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.DocumentType[2]; JS_Documents[0] = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.DocumentType(); // Setup reusable variables for the document EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.DocDataType DocData = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.DocDataType(); // Setup Document 1 - PDF DocData.format = EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.DocEncodingFormat.text; DocData.Value = txtSMSMessage.Text; JS_Documents[0].Item = DocData; EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.EncodableStringType myFileName = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.EncodableStringType(); myFileName.Value = "txtmessage.txt"; JS_Documents[0].Filename = myFileName; JS_Documents[0].DocType = "text"; JS_Documents[0].ItemElementName = EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.ItemChoiceType.DocData; JS_Documents[0].@ref = "textmessage"; DocData = null; if (UseCSVList.Checked == true) { string File; // Setup Document 2 - CSV List DocData = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.DocDataType(); File = ReadAndEncodedFile(txtCSVList.Text, true); DocData.format = EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.DocEncodingFormat.base64; DocData.Value = File; JS_Documents[1] = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.DocumentType(); JS_Documents[1].Item = DocData; myFileName.Value = "CSVList.csv"; JS_Documents[1].Filename = myFileName; JS_Documents[1].DocType = "text"; JS_Documents[1].ItemElementName = EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.ItemChoiceType.DocData; JS_Documents[1].@ref = "CSVList1"; DocData = null; } // (UseCSVList.Checked == true) // Setup Content EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.ContentPartType[] JS_Content = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.ContentPartType[1]; JS_Content[0] = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.ContentPartType(); // Setup references to documents JS_Content[0].Item = "textmessage"; JS_Content[0].Treatment = EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.TreatmentType.body; JS_Content[0].TreatmentSpecified = true; if (UseCSVList.Checked == true) // Pass in a CSV List with Job Submit { // Setup table for list // List was loaded in document section must be added as a Table in Content Section EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.TableType[] CSVList_Table = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.TableType[1]; CSVList_Table[0] = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.TableType(); CSVList_Table[0].Item = "CSVList1"; CSVList_Table[0].@ref = "CSVList_Table1"; JS_Message[0].Destinations = CSVList_Table; CSVList_Table = null; } else // Use a previously stored list { // Setup List Object EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.ListType[] lists = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.ListType[1]; lists[0] = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.ListType(); lists[0].ownershipLevel = EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.OwnershipLevelType.customer; lists[0].ownershipLevelSpecified = true; lists[0].Name = txtStoredList.Text; // Name of stored list lists[0].@ref = "Stored Fax List"; JS_Message[0].Destinations = lists; lists = null; } // Setup Report Options EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.ReportOptionsType JS_Report = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.ReportOptionsType(); EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.ReportOptionsTypeDeliveryReport DeliveryReport = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.ReportOptionsTypeDeliveryReport(); DeliveryReport.DeliveryReportType = EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.MainReportTypeEnum.none; JS_Report.DeliveryReport = DeliveryReport; JS_Message[0].Reports = JS_Report; JS_Message[0].Contents = JS_Content; JS_Message[0].MessageId = System.Environment.MachineName + DateTime.Now; JS_Content = null; // Everything is Setup Prepare to Launch Job // setup EMsgAPI object - EM EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.XOA EM = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.XOA(); // Setup Request and JobSubmitRequest object EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.Request Request = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.Request(); EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.Response Response = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.Response(); EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.JobSubmitRequest JS_Request = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.JobSubmitRequest(); EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.JobSubmitResult JS_Result = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.JobSubmitResult(); // Setup Proxy server and EMsgAPIConnect URL for posting data Set_Server_and_Proxy(EM); // Setup Reqeust Object Request.ReceiverKey = EM.Url; Request.Authentication = EMAuthentication; Request.ResultRequired = EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.RequiredType.yes; Request.ResponseRequiredSpecified = true; // Assign Reqeust and Response objects to EM Object EM.RequestValue = Request; EM.ResponseValue = Response; JS_Request.Message = JS_Message; JS_Request.DocumentSet = JS_Documents; try { JS_Result = EM.JobSubmit(JS_Request); } catch (Exception ex) { System.Console.WriteLine(ex.Message); System.Console.Read(); return; } if (JS_Result.Status.StatusCode != null) { string JobNumber; JobNumber = JS_Result.MessageResult[0].JobId.XDN + ":" + JS_Result.MessageResult[0].JobId.MRN; txtJobNumber.Text = JobNumber; } }