CAA Web Services Home |
|
Consuming the ENOPosApplicationBinderImpl CAA Web ServiceUsing the ENOPosApplicationBinderImpl CAA Web service in order to log on to ENOVIA LCA V5 |
Use Case |
AbstractThis article discusses the CAAENOPosAppBinderImplAxis1_3Client use case. It describes how to use the Java client binding that can be generated using the Axis WSDL2Java emitter in order to consume the ENOPosApplicationBinderImpl CAA Web service. It provides a sample usage scenario that demonstrates how to manage a session with an ENOVIA LCA V5 system. |
This use case demonstrates how to write a client application that consumes the ENOPosApplicationBinderImpl CAA Web service. It helps you to:
This article also provides guidances on how to build and run the sample client application using IRAD (IBM Rational Application Developer) 6.0, although any other Java IDE (Integrated Development Environment) or stand-alone JDK/JRE (Java Development Kit/Java Runtime Environment) could be used for that purpose.
[Top]
CAAENOPosAppBinderImplAxis1_3Client is a use case of the CAAPLMSecurity.edu framework that illustrates the ENOPosApplicationBinderImpl CAA Web service capabilities.
[Top]
The sample usage scenario delivered with this use case contains the following steps:
[Top]
The CAAENOPosAppBinderImplAxis1_3Client use case is made of several classes located in the CAAENOPosAppBinderImplAxis1_3Client.mj module of the CAAPLMSecurity.edu framework:
Windows:
<Install>\CAAPLMSecurity.edu\CAAENOPosAppBinderImplAxis1_3Client.mj\src Unix: <Install>/CAAPLMSecurity.edu/CAAENOPosAppBinderImplAxis1_3Client.mj/src
|
<Install>
: the directory where the CAA CD-ROM is installed.
The sample Java resources generated using the Axis WSDL2Java emitter are delivered in the following directory (Windows):
<Source>\<Output-package>\CATServiceExceptionType.java
|
<Source>
:
<Install>\CAAPLMSecurity.edu\CAAENOPosAppBinderImplAxis1_3Client.mj\src
,
<Install>
: same as above,
<Output-package>
: com\dassault_systemes\caaplmsecurity\caaenoposappbinderaxis1_3client\generated
(based on the output package value specified when using the WSDL2Java emitter).
The CAAENOPosAppBinderImplAxis1_3Client module contains the other following resources:
<Source>\<Root-package>\CAAENOPosApplicationBinderImplClient.java
|
<Source>
: same as above,
<Root-package>
: com\dassault_systemes\caaplmsecurity\caaenoposappbinderaxis1_3client.
The CAAENOPosApplicationBinderImplWrapper class describes how to configure the generated proxy and how to invoke its methods. The CAAENOPosApplicationBinderImplUseCase class demonstrates a sample use case scenario of the ENOPosApplicationBinderImpl CAA Web service. The CAAENOPosApplicationBinderImplClient class contains the main program. It parses the command line inputs and starts up the use case.
This use case has a dependency on the CustomSessionHandler class which is available in the CAAJAXRPCHTTPSessionHandler.mj module of the CAAWebServices.edu framework. Please refer to [1] for details on HTTP session management and where to find the related class.
[Top]
To launch the CAAENOPosAppBinderImplAxis1_3Client use case, you will need to set up a buildtime environment, build the code along with its prerequisites, set up a runtime configuration and then execute the use case. You can see [2] for details on how to perform these steps within the IRAD 6 environment.
The sample usage scenario delivered within this use case consists of a class declaring a main method that takes several options as parameters, as described below:
-w <URI> -e <ENOVIA username> -u
<Basic Authentication username> -p <Basic Authentication password>
|
<URI>
: is the root URI of the Web application where the ENOPosApplicationBinderImpl
CAA Web service is deployed,
<ENOVIA username>
: is a valid username declared in the ENOVIA P&O database,
<Basic Authentication Username> and <Basic Authentication Password>
:
are a valid set of credentials for authentication on the remote Web server.
Here follows a sample command, to be updated with your own environment configuration:
-w http://stophe1dsy.dsy.ds:9080/B17 -e cjk -u wpsadmin -p wpsadmin
|
[Top]
The following section first explains how to generate the Java client binding for the ENOPosApplicationBinderImpl CAA Web service demonstrated. The remaining sections then describe the code that must be written in order to consume this Web service:
[Top]
Please refer to [3] for details on how to generate the Java client binding using the Axis WSDL2Java emitter.
Here follows a sample command in order to generate the Java client binding for the ENOPosApplicationBinderImpl CAA Web service:
%JDK_HOME%\bin\java org.apache.axis.wsdl.WSDL2Java -o C:\CAAPLMSecurity\src -p
com.dassault_systemes.caaplmsecurity.caaenoposappbinderaxis1_3client.generated
http://karindsy.dsy.ds:9080/B17/wsdl?service=urn:com:dassault_systemes:ENOPosWS:ENOPosAppliBinder:ENOPosApplicationBinderImpl
|
The server name, port, and context root URI information must be updated to match the server where the CAA Web service has been deployed. The list of generated resources is available from the above section: "Where To Find the CAAENOPosAppBinderImplAxis1_3Client Code".
[Top]
In order to be able to consume the ENOPosApplicationBinderImpl CAA Web service implementation that has been
deployed on a target server, you first need to retrieve an instance of the IApplicationBinderBindingStub
generated class (also referred to as the proxy). It is a common best practice to manipulate an
instance through its related interface whenever available. The WSDL2Java emitter produces an interface that is
implemented by the IApplicationBinderBindingStub
class: IApplicationBinder
. It
describes the available methods for the remote CAA Web service.
Although the
IApplicationBinderBindingStub
class can be directly instantiated using its
own set of constructors, the Axis User's Guide recommends to discard this approach. Instead, the recommended
approach is to use another generated class for that purpose: ENOPosApplicationBinderImplLocator
. It
implements the ENOPosApplicationBinderImpl
interface.
The following code describes how to instantiate the generated proxy. Such proxy is used in order to marshall method calls and objects to SOAP requests, and to unmarshall SOAP responses to objects. This proxy must be configured in order to manage authentication on the remote Web server, timeout, and session management. Maintaining the HTTP session state is mandatory when consuming ENOVIA LCA V5 CAA Web services.
public class CAAENOPosApplicationBinderImplWrapper {
|
(1): in order to maintain the HTTP session state between successive calls performed using the
same proxy instance, the setMaintainSession
method must be used. This is mandatory in the context of
ENOVIA LCA V5 CAA Web services,
(2): in order to maintain the HTTP session state between successive calls performed using distinct
proxy instances, a JAX-RPC custom handler must be configured on the proxy. This is mandatory in the context of
ENOVIA LCA V5 CAA Web services. You can refer to [1] for details,
(3): when security is enabled, it is mandatory to set the username
and
password
attributes on the generated proxy. The values specified must match a valid set of
credentials for the Basic Authentication mechanism,
(4): the default timeout value can be increased in order to avoid potential issues at runtime,
such as losing the HTTP connection before receiving the SOAP responses. The sample value specified in the code is in
milliseconds.
[Top]
In order to log on to ENOVIA LCA V5, you must first retrieve the contexts associated with a given user declared
in the P&O (People & Organization) database. This can be achieved using the following method, which is
available through the generated IApplicationBinder
proxy interface:
public Status
getUserContexts(String iUserName, StringArrayTypeHolder oUserContexts)
|
This method accepts the following parameters:
[in] iUserName
|
The name of a user declared in the P&O database |
[in/out] oUserContexts
|
The list of contexts allowed for the specified user (for example VPMDESIGNER.VPM.DEFAULT) |
The following code demonstrates the use of the getUserContexts
method:
public class CAAENOPosApplicationBinderImplWrapper {
|
[Top]
You can then log on to ENOVIA LCA V5 with one of the contexts available for the user specified using the following method:
public Status bindToApplication(String iSelectedUserContext, SessionTokenHolder oSessionId)
|
This method accepts the following parameters:
[in] iSelectedUserContext
|
The context to use in order to log on to ENOVIA LCA V5 |
[in/out] oSessionId
|
The session identifier, if any (may be null) |
The following code demonstrates the use of the bindToApplication
method:
public class CAAENOPosApplicationBinderImplWrapper {
|
[Top]
You can finally log off from ENOVIA LCA V5 and terminate the opened session using the following method:
public Status releaseFromApplication(SessionToken iSessionId)
|
The method accepts the following parameters:
[in] iSessionId
|
The session identifier retrieved through the call to bindToApplication , if any (may be null)
|
The following code demonstrates the use of the releaseFromApplication
method:
public class CAAENOPosApplicationBinderImplWrapper {
|
[Top]
The following code depends on the CAAENOPosApplicationBinderImplWrapper class described above. It demonstrates a sample usage scenario for the ENOPosApplicationBinderImpl CAA Web service:
public class CAAENOPosApplicationBinderImplUseCase {
|
[Top]
This use case explains how to use the Java client binding generated using the Axis WSDL2Java emitter in order to consume the ENOPosApplicationBinderImpl CAA Web service. It also gives an overview of the available methods:
getUserContexts
: retrieve the contexts associated with a given user
declared in the P&O database,
bindToApplication
: log on to ENOVIA LCA V5 using a specific
context,
releaseFromApplication
: log off from ENOVIA LCA V5 in order
to terminate an opened session.
[Top]
[1] | Maintaining the Session State |
[2] | Building and Launching a CAA Web Service Use Case |
[3] | Generating a Java Client Binding |
[Top] |
Version: 1 [Apr 2005] | Document created |
Version: 2 [Jan 2006] | Document updated |
[Top] |
Copyright © 1994-2006, Dassault Systèmes. All rights reserved.