CAA Web Services Home

 

Consuming the ENOVWSProdStructConfigCpp CAA Web Service

Using the ENOVWSProdStructConfigCppCAA Web Service for a configured product
Use Case

Abstract

This article discusses the CAAENOVWSChgMgmtAxis1_3CppClient 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 ENOVWSProdStructConfigCpp CAA Web service. It provides a sample usage scenario that demonstrates configuration capabilities in ENOVIA LCA V5. CAAENOVWSProdStructConfigCppUseCase choreographs the larger steps. Details are encapsulated in CAAENOVWSProdStructConfigCppUseCaseCar. CAAENOVWSProdStructConfigCppUseCaseCar, in turn, calls methods exposed in each of the web service wrapper classes. Only services exposed by ENOVWSProdStructConfigCppWrapper are discussed in detail in this document.


What You Will Learn With This Use Case

This use case demonstrates how to write a client application that consumes CAA Web services from ENOVWSProdStructConfigCpp, as well as other web services from ENOVWSProdStructCpp, ENOVWSChgMgmtCpp, ENOVWSCntMgmtCpp, and ENOVWSQueryCpp. This use case demonstrates an end-to-end scenario that constructs a configured product, creates and attaches simple unit effectivities using ENOVIA Mods, captures the changes affected on an ENOVIA Action, and generates BOM reports using Config Handlers. It uses createModification, createConfgHandler, getOperations, resolveOperations methods from ENOVWSProdStructConfigCpp within this example. Support methods from the other services listed above will not be discussed here in any great detail. This use case helps you to:

This article also provides guidance 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]

The CAAENOVWSProdStructConfigUseCase Use Case

CAAENOVWSProdStructConfigCppUseCase is a use case of the CAAENOVWS.edu framework that illustrates the ENOVWSProdStructConfigCpp CAA Web service capabilities. CAAENOVWSProdStructConfigCppUseCaseCar is also a member of he CAAENOVWS.edu framework.

[Top]

What Does CAAENOVWSProdStructConfigUseCase Use Case Do

In this use case we build a concept engineering car as follows:

   

Basically, the first car(unit 1) is a front-wheel-drive, whose exhaust has a small-tail. And the last one(unit 100) is a rear-wheel-drive, whose exhaust has a large-tail. Basic unit 'effectivities' are applied to determine the configuration of each of the cars in between.

Even the best conceived designs are subjected to change, so include two more configurations (four-wheel-drive, and all-wheel-drive) to this concept design.

Of course you would want to capture all the changes on an Action in ENOVIA LCA.


Now let's dissect the CAAENOVWSProdStructConfigCppUseCaseCar use case.

First introduce a configured product in ENOVIA LCA

         

The big picture steps - process steps - are choreographed in CAAENOVWSProdStructConfigCppUseCase use case. Details are coded in methods of  CAAENOVWSProdStructConfigCppUseCaseCar[7]. CAAENOVWSProdStructConfigCppUseCaseCar in turn calls web services in each domain's wrapper implementations. For instance CAAENOVWSProdStructConfigCppWrapper encapsulates web services for configuration capabilities in ENOVIA LCA. It will be helpful to follow along by reading the code for this use case. In particular CAAENOVWSProdStructConfigCppUseCaseCar[7].


Having performed the necessary preliminary steps to connect to ENOVIA LCA and having queried the PRC 'Concept CAR', this use case creates parts used to build the 'Concept CAR' in ENOVIA LCA.

Step 4 calls creatPartVersionObjects()[7] method to create parts in ENOVIA LCA. It also calls creatDocumentObjects()[7] to create an owner's manual  to be added to the action manually.

   

Please note that only the exhaust is configured by the use case. The product 'Concept CAR' was configured in LCA.

Step 5 constructs Effectivity Mods, containing units, belonging to 'Concept CAR' at the first level.

