The Legacy REST Web Services calls are executed within the context of an HTTP session. This enables a client application to maintain state across requests and to use login information for security purposes.
The RestSession
class contains all the logic required for connecting and communicating with an Oracle Commerce Platform server.
The following code creates a new RestSession
object:
RestSession session = RestSession.createSession(host, port, username, password);
Note: You can perform multiple Legacy REST Web Services requests during an HTTP session. See information about HTTP sessions and the Legacy REST Web Services server in Logging In.
RestSession class properties
The RestSession
class includes the following properties. Some are set when the object is created and others can be changed after the object has been constructed:
Property | Description |
---|---|
| The name of the host which the session will or is connected to. Default is localhost. |
| The port number which the session will use. Default is 80. |
| The username the session will use to connect. |
| The password the session will use to connect. |
| The scheme the session will use to connect. Default is HTTP expect for login calls. |
| The Web application context root for Legacy REST Web Services. Default is |
| Tells the session object to login as an internal user instead of a profile user. You will probably need to change this property after the |
| Tells the session object to use the HTTPS scheme for login calls. Default is |
| The HTTPS port number which the session will use. Default is 443. |
| The |
| The session ID of the current session. This value is set after logging in. |
| The encoding to use when encoding parameter values. Default is UTF |
| The default input format that is set on the server. Changing this value has no effect on the server. |
| The default output format that is set on the server. Changing this value has no effect on the server |