logout()

Ends the session of the logged-in user.

Syntax

LogoutResult = binding.logout();

Usage

This call ends the session for the logged-in user issuing the call. No arguments are needed.

To end one or more sessions started by someone other than the logged-in user, see invalidateSessions().

Sample Code—Java

public void logout() {
    try {
        binding.logout();
    }
    catch (Exception e) {
        System.out.println("Unexpected error:\n\n" + e.getMessage());
    }
}

Sample Code—C#

public void Logout() {
    try {
        binding.Logout();
    }
    catch (Exception e) {
        Console.WriteLine("Unexpected error:\n\n" + e.Message);
    }
}

Arguments

This call uses no arguments. It ends the session for the logged-in user issuing the call, so no arguments are needed. The logged-in user is identified by the sessionId specified in the SessionHeader for this call.

Response

Void is returned. Because failure of the call means that the session has already been logged out, no results are needed. Any unexpected error, such as system unavailability, throws an error that should be handled by your client application.

Faults

UnexpectedErrorFault

© Copyright 2000-2009 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.