I have got a connection to a salesforce webservice by the following method:

  • Get an EnterpriseConnection to the auth endpoint and so a session id
  • Set the service endpoint to that of the webservice
  • Get a SoapConnection to the web service

Now I'm assuming that I have to log out but am having the following issues:

  • SoapConnection does not have a logout() method.
  • If I try to log out of the EnterpriseConnection using its logout() method, I get the following error message:

com.sforce.ws.SoapFaultException: No operation available for request {urn:enterprise.soap.sforce.com}logout, please check the WSDL for the service

Is there a different way to log out when using webservices than when using just the EnterpriseConnection?


EDIT - Addition of code:

public static boolean login() {
    boolean success = false;

    try {
        ConnectorConfig config = new ConnectorConfig();
        config.setProxy(proxyAddress, 8080);

        enterpriseConnection = com.sforce.soap.enterprise.Connector.newConnection(config); // EnterpriseConnection object

        webserviceConnection = Connector.newConnection(config); // SoapConnectionObject

        success = true;
        System.out.print("Logged in to webservice- ");
        Date startTime = new Date();

    } catch(ConnectionException e) {

    return success;

public static void logout() {

    try {
        System.out.print("Logged out - ");
        Date endTime = new Date();

    } catch(ConnectionException e) {

1 Answer 1


Are you sure you are invoking the logout() method from the right Connection object?

Also make sure you are not sending the request to the wrong endpoint.

Enterprise API v/s Partner API.



I have used logout() in most of my code especially with C# and Java and never had an issue so far. Do you have any code you can share?

Other things could be the case...it needs to be lowercase. Also please check if your wsdl was saved properly. Does it have a definition for logout()?

Please see:


  • Hi Richard. Thanks for your response. I've added some code above. I'm definitely trying to logout with the enterpriseConnection which is pointed at the authEndPoint. The SoapConnector webservice is connected to my serviceEndPoint which is the webservice. I am using the enterprise wsdl for sure and have updated the webservice and the enterprise wsdl without success.
    – Joe
    Mar 1, 2013 at 17:26
  • Can you post what your "authEndPoint" is set to?
    – Richard N
    Mar 1, 2013 at 20:20
  • authEndpoint = https://test.salesforce.com/services/Soap/c/27.0/0DFxxxxxxxxxxxx
    – Joe
    Mar 4, 2013 at 9:12
  • serviceEndpoint = https://cs13-api.salesforce.com/services/Soap/class/NameOfWebservice
    – Joe
    Mar 4, 2013 at 9:13
  • Yup that is the Enterprise wsdl. Can you change it to just https://test.salesforce.com/services/Soap/c/27.0/ ?
    – Richard N
    Mar 4, 2013 at 16:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .