private void ListCreateRequest_Click(object sender, EventArgs e) { //ListCreateRequest // Setup Premiere Connect Object EMsgAPI_Demo.EMsgAPI_ListCreate_200810.XOA EM = new EMsgAPI_Demo.EMsgAPI_ListCreate_200810.XOA(); // setup Authentication objects EMsgAPI_Demo.EMsgAPI_ListCreate_200810.Authentication EMAuthentication = new EMsgAPI_Demo.EMsgAPI_ListCreate_200810.Authentication(); EMsgAPI_Demo.EMsgAPI_ListCreate_200810.XDDSAuthType XDDSAuth = new EMsgAPI_Demo.EMsgAPI_ListCreate_200810.XDDSAuthType(); // init Authentication objects XDDSAuth.Password = txtAccessCode.Text; XDDSAuth.RequesterID = txtUserId.Text; EMAuthentication.XDDSAuth = XDDSAuth; // Setup Request and JobSummaryRequest / JobSummaryResult object EMsgAPI_Demo.EMsgAPI_ListCreate_200810.Request Request = new EMsgAPI_Demo.EMsgAPI_ListCreate_200810.Request(); EMsgAPI_Demo.EMsgAPI_ListCreate_200810.Response Response = new EMsgAPI_Demo.EMsgAPI_ListCreate_200810.Response(); EMsgAPI_Demo.EMsgAPI_ListCreate_200810.ListCreateRequest ListCreate_Request = new EMsgAPI_Demo.EMsgAPI_ListCreate_200810.ListCreateRequest(); EMsgAPI_Demo.EMsgAPI_ListCreate_200810.ListCreateResult ListCreate_Result = new EMsgAPI_Demo.EMsgAPI_ListCreate_200810.ListCreateResult(); // Configure ListCreateReqeust object ListCreate_Request.CreateOption = EMsgAPI_Demo.EMsgAPI_ListCreate_200810.CreateOptionType.CreateOrReplace; ListCreate_Request.CreateOptionSpecified = true; // Create ListIdType Object EMsgAPI_Demo.EMsgAPI_ListCreate_200810.ListIdType ListID = new EMsgAPI_Demo.EMsgAPI_ListCreate_200810.ListIdType(); // Set the List ownership based on cmbListOwnership value switch(cmbListOwnership.Text) { case "customer": // customer level list ListID.ownership = EMsgAPI_Demo.EMsgAPI_ListCreate_200810.OwnershipLevelType.customer; break; case "user": // user level list ListID.ownership = EMsgAPI_Demo.EMsgAPI_ListCreate_200810.OwnershipLevelType.user; break; default: // default to system level list ListID.ownership = EMsgAPI_Demo.EMsgAPI_ListCreate_200810.OwnershipLevelType.system; break; } // switch // set ownershipSpecified value ListID.ownershipSpecified = true; // Set the List store value (MessageREACH or XDDS) switch (cmbDomain.Text) { case "usme": case "flusme": // Email Lists ListID.liststore = EMsgAPI_Demo.EMsgAPI_ListCreate_200810.ListStoreType.MR; break; case "xip": case "test2": // Fax or Voice Lists ListID.liststore = EMsgAPI_Demo.EMsgAPI_ListCreate_200810.ListStoreType.XDDS; break; } // switch // Set List Name ListID.Value = txtListName.Text; // Set ListCreate_Reqeuest ListId object to ListId just created ListCreate_Request.ListId = ListID; // Free ListId object ListID = null; // Setup Documents EMsgAPI_Demo.EMsgAPI_ListCreate_200810.DocumentType[] Documents = new EMsgAPI_Demo.EMsgAPI_ListCreate_200810.DocumentType[1]; Documents[0] = new EMsgAPI_Demo.EMsgAPI_ListCreate_200810.DocumentType(); // Read in CSV file to attach for upload // Setup reusable variables for the document EMsgAPI_Demo.EMsgAPI_ListCreate_200810.DocDataType DocData = new EMsgAPI_Demo.EMsgAPI_ListCreate_200810.DocDataType(); string File; File = ReadAndEncodedFile(txtCSVList.Text, true); DocData.format = EMsgAPI_Demo.EMsgAPI_ListCreate_200810.DocEncodingFormat.base64; DocData.Value = File; Documents[0].Item = DocData; Documents[0].Filename = "CSVList.csv"; Documents[0].ItemElementName = EMsgAPI_Demo.EMsgAPI_ListCreate_200810.ItemChoiceType.DocData; Documents[0].@ref = "CSVList"; Documents[0].DocType = "text"; DocData = null; // Setup Table for List EMsgAPI_Demo.EMsgAPI_ListCreate_200810.TableType[] CSVList_Table = new EMsgAPI_Demo.EMsgAPI_ListCreate_200810.TableType[1]; CSVList_Table[0] = new EMsgAPI_Demo.EMsgAPI_ListCreate_200810.TableType(); CSVList_Table[0].Item = Documents[0]; CSVList_Table[0].@ref = "CSVList"; // Assign List to the ListCreate Object ListCreate_Request.ListContents = CSVList_Table; // Free CSVList_Table CSVList_Table = null; // Set Server URL and Proxy information if needed Set_Server_and_Proxy(EM); // Setup Request object Request.ReceiverKey = EM.Url; Request.Authentication = EMAuthentication; Request.ResultRequired = EMsgAPI_Demo.EMsgAPI_ListCreate_200810.RequiredType.yes; Request.ResponseRequiredSpecified = true; // Assign Request and Response objects to EM Object EM.RequestValue = Request; EM.ResponseValue = Response; // Try the ListCreate function call try { ListCreate_Result = EM.ListCreate(ListCreate_Request); } catch (Exception ex) { System.Console.WriteLine(ex.Message); System.Console.Read(); return; } }