Urchin WebAnalytics Software is discontinued and is no longer supported. All Urchin documentation applies only to the Urchin product as it was at the time of discontinuation, and does not apply to any Google Analytics products or services.

SOAP_NET Example 1 (v1): Retrieving the list of accounts for an authenticated user

SOAP .NET Example 1: Retrieving the list of accounts for an authenticated user

(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. Specify login information:

 

private const string login = "YOUR_LOGIN";
private const string password = "YOUR_PASSWORD";

3. Define a service connection for AdminService API:

 

adminservice adminService = new adminservice();

4. Execute request:

 

Account[] accounts = adminService.getAccountList(login, password);

5. Parse and display results:

 

    foreach (Account account in accounts)
    {
      Console.Write("Account id is \"" + account.accountId + "\", ");
      Console.Write("name is \"" + account.accountName + "\", ");
      Console.Write("contact name is \"" + account.contactName + "\", ");
      Console.Write("e-mail is \"" + account.emailAddress + "\" ");
      Console.WriteLine("and phone number is \"" + account.phoneNumber + "\".");
    }

Complete sample code for this example is available in the AdminServiceGetAccountListSOAP.cs file.

(Return to main article: Samples for .NET (SOAP) v1)

 
true
Search
Clear search
Close search
Google apps
Main menu
Search Help Center
false