Passing the user credentials

Once we know that a connection can be established, all following calls must supply user credentials. Switch uses HTTP basic authentication for this.

Note: Again, the procedure to set up basic authentication and set the username and password is very system-specific, so we do not go into detail here.  Refer to the samples to see how this is done in Java/Axis and PHP.

The username must be the name of a user as defined in the Switch UI, followed by a semicolon and the two-letter code ‘EN’.  For example, when using the pre-defined “Administrator” user (which has an empty password), the username will be "Administrator;EN".

To check the username and password, we use the CheckUserNameAndPass call:
  <soap:Body xmlns:butterfly="http://tempuri.org/butterfly.xsd">    
    <butterfly:CheckUserNameAndPass/>
  </soap:Body>  

This call will fail if the username or password are incorrect, and returns a reserved integer if the credentials are OK, e.g.:

  <soap:Body xmlns:butterfly="http://tempuri.org/butterfly.xsd">    
    <butterfly:CheckUserNameAndPassResponse>
      <param-3>2</param-3>    
    </butterfly:CheckUserNameAndPassResponse>
  </soap:Body>