![]() ![]() ![]() ![]() ![]() ![]() |
The Session Manager Web Service contains operations for establishing a session with Network 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 Network 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 Network 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 Network Gatekeeper.
The WSDL for the Session Manager can be found at http://<host>:<port>/session_manager/SessionManager
where host and port depend on the Network Gatekeeper deployment.
Operations to establish a session, change a password, get the remaining lifetime of a session, refresh a session and destroy a session.
Establishes a session using Web Services Security. Authentication information must be provided according to WS-Security. See Authentication.
Changes the password for an application.
Gets the remaining lifetime of an established session. The default lifetime is configured in Network Gatekeeper.
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 Network Gatekeeper.
Destroys an established session.
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.
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.
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);
}
}
![]() ![]() ![]() |