This step also constructs Effectivity Mods, containing units, belonging to 'exhaust'. Since tail-small and tail-large are items under exhaust, we will say that they are at the second level. Children of product 'Concept CAR' are at first level. Refer to createModifications sample code for consumption details.

Resulting Mods in ENOVIA LCA:

   

Step 5 also created config handlers for units 1,40,51,80, and 91 by calling creatConfigHandlers()[7] method. Refer to createConfigHandler sample code for consumption details.

   

Step 6 creates an Action - PSCWSAction - in ENOVIA LCA. To capture changes in ENOVIA LCA Change Management during construction and configuration of 'Concept CAR', two methods are called. Namely, addAssociatedObjectsToCar()[7] and addAssociatedObjectsToExhaust()[7]. The first one adds configured PRC 'Concept CAR' as an Associated Object and attaches the first level Mods to it. These Mods will be used to configure children of 'Concept CAR'. Likewise, addAssociatedObjectsToExhaust()[7] ads exhaust as an Associated Object and attaches the second level Mods to it.

   

Step 7 builds the first level assembly. As you can see, the use case has constructed the first level - as was originally intended - by adding only a front-wheel-drive, a rear-wheel-drive, and an exhaust to the 'Concept CAR'.

Step 8 Get(s) and Resolve(s) Operations for the changes in the above steps. Since an Add was performed on each of the items above, the getOperations Web service will return three unresolved operations. For each of the unresolved operation, the use case furnishes a Mod, created prior, and uses resolveOperatiions to resolve them. The rear-wheel-drive-mod is sent in during resolve 'Add' operations for the rear-wheel-drive. And so on. The code matches the names of the Mods and the Items.

Step 9 and Step 10 performs add, and then resolves operations for children of exhaust.

Step 11 demonstrated Replace and Cut functions. First by replacing rear-wheel-drive with all-wheel-drive. And then by issuing a Cut on front-wheel-drive, and an Add for a four-wheel-drive in it's place. The resulting operations are resolved using the Mods created earlier.

Step 13 gets all the affected objects captured by PSCWSAction :

   

 

'Concept CAR' looks like so in the LCA Product Editor.

   

Step 14 generates BOM reports by calling an expand on 'Concept CAR' and passing in Config Handlers as follows:

   

 

   

 

   

 

   

[Top]

Where To Find the CAAENOVWSProdStructConfigCppUseCase Code

The CAAENOVWSProdStructConfigCppUseCase use case is made of several classes located in the CAAENOVWSAxis1_3Client.mj module of the CAAENOVWS.edu framework:

Windows: <Install>\CAAENOVWS.edu\CAAENOVWSAxis1_3Client.mj\src
Unix: <Install>/CAAENOVWS.edu/CAAENOVWSAxis1_3Client.mj/src

The sample Java resources generated using the Axis WSDL2Java emitter are delivered in the following directory (Windows):

<Source>\<Output-package>\CATServiceExceptionType.java
<Source>\<Output-package>\ENOVWSQueryCpp.java
<Source>\<Output-package>\ENOVWSQueryCppLocator.java
<Source>\<Output-package>\IQueryWS.java
<Source>\<Output-package>\IQueryWSBindingStub.java
<Source>\<Output-package>\Identifier.java
<Source>\<Output-package>\Status.java
<Source>\<Output-package>\ENOVIA.java
(+ all related classes)
<Source>\<Output-package>\holders\ENOVIAHolder.java (+ all related classes)
<Source>\<Output-package>\holders\SessionTokenHolder.java
<Source>\<Output-package>\holders\StringArrayTypeHolder.java

The CAAENOVWSAxis1_3Client.mj module contains the other following resources:

<Source>\<Root-package>\CAAENOVWSClient.java
<Source>
\<Root-package>\CAAENOVWS
ProdStructConfigCppUseCase.java
<Source>\<Root-package>\CAAENOVWS
ProdStructConfigCppUseCaseCar.java
<Source>\<Root-package>\CAAENOVWSQueryCppWrapper.java

