SOAP .NET Example 2: Retrieving the list of profiles for a specified account
(Return to main article: Samples for .NET (SOAP) v1)
1. To use the types from the generated class without specifying the namespace, include the namespace as follows:
using SampleCode.com.google.DataAPI.AdminService;
2. Provide login and account information:
private const string login = "YOUR_LOGIN"; private const string password = "YOUR_PASSWORD"; private const int accountId = 4;
3. Define a service connection for AdminService:
adminservice adminService = new adminservice();
4. Execute request:
Profile[] profiles = adminService.getProfileList(login, password, accountId);
5. Display the information about retrieved profiles:
foreach (Profile profile in profiles) { Console.Write("Profile id is \"" + profile.profileId + "\", "); Console.Write("profile name is \"" + profile.profileName + "\", "); Console.Write("account id is \"" + profile.accountId + "\", "); Console.WriteLine("account name is \"" + profile.accountName + "\" "); }
Complete sample code for this example is available in the AdminServiceGetProfileListSOAP.cs file.
(Return to main article: Samples for .NET (SOAP) v1)