Start of Content Area

Procedure documentation Establishing a CBS Connection  Locate the document in its SAP Library structure

Many commands require that a valid CBS connection exists.

Example

Without a valid CBS connection you will receive an error message like in the following example:

:cbs>bsstate -b rtest1

Invalid command usage:There is no valid connection. Please connect first before executing this command. Enter 'help <command name>' to get information on correct command usage.

The syntax of the command was correct. But as no valid connection to CBS existed at this point in time the command could not be executed. 

...

       1.      To create a CBS connection via command connect you have to specify (at least) the CBS URL

       2.      Enter a valid user/password combination. Next example shows the syntax of command connect:

Example

:cbs>connect –c http://server:port -u someuser -p rightpwd

In case that the specified user/password combination is not valid on the CBS you will get an error message as follows:

:cbs>connect –c http://server:port -u someuser -p wrongpwd

Error while checking connection.

User not authorized to log into build server. ( Service call exception; nested exception is:        com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (401) Unauthorized.)

Caution

When entering the connection parameters as shown above the password is shown in plain text. Reading the password securely from the command line in Java applications is difficult for technical reasons.

In order to enter the password securely it was decided that an input window is raised where you can enter the password securely if no password was specified via command line. In the next example the input window below will come up after command connect is entered as follows:

:cbs>connect –c http://server:port -u someuser

Additional Parameters for the Connect Command

There are two additional options that can be used with regard to command connect:

¡        Applying option –t you can specify the read timeout.

The parameter for option –t is an integer that denotes the timeout in milliseconds. Option –t is of interest if you notice that commands abort due to read timeout.

¡        You can use option –f to specify  a keystore file for an SSL connection.

 In the examples above the information that is sent to and received from CBS is not encrypted. If you want to encrypt the sent and received information you have to use a keystore file to establish a SSL connection. Note that in case of a SSL connection the URL for option –c differs from the one that is used in the non-SSL case:

§         HTTPS is used instead of HTTP.

§         Due to HTTPS a different port number is used as in case of HTTP:

:cbs>connect –c https://server:port -u someuser -p rightpwd –f key-storefile

 

 

 

 

End of Content Area