1/**
2 * Code to create Sub-Accounts. Applicable to Embedded Clients.
3 * Account Type is called "Agency-Client" in Code it is PRO_CONNECT_CLIENT
4 */
5public void CreateAccount()
6{
7 string strAttributes = "";
8 string status = null; // overall status flag
9 string requestID = null;
10 // '---------------------------------------------
11 // '****** CREATINFG NULL ARRAY OF CREATE RESULT.
12 CreateResult[] results;
13 //'----------------------------------------------
14 //'****** CREATING NEW INSTANCE OF ACCOUNT CLASS.
15 Account objNewAccount = new Account();
16 //'----------------------------------------------------------------
17 //'****** SETTING ALL REQUIRED VALUES FOR THE ACCOUNT CREATION.
18 objNewAccount.Name = "OMNIE Account";
19 objNewAccount.PartnerKey = partnerKey;
20 objNewAccount.FromName = "OMNIE Account";
21 objNewAccount.BusinessName = "OMNIE Account";
22 objNewAccount.Email = "johndoe@example.com";
23 objNewAccount.Address = "D - 108, Sector - II";
24 objNewAccount.City = "Chicago";
25 objNewAccount.State = "IL";
26 objNewAccount.Zip = "20130";
27 objNewAccount.EditionID = 3; //EditionID for Agency Edition
28 objNewAccount.EditionIDSpecified = true;
29 objNewAccount.AccountType = AccountTypeEnum.PRO_CONNECT_CLIENT;
30 try
31 {
32 // '****** SENDING REQUEST TO THE EXACT TARGET TO CREATE THE ACCOUNT.
33 results = soapClient.Create(null, new APIObject[] {
34 objNewAccount} , out requestID, out status);
35 Console.WriteLine(status);
36 Console.WriteLine(results[0].StatusCode.ToString());
37 Console.WriteLine(results[0].StatusMessage.ToString());
38 Console.WriteLine(results[0].ErrorCode.ToString());
39 Console.WriteLine(results[0].NewID.ToString());
40 }
41 catch (Exception e)
42 {
43 Console.WriteLine(e.Message);
44 }
45}