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 Example 1 (v1): Retrieving the list of accounts for an authenticated user

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

(Return to main article: Samples for Java (SOAP) v1)

1. Define login information:


private static final String login = "URCHIN_LOGIN";
private static final String password = "URCHIN_PASSWORD";

2. Define a service connection for the AdminService API:


AdminserviceStub adminStub = new AdminserviceStub();

3. Define a request for the getAccountList method in the AdminService:


AdminserviceStub.GetAccountList accReq = new AdminserviceStub.GetAccountList();

4. Set up the getAccountList request parameters:



5. Retrieve the list of available accounts:


AdminserviceStub.GetAccountListResponse accRsp = adminStub.getAccountList(accReq);

6. Parse and display the response:


      if (accRsp != null){
        AdminserviceStub.GetAccountListResponseSequence [] responseSequence = accRsp.getGetAccountListResponseSequence();
        // Display accounts info
        for (AdminserviceStub.GetAccountListResponseSequence account : responseSequence) {
          System.out.print("account id: \"" + account.localAccount.getAccountId() + "\", ");
          System.out.print("account name: \"" + account.localAccount.getAccountName() + "\", ");
          System.out.print("contact name: \"" + account.localAccount.getContactName() + "\", ");
          System.out.print("e-mail: \""  + account.localAccount.getEmailAddress() + "\", ");
          System.out.println("phone number: \"" + account.localAccount.getPhoneNumber() + "\".");

For the complete sample code, see the implementation of GetAccountList() in the file.

(Return to main article: Samples for Java (SOAP) v1)

Clear search
Close search
Google apps
Main menu