private void ListListsRequest_Click(object sender, EventArgs e) { //ListListsRequest // setup EMsgAPI object - EM EMsgAPI_Demo.EMsgAPI_ListLists_201101.ListListsService EM = new EMsgAPI_Demo.EMsgAPI_ListLists_201101.ListListsService(); // setup Authentication objects EMsgAPI_ListLists_201101.RequestAuthentication reqAuth = new EMsgAPI_ListLists_201101.RequestAuthentication(); EMsgAPI_ListLists_201101.XDDSAuthType XDDSAuth = new EMsgAPI_ListLists_201101.XDDSAuthType(); EMsgAPI_ListLists_201101.UIDType uid = new EMsgAPI_ListLists_201101.UIDType(); // init Authentication objects XDDSAuth.Password = txtAccessCode.Text; uid.Value = txtUserId.Text; XDDSAuth.RequesterID = uid; reqAuth.Item = XDDSAuth; // Setup Request and JobSummaryRequest / JobSummaryResult object EMsgAPI_Demo.EMsgAPI_ListLists_201101.Request Request = new EMsgAPI_Demo.EMsgAPI_ListLists_201101.Request(); EMsgAPI_Demo.EMsgAPI_ListLists_201101.Response Response = new EMsgAPI_Demo.EMsgAPI_ListLists_201101.Response(); EMsgAPI_Demo.EMsgAPI_ListLists_201101.ListListsRequest ListLists_Request = new EMsgAPI_Demo.EMsgAPI_ListLists_201101.ListListsRequest(); EMsgAPI_Demo.EMsgAPI_ListLists_201101.ListListsResult ListLists_Result = new EMsgAPI_Demo.EMsgAPI_ListLists_201101.ListListsResult(); // Set options of ListListsReqeust // Set the List ownership based on cmbListOwnership value switch (cmbListOwnership.Text) { case "customer": // customer level list ListLists_Request.Ownership = EMsgAPI_Demo.EMsgAPI_ListLists_201101.OwnershipLevelType.customer; break; case "user": // user level list ListLists_Request.Ownership = EMsgAPI_Demo.EMsgAPI_ListLists_201101.OwnershipLevelType.user; break; default: // default to system level list ListLists_Request.Ownership = EMsgAPI_Demo.EMsgAPI_ListLists_201101.OwnershipLevelType.system; break; } // switch // set ownershipSpecified value ListLists_Request.OwnershipSpecified = true; // Set the List store value (MessageREACH or XDDS) switch (cmbDomain.Text) { case "usme": case "flusme": // Email Lists //ListLists_Request.ListStore = EMsgAPI_Demo.EMsgAPI_ListLists_200810.ListStoreType.MR; ListLists_Request.ListStore = "MR"; break; case "xip": case "test2": // Fax or Voice Lists //ListLists_Request.ListStore = EMsgAPI_Demo.EMsgAPI_ListLists_200810.ListStoreType.XDDS; ListLists_Request.ListStore = "XDDS"; break; } // switch // Set Server URL and Proxy information if needed Set_Server_and_Proxy(EM); // Setup Reqeust Object Request.ReceiverKey = EM.Url; Request.Authentication = reqAuth; // Assign Request and Response objects to EM Object EM.RequestValue = Request; EM.ResponseValue = Response; // Try the ListCreate function call try { ListLists_Result = EM.ListLists(ListLists_Request); } catch (Exception ex) { System.Console.WriteLine(ex.Message); System.Console.Read(); return; } if (ListLists_Result.ListInfo != null) { int n; n = ListLists_Result.ListInfo.GetLength(0); string ListNames = ""; for (int i = 0; i < n; i++) { ListNames += ListLists_Result.ListInfo[i].ListId.Value + "\r\n"; } // for MessageBox.Show(ListNames.ToString(), "Lists"); } string emfilename = "emresponse.xml"; string resfilename = "result.xml"; //string reqfilename = "request.xml"; try { //This will output the response, result and request(if uncommented) to XML files in the //installed directory. This can be very usefull for debugging or ir help is requested from //the EMAPI support team if (chkResult) { serializeResult(emfilename, EM.ResponseValue); serializeResult(resfilename, ListLists_Result); //serializeResult(reqfilename, ListLists_Request); } } catch (IOException io_error) { MessageBox.Show("Error - " + io_error, "Error", MessageBoxButtons.OK); } }