The CAAENOVWSProdStructConfigCppWrapper class describes how to configure the generated proxy and how to invoke its methods. The CAAENOVWSProdStructConfigCppUseCase class demonstrates a sample use case scenario of the ENOVWSProdStructConfigCpp CAA Web service. The CAAENOVWSClient class contains the main program. It parses the command line inputs and starts up the use case. CAAENOVWSProdStructConfigCppUseCaseCar is also used in this use case to encapsulate the data and methods needed for this 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.

This use case has also a dependency on the CAAENOPosAppBinderImplAxis1_3Client use case in order to manage a session with ENOVIA LCA V5. Please refer to [1] for details on where to find the related code.

[Top]

How to Launch CAAENOVWSProdStructConfigCppUseCase

To launch the CAAENOVWSProdStructConfigCppUseCase use case, you will need to set up a build time environment, build the code along with its prerequisites, set up a runtime configuration and then execute the use case. You can see [3] for details on how to perform these steps within the IRAD 6 environment.

This use case requires a configured product(PRC) to be in the LCA V5 database. The name of this product is passed in as a parameter described below.

The sample usage scenario delivered within this use case is launched from the CAAENOVWSClient class. It defines 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> -t ENOVWSProdStructConfigCpp -r Concept_CAR

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 -t ENOVWSProdStructConfigCpp -r Concept_Car

[Top]

Step-by-step

The following section first explains how to generate the Java client binding for the ENOVWSProdStructConfigCpp CAA Web service demonstrated. The remaining sections then describe the code that must be written in order to consume this Web service. Not all service employed by this use case are detailed in this section. Only the one's that pertain to ENOVWSProdStructConfigCpp are detailed here.

  1. Creating the Java Client Binding
  2. Instantiating and Configuring the Generated Proxy
  3. Create Modification
  4. Create Config Handler
  5. Get Operations
  6. Resolve Operations
  7. Sample Usage Scenario

[Top]

Creating the Java Client Binding

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 ENOVWSProdStructConfigCpp CAA Web service:

%JDK_HOME%\bin\java org.apache.axis.wsdl.WSDL2Java -o C:\CAAENOVWS\src -p com.dassault_systemes.caaenovws/caaenovwsaxis1_3client.generated http://karindsy.dsy.ds:9080/B17/wsdl?service=urn:com:dassault_systemes:ENOVWSProdStructConfigImpl:ENOVWSProdStructConfigImpl:ENOVWSProdStructConfigCpp

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 CAAENOVWSProdStructConfigCppUseCase Code".

[Top]

Instantiating and Configuring the Generated Proxy

In order to be able to consume the ENOVWProdStructConfigCpp CAA Web service implementation that has been deployed on a target server, you first need to retrieve an instance of the IProdStructConfigWSBindingStub 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 IProdStructConfigWSBindingStub class: IProdStructConfigWS. It describes the available methods for the remote CAA Web service.

Warning  Although the IProdStructConfigWSBindingStub 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: ENOVWSProdStructConfigCppLocator. It implements the ENOVWSProdStructConfigCpp interface.

