Skip Headers
Oracle® Communications Services Gatekeeper Application Developer's Guide
Release 5.0

Part Number E16611-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

3 Session Manager Web Service

The Session Manager Web Service contains operations for establishing a session with Oracle Communications Services Gatekeeper, changing the application's password, querying the amount of time remaining in the session, refreshing the session, and terminating the session.

Note:

Not all installations of Services Gatekeeper require session management. The contents of this chapter apply only to those installations that do.

When an operator requires it, an application must establish a session with Services Gatekeeper before the application can perform any operations on the Parlay X or Extended Web Services interfaces. When a session is established, a session ID is returned which must be used in each subsequent operation towards Services Gatekeeper.

Endpoint

The WSDL for the Session Manager can be found at

http://host:port/session_manager/SessionManager

where host and port depend on the Services Gatekeeper deployment.

Interface: SessionManager

Operations to establish a session, change a password, get the remaining lifetime of a session, refresh a session and destroy a session.

Operation: getSession

Establishes a session using Web Services Security. Authentication information must be provided according to WS-Security. See "Authentication".

Input message: getSession

Table 3-1 Input message: getSession

Part name Part type Optional Description

N/A

N/A

N/A

N/A


Output message: getSessionResponse

Table 3-2 Output message: getSessionResponse

Part name Part type Optional Description

getSessionReturn

xsd:String

N

The session ID to use in subsequent requests.


Referenced faults

GeneralException

Operation: changeApplicationPassword

Changes the password for an application.

Input message: changeApplicationPassword

Table 3-3 Input message: changeApplicationPassword

Part name Part type Optional Description

sessionId

xsd:string

N

The ID of an established session.

oldPassword

xsd:string

N

The current password.

newPassword

xsd:string

N

The new password.


Output message: changeApplicationPasswordResponse

Table 3-4 Output message: changeApplicationPasswordResponse

Part name Part type Optional Description

N/A

N/A

N/A

N/A


Referenced faults

-

Operation: getSessionRemainingLifeTime

Gets the remaining lifetime of an established session. The default lifetime is configured in Services Gatekeeper.

Input message: getSessionRemainingLifeTime

Table 3-5 Input message: getSessionRemainingLifeTime

Part name Part type Optional Description

sessionId

xsd:string

N

The ID of an established session.


Output message: getSessionRemainingLifeTimeResponse

Table 3-6 Output message: getSessionRemainingLifeTimeResponse

Part name Part type Optional Description

getSessionRemainingLifeTimeReturn

xsd:string

N

The remaining lifetime of the session.

Given in milliseconds.


Referenced faults

-

Operation: refreshSession

Refreshes the lifetime of an session. The session can be refreshed during a time interval after the a session has expired. This time interval is configured in Services Gatekeeper.

Input message: refreshSession

Table 3-7 Input message: refreshSession

Part name Part type Optional Description

sessionId

xsd:string

N

The ID of an established session.


Output message: refreshSessionResponse

Table 3-8 Output message: refreshSessionResponse

Part name Part type Optional Description

refreshSessionReturn

xsd:string

N

The session ID to be used in subsequent requests. The same ID as the original session ID is returned.


Referenced faults

-

Operation: destroySession

Destroys an established session.

Input message: destroySession

Table 3-9 Input message: destroySession

Part name Part type Optional Description

sessionId

xsd:string

N

The ID of an established session.


Output message: destroySessionResponse

Table 3-10 Output message: destroySessionResponse

Part name Part type Optional Description

destroySessionReturn

xsd:boolean

N

True if the session was destroyed.


Referenced faults

-

Examples

The code below illustrates how to get the Session Manager and how to prepare the generated stub with Web Service security information. The stub is generated from the Session Manager Web Service.

Example 3-1 Get hold of the Session Manager

protected ClientSessionManImpl(String sessionManagerURL, PolicyBase pbase) throws Exception {
  SessionManagerService accessservice = 
    new SessionManagerService_Impl(sessionManagerURL+"?WSDL");
  port = accessservice.getSessionManager();
  pbase.prepareStub((Stub)port);
  }

Below illustrates how to prepare the Session Manager stub with Username Token information according to WS-Policy.

Example 3-2 Prepare the Session Manager with Username Token information

package com.bea.wlcp.wlng.client.access.wspolicy;
import weblogic.wsee.security.unt.ClientUNTCredentialProvider;
import weblogic.xml.crypto.wss.WSSecurityContext;
import javax.xml.rpc.Stub;
import java.util.ArrayList;
import java.util.List;
public class UsernameTokenPolicy implements PolicyBase {

  private String username;
  private String password;

public UsernameTokenPolicy(String username, String password) {
    this.username = username;
    this.password = password;
  }

  public void prepareStub(Stub stub) throws Exception {
    List<ClientUNTCredentialProvider> credProviders = new ArrayList<ClientUNTCredentialProvider>();
    credProviders.add(new ClientUNTCredentialProvider(username.getBytes(),
                                                      password.getBytes()));
    System.out.println("setting standard wssec");
    stub._setProperty(WSSecurityContext.CREDENTIAL_PROVIDER_LIST,
                      credProviders);
  }

}