The following code describes how to instantiate the generated proxy. Such proxy is used in order to marshal 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 CAAENOVWSProdStructConfigCppWrapper(String clientId,
                                         String uri,
                                         int timeOut) {
        // Compute the SOAP endpoint URI value that bounds to the deployed
        // implementation of the ENOVWSProdStructConfigCpp CAA Web service
        String endpoint = uri + "servicerouter?service=" + SERVICE_ID;
        // Retrieve proxy instance
        ENOVWSProdStructConfigCppLocator locator = new ENOVWSProdStructConfigCppLocator();
        try {
            proxy = locator.getENOVWSProdStructConfigCppPort(new URL(endpoint));
        } catch (MalformedURLException e) {
            e.printStackTrace();
            throw new RuntimeException(
                    "Invalid SOAP endpoint URI specified for the ENOVWSProdStructConfigCpp CAA Web service proxy");
        } catch (ServiceException e) {
            e.printStackTrace();
            throw new RuntimeException(
                    "Unable to instantiate the ENOVWSProdStructConfigCpp CAA Web service proxy");
        }
        // Required for HTTP session state management on the current proxy
        ((IProdStructConfigWSBindingStub) proxy).setMaintainSession(true);
        if (clientId != null) {
            // Used to maintain the HTTP session state accross distinct proxies
            HandlerInfo info = new HandlerInfo();
            info.setHandlerClass(CustomSessionHandler.class);
            Map handlerConfig = new HashMap();
            handlerConfig.put(CustomSessionHandler.CLIENT_ID, clientId);
            info.setHandlerConfig(handlerConfig);
            HandlerRegistry registry = locator.getHandlerRegistry();
            String portName = locator.getENOVWSProdStructConfigCppPortWSDDServiceName();
            QName name = new QName(portName);
            List chain = registry.getHandlerChain(name);
            chain.add(info);
        }
        // Increase the default client time-out
        ((IProdStructConfigWSBindingStub) proxy).setTimeout(timeOut);
    }

(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): 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]

Create Modification

Create mod can be achieved using the following method, which is available through the generated proxy:

public Status createModification(ConfigExpression iConfigExp, ENOVIAHolder oResult)
  throws RemoteException, CATServiceExceptionType

This method accepts the following parameters:

[in] iConfigExp   The ConfigExpression to create mods. See [6] for details
[in/out] oResult   Resulting mods

The following code demonstrates the use of createModifications method:

    public ENOVIA createModification(String iPartOrPRCId, String iConfigExpression) throws Exception {
		
		System.out.println(">>> Invoking 'createModification' on ENOVWSProdStructConfigCpp CAA Web service proxy");
			 if (iPartOrPRCId == null) {
				 throw new IllegalArgumentException("iPartOrPRCId ID is null");
			 } else if (iConfigExpression == null) {
				 throw new IllegalArgumentException("configExpression is null");
			 } 
						
			 System.out.println("PRCId ID: " + iPartOrPRCId);
			 System.out.println("configExpression name: " + iConfigExpression);
			
			 
			 ConfigExpression configExp = new ConfigExpression();
			configExp.setConfigExpression(iConfigExpression);
			 			 
		     Identifier partOrPRCId = CAAENOVWSUtils.toIdentifier(iPartOrPRCId);
						 
			 ENOVIAHolder oResultHolder = new ENOVIAHolder();
			 // Invoke create document on remote Web service
			 try {
				 Status status = proxy.createModification(partOrPRCId,configExp,oResultHolder);
				 System.out.println("Status: " + status.getStatus());
			 } catch (CATServiceExceptionType e) {
				 throw e;
			 } catch (Throwable t) {
				 throw new Exception("Failed to create modification", t);
			 }
			 // Process output data
			 if (oResultHolder == null || oResultHolder.value == null) {
				 throw new Exception("Failed to create modification");
			 }
			 return oResultHolder.value;
		 }
 

[Top]

Create Config Handler

Create Config Handler can be achieved using the following method, which is available through the generated proxy:

public Status createConfigHandler(ConfigExpression iConfigExp, ENOVIAHolder oResult)
  throws RemoteException, CATServiceExceptionType

The method accepts the following parameters:

[in] iConfigExp   The ConfigExpression for create config handler. See [6] for details
[in/out] oResult   Resulting config handlers

The following code demonstrates the use of createConfigHandler method:

	   public ENOVIA createConfigHandler(String iPRCId, String iConfigExpression) throws Exception {
		
		   System.out.println(">>> Invoking 'createConfigHandler' on ENOVWSProdStructConfigCpp CAA Web service proxy");
				if (iPRCId == null) {
					throw new IllegalArgumentException("PRC ID is null");
				} else if (iConfigExpression == null) {
					throw new IllegalArgumentException("configExpression is null");
				} 
						
				System.out.println("PRCId ID: " + iPRCId);
				System.out.println("configExpression name: " + iConfigExpression);
			
			 
				ConfigExpression configExp = new ConfigExpression();
			   configExp.setConfigExpression(iConfigExpression);
			 			 
				Identifier prcId = CAAENOVWSUtils.toIdentifier(iPRCId);
						 
				ENOVIAHolder oResultHolder = new ENOVIAHolder();
				// Invoke create document on remote Web service
				try {
					Status status = proxy.createConfigHandler(prcId,configExp,oResultHolder);
					System.out.println("Status: " + status.getStatus());
				} catch (CATServiceExceptionType e) {
					throw e;
				} catch (Throwable t) {
					throw new Exception("Failed to create ConfigHandler", t);
				}
				// Process output data
				if (oResultHolder == null || oResultHolder.value == null) {
					throw new Exception("Failed to create ConfigHandler");
				}
				return oResultHolder.value;
			}
 

[Top]

Get Operations

Get Operations can be achieved using the following method, which is available through the generated proxy:

public Status getOperations(Identifier iObjectId, OperationStructureArrayHolder oResult)
  throws RemoteException, CATServiceExceptionType

The method accepts the following parameters:

[in] iObjectId   The object identifier
[in/out] oResult   Operations structure 

The following code demonstrates the use of getOperations method:

		   public OperationStructureArrayTypeHolder GetOpers(String iPRCId) throws Exception {
		
			   System.out.println(">>> Invoking 'GetAllOperations' on ENOVWSProdStructConfigCpp CAA Web service proxy");
					if (iPRCId == null) {
						throw new IllegalArgumentException("PRC ID is null");
					}
						
					System.out.println("PRCId ID: " + iPRCId);
					
					Identifier prcId = CAAENOVWSUtils.toIdentifier(iPRCId);
					OperationStructureArrayTypeHolder oHolderOperations = new OperationStructureArrayTypeHolder();
					// Invoke create document on remote Web service
					try {
						Status status = proxy.getOperations(prcId,oHolderOperations);
						System.out.println("Status: " + status.getStatus());
					} catch (CATServiceExceptionType e) {
						throw e;
					} catch (Throwable t) {
						throw new Exception("Failed to create ConfigHandler", t);
					}
					// Process output data
					if (oHolderOperations == null || oHolderOperations.value == null) {
						throw new Exception("Failed to create ConfigHandler");
					}
					return oHolderOperations;
				}
 

[Top]

Resolve Operations

Resolve Operations can be achieved using the following method, which is available through the generated proxy:

public Status resolveOperations(OperationStructureArrayHolder iOperationStruct)
  throws RemoteException, CATServiceExceptionType

The method accepts the following parameters:

[in] iOperationStruct   Operations structure

The following code demonstrates the use of resolveOperations method:

		   public void ResolveOpers(String iMod, OperationStructureArrayTypeHolder iOperations) throws Exception {
		
			   System.out.println(">>> Invoking 'ResolveOpers' on ENOVWSProdStructConfigCpp CAA Web service proxy");
					if (iMod == null) {
						throw new IllegalArgumentException("iMod ID is null");
					} else if (iOperations == null) {
						throw new IllegalArgumentException("iOperations is null");
					} 
						
					System.out.println("iMod ID: " + iMod);
							  
			 			 
					Identifier iEnovMod = CAAENOVWSUtils.toIdentifier(iMod);
						 
										
					try {
						Status status = proxy.resolveOperations(iEnovMod,iOperations);
						System.out.println("Status: " + status.getStatus());
					} catch (CATServiceExceptionType e) {
						throw e;
					} catch (Throwable t) {
						throw new Exception("Failed to resolveOperations", t);
					}
				
				}

 

Sample Usage Scenario

The following code depends on:

It demonstrates a sample usage scenario for an end to end product configuration, and change management functions.


public class CAAENOVWSProdStructConfigCppUseCase {
private String uri = null;
private String credUser = null;
private String credPwd = null;
	public CAAENOVWSProdStructConfigCppUseCase(String uri,
										 String credUser,
										 String credPwd) {
		this.uri = uri;
		this.credUser = credUser;
		this.credPwd = credPwd;
	}
	public void runSampleUsageScenario(String enoviaUser, String prcVID) {
		boolean success = false;
		Exception exception = null;
		CAAENOPosApplicationBinderImplWrapper binderWrapper = null;
		SessionToken sessionToken = null;
		String uniqueKey = null;
		try {
			// ------------------------------------------------------------
			// Step 1 - Instantiate and configure the proxy
			// ------------------------------------------------------------
			System.out.println("--------------------------------------------------------------------------------");
			System.out.println("STEP 1: Instantiating and configuring CAA Web service proxy");
			System.out.println("--------------------------------------------------------------------------------");
			String clientId = new Long(System.currentTimeMillis()).toString();
			int timeOut = 360000;
			
			// Instantiate the wrapper client classes
			binderWrapper = new CAAENOPosApplicationBinderImplWrapper(clientId,
					uri, credUser, credPwd, timeOut);
			CAAENOVWSQueryCppWrapper queryWrapper = new CAAENOVWSQueryCppWrapper(
					clientId, uri, timeOut);
			CAAENOVWSProdStructCppWrapper prodStructWrapper = new CAAENOVWSProdStructCppWrapper(
					clientId, uri, timeOut);
			CAAENOVWSProdStructConfigCppWrapper prodStructConfigWrapper = new CAAENOVWSProdStructConfigCppWrapper(
					clientId, uri, timeOut);
			CAAENOVWSChgMgmtCppWrapper chgMgmtWrapper = new CAAENOVWSChgMgmtCppWrapper(
					clientId, uri, timeOut);		
			CAAENOVWSCntMgmtCppWrapper cntMgmtWrapper = new CAAENOVWSCntMgmtCppWrapper(
					clientId, uri, timeOut);					
			// ------------------------------------------------------------
			// Step 2 - Open session with ENOVIA LCA V5
			// ------------------------------------------------------------
			System.out.println("--------------------------------------------------------------------------------");
			System.out.println("STEP 2: Opening session with ENOVIA LCA V5");
			System.out.println("--------------------------------------------------------------------------------");
			String[] userContexts = binderWrapper.getUserContexts(enoviaUser);
			System.out.println("Found " + userContexts.length + " context(s) in database");
			System.out.println("Displaying list of available contexts:");
			for (int i = 0; i < userContexts.length; i++) {
				System.out.println("Context[" + i + "]: " + userContexts[i]);
			}
			if (userContexts.length == 0) {
				throw new Exception("No context found for the user specified");
			}
			sessionToken = binderWrapper.login(userContexts[0]);
			// ------------------------------------------------------------
			// Step 3 - query car PRC
			//       Preq: car PRC with VID of "CAAPSCWS_CAR_PRC" has to be present in the ENOVIA database 
			// ------------------------------------------------------------
			System.out.println("--------------------------------------------------------------------------------");
			System.out.println("STEP 3: Query product in ENOVIA LCA V5 --> " + prcVID);
			System.out.println("--------------------------------------------------------------------------------");
			String carPRC = null;
			carPRC=queryWrapper.getProductRootClassUUID(prcVID); 
			
			// ------------------------------------------------------------
			// Step 4 - create objects (part version, document) for car components
			//
			// ------------------------------------------------------------
			System.out.println("--------------------------------------------------------------------------------");
			System.out.println("STEP 4: Create PV and Doc objects");
			System.out.println("--------------------------------------------------------------------------------");
			uniqueKey = clientId; //clientId is unique at each run and can be used as uniqueKey VID for creatin prodStruct 
			//instantiate a car 
			CAAENOVWSProdStructConfigCppUseCaseCar car= new CAAENOVWSProdStructConfigCppUseCaseCar(carPRC, uniqueKey);
			car.creatPartVersionObjects(prodStructWrapper);
			car.creatDocumentObjects(cntMgmtWrapper);//Step 4 back
			// ---------------------------------------------------------------
			// Step 5 - create configuration objects (mods and config handlers)
			// ---------------------------------------------------------------
			System.out.println("--------------------------------------------------------------------------------");
			System.out.println("STEP 5: Create configuration objects, Mods and Config Handlers");
			System.out.println("--------------------------------------------------------------------------------");
			car.creatModsForCar(prodStructConfigWrapper);
			car.creatModsForExhaust(prodStructConfigWrapper);
			car.creatConfigHandlers(prodStructConfigWrapper);//Step 5 back
			
			// ---------------------------------------------------------------
			// Step 6 - Change Management
			// ---------------------------------------------------------------
			System.out.println("--------------------------------------------------------------------------------");
			System.out.println("STEP 6: Create action and add associated objects ");
			System.out.println("--------------------------------------------------------------------------------");
			car.creatAction(chgMgmtWrapper);
			car.addAssociatedObjectsToCar(chgMgmtWrapper);
			car.addAssociatedObjectsToExhaust(chgMgmtWrapper);
			car.addAffectedObjects(chgMgmtWrapper);//Step 6 back
			
			// ---------------------------------------------------------------
			// Step 7 - build car (assembly)
			// ---------------------------------------------------------------
			System.out.println("--------------------------------------------------------------------------------");
			System.out.println("STEP 7: Build first level assembly on product CAR");
			System.out.println("--------------------------------------------------------------------------------");
			car.buildProdStructCAR(prodStructWrapper);//Step 7 back
			// ---------------------------------------------------------------
			// STEP 8: Get and Resolve Operation for Car 
			// ---------------------------------------------------------------			
			System.out.println("--------------------------------------------------------------------------------");
			System.out.println("STEP 8: Get and Resolve Operation for CAR: first level");
			System.out.println("--------------------------------------------------------------------------------");
			car.GetAndResolveOperationsCAR(prodStructConfigWrapper);//Step 8 back
			// ---------------------------------------------------------------
			// Step 9 - build car (assembly)
			// ---------------------------------------------------------------
			System.out.println("--------------------------------------------------------------------------------");
			System.out.println("STEP 9: Build second level assembly on CAR's Exhaust");
			System.out.println("--------------------------------------------------------------------------------");
			car.buildProdStructExhaust(prodStructWrapper);//Step 9 back
			// ---------------------------------------------------------------
			// STEP 10: Get and Resolve Operation for Exhaust
			// ---------------------------------------------------------------			
			System.out.println("--------------------------------------------------------------------------------");
			System.out.println("STEP 10: Get and Resolve Operation for Exhaust: second level");
			System.out.println("--------------------------------------------------------------------------------");
			car.GetAndResolveOperationsExhaust(prodStructConfigWrapper);//Step 10 back
			// ---------------------------------------------------------------
			// STEP 11: Make some modification on Product CAR
			// ---------------------------------------------------------------			
			System.out.println("--------------------------------------------------------------------------------");
			System.out.println("STEP 11: Make some modification on Product CAR: first level ");
			System.out.println("--------------------------------------------------------------------------------");
			car.modifyCar(prodStructWrapper);//Step 11 back
			// ---------------------------------------------------------------
			// STEP 12: Get and Resolve Operation caused by step 11
			// ---------------------------------------------------------------			
			System.out.println("--------------------------------------------------------------------------------");
			System.out.println("STEP 12: Get and Resolve Operation caused by step 12 ");
			System.out.println("--------------------------------------------------------------------------------");
			car.GetAndResolveOperationsCAR(prodStructConfigWrapper);//Step 12 back
			// ---------------------------------------------------------------
			// STEP 13: Get affected objects on action resulting from steps 10 and 12
			// ---------------------------------------------------------------			
			System.out.println("--------------------------------------------------------------------------------");
			System.out.println("STEP 13: Get affected objects on action resulting from steps 7, 11 and 13");
			System.out.println("--------------------------------------------------------------------------------");
			car.getAffectedObjects(chgMgmtWrapper);//Step 13 back
			
			// ---------------------------------------------------------------
			// STEP 14: Report car BOM by applying config handlers
			// ---------------------------------------------------------------			
			System.out.println("--------------------------------------------------------------------------------");
			System.out.println("STEP 14: Report car BOM by applying config handlers ");
			System.out.println("--------------------------------------------------------------------------------");
			car.reportBOM(prodStructWrapper,queryWrapper);//Step 14 back
			
			success = true;			
		} catch (CATServiceExceptionType e) {
			exception = e;
		} catch (Exception e) {
			exception = e;
		} finally {
			// ------------------------------------------------------------
			// final Step 15- Terminate opened session
			// ------------------------------------------------------------
			System.out.println("--------------------------------------------------------------------------------");
			System.out.println("final Step 15: Terminating opened session with ENOVIA LCA V5");
			System.out.println("--------------------------------------------------------------------------------");
			// The session must be closed even if a call to a method on the
			// ENOVWSProdStructConfigCpp CAA Web service fails
			try {
				binderWrapper.logout(sessionToken);
			} catch (Exception e) {
				System.err.println("Failed to logout gracefully");
			}
		}
		if (success) {
			System.out.println("================================================================================");
			System.out.println("Use case execution successful");
		} else {
			System.out.println("================================================================================");
			System.out.println("Use case execution failed");
			System.out.println("--------------------------------------------------------------------------------");
			if (exception instanceof CATServiceExceptionType) {
				CATServiceExceptionType e = (CATServiceExceptionType) exception;
				System.out.println("Error code: " + e.getCode());
				System.out.println("Error message: " + e.getMessage());
				if (e.getErrorArguments() != null) {
					String[] errorArguments = e.getErrorArguments();
					System.out.println("Error arguments: " + errorArguments.length);
					for (int i = 0; i < errorArguments.length; i++) {
						System.out.println("\tArgument[" + i + "]: " + errorArguments[i]);
					}
				}
			} else {
				System.out.println(exception.getMessage());
				if (exception.getCause() != null) {
					// Handle nested exceptions launched from the use case
					System.out.println("Exception details:");
					exception.getCause().printStackTrace();
				} else if (exception.getStackTrace() != null && exception.getStackTrace().length != 0) {
					// Handle unexpected exceptions
					System.out.println("Exception details:");
					exception.printStackTrace();
				}
			}
		}
	}
}

The following methods, used in the scenario above,  are implemented in CAAENOVWSProdStructConfigCppUseCaseCar.java class[7]

the source code can be found in:

<Install>\<Source>\<Package>\CAAENOVWSProdStructConfigCppUseCaseCar .java

[Top]


In Short

This use case explains how to use the Java client binding generated using the Axis WSDL2Java emitter in order to consume the ENOVWSProdStructConfigCpp Web service. It also gives an overview of the methods available for that particular CAA Web service:

[Top]


References

[1] Maintaining the Session State
[2] Consuming the ENOPosApplicationBinderImpl CAA Web Service
[3] Building and Launching a CAA Web Service Use Case
[4] Generating a Java Client Binding
[5] Using SelectExpression
[6] Using ConfigExpression
[7] CAAENOVWSProdStructConfigCppUseCaseCar
[8] Consuming ENOVWSProdStructCpp CAA Web Service
[9] Consuming ENOVWSCntMgmtCpp CAA Web Service
[10] Consuming ENOVWSQueryCpp CAA Web Service
[11] Consuming ENOVWSChgMgmtCpp CAA Web Service
[12] Consuming ENOVWSProdStructConfigCpp CAA Web Service
   

History

Version: 1 [Feb 2006] Document created
[Top]

Copyright © 1994-2006, Dassault Systèmes. All rights reserved.