CAA Web Services Home
|
|
Consuming the ENOVWSProdStructCpp CAA Web Service
Using the ENOVWSProdStructCpp CAA Web service for product structure management
|
Use Case
|
Abstract
This article discusses the CAAENOVWSDotNet1_1Client use case. It describes how to use
the C# client binding that can be generated using the wsdl.exe utility in order to consume the
ENOVWSProdStructCpp CAA Web service. It provides a sample usage scenario that
demonstrates how to handle product structure management.
|
What You Will Learn With This Use Case
This use case demonstrates how to write a client application that consumes the ENOVWSProdStructCpp CAA Web
service. It helps you to:
- Generate the C# client binding for the ENOVWSProdStructCpp CAA Web service,
- Configure and use the generated proxy,
- Understand a sample usage scenario of the ENOVWSProdStructCpp CAA Web service.
[Top]
The CAAENOVWSDotNet1_1Client Use Case
CAAENOVWSDotNet1_1Client is a use case of the CAAENOVWS.edu framework that illustrates the ENOVWSProdStructCpp
CAA Web service capabilities.
[Top]
What Does CAAENOVWSDotNet1_1Client Do
The sample usage scenario delivered with this use case contains the following steps:
- Query for a Product Root Class (PRC). Retrieve its UUID,
- Create two parts. Retrieve their UUIDs,
- Add the first part as a child of the parent PRC. Retrieve the UUID for the first instance created,
- Add the second part version as a child of the created instance. Retrieve the UUID for the second instance
created,
- Expand the created product structure. Display its content,
- Delete the child instances and parts created.
[Top]
Where To Find the CAAENOVWSDotNet1_1Client Code
The CAAENOVWSDotNet1_1Client use case is made of several classes located in both
CAAENOVWSDotNet1_1Client.m and CAAENOVWSDotNet1_1ClientBase.m modules of the
CAAENOVWS.edu framework:
<Install>\CAAENOVWS.edu\CAAENOVWSDotNet1_1Client.m\src
<Install>\CAAENOVWS.edu\CAAENOVWSDotNet1_1ClientBase.m\src
|
-
<Install>
: the root directory where the CAA CD-ROM is installed.
The CAAENOVWSDotNet1_1ClientBase.m module (library) contains the following resources:
<Source>\CAAENOVWSProdStructCppProxy.cs
<Source>\CAAENOVWSProdStructCppWrapper.cs
<Source>\CAAENOVWSUtils.cs |
-
<Source>
:
<Install>\CAAENOVWS.edu\CAAENOVWSDotNet1_1ClientBase.m\src
.
The CAAENOVWSProdStructCppProxy.cs file contains the C# client binding generated using the
wsdl.exe utility. A C# client binding consists of a proxy and several types definitions. The
CAAENOVWSProdStructCppWrapper.cs file contains a class that describes how to configure the
generated proxy and how to invoke its methods.
The CAAENOVWSDotNet1_1Client.m module (executable) contains the following resources:
<Source>\CAAENOVWSDotNet1_1Client.cs
<Source>\CAAENOVWSProdStructCppUseCase.cs
|
-
<Source>
:
<Install>\CAAENOVWS.edu\CAAENOVWSDotNet1_1Client.m\src
.
The CAAENOVWSDotNet1_1Client.cs file contains the main program. It parses the command line
inputs and starts up the use case. The CAAENOVWSProdStructCppUseCase.cs file contains the sample
use case scenario.
[Top]
How to Launch CAAENOVWSDotNet1_1Client
Prerequisites to running this use case is that you need to login to ENOVIA LCA V5, create a Product Class and
then create a Product with the V_ID = "IProdStructWS_CAA_PRC1".
To run the CAAENOVWSDotNet1_1Client use case, you will need to build both CAAENOVWSDotNet1_1ClientBase.m and
CAAENOVWSDotNet1_1Client.m modules. The use case code can be built using either the CAA V5 buildtime environment,
or Visual Studio .NET 2003 as explained in [1].
You can then execute the command described below:
CAAENOVWSDotNet1_1Client -w <URI> -e <ENOVIA username> -u <Basic
Authentication username> -p <Basic Authentication password> -t
ENOVWSProdStructCpp
|
-
<URI>
: is the root URI of the Web application where the ENOVWSProdStructCpp 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:
CAAENOVWSDotNet1_1Client -w http://stophe1dsy.dsy.ds:9080/B17 -e cjk -u wpsadmin -p wpsadmin -t
ENOVWSProdStructCpp
|
The same executable is used to launch all of the available ENOVIA CAA Web services use cases. The -t
option is used to choose the target use case to run.
When building the modules with the CAA V5 buildtime environment, the CAAENOVWSDotNet1_1Client executable can be
launched from the following location:
<Install>\CAAENOVWS.edu\intel_a\code\clr
|
-
<Install>
: the root directory where the CAA CD-ROM is installed.
[Top]
Step-by-step
The following section first explains how to generate the C# client binding for the ENOVWSProdStructCpp CAA Web
service demonstrated. The remaining sections describe how to configure the generated proxy and how to consume the
Web service:
-
Creating the C# Client Binding
-
Instantiating and Configuring the Generated Proxy
-
Creating Parts
-
Adding Child Parts
-
Expanding Product Structures
-
Deleting Child Parts
-
Deleting Child Parts
-
Sample Usage Scenario
[Top]
Creating the C# Client Binding
Please refer to [2] for details on how to generate the C# client binding using the
wsdl.exe utility.
Here follows a sample command in order to generate the C# client binding for the ENOVWSProdStructCpp CAA Web
service:
wsdl /namespace:com.dassault_systemes.caaenovws.caaenovwsdotnet1_1clientgen.enovwsprodstructcpp
/username:wpsadmin /password:wpsadmin /out:CAAENOVWSProdStructCppProxy.cs
http://stophe1dsy.dsy.ds:9080/B17/wsdl?service=urn:com:dassault_systemes:ENOVWSProdStructImpl:ENOVWSProdStructImpl:ENOVWSProdStructCpp
|
The server name, port, and context root URI information must be updated to match the server where the
ENOVWSProdStructCpp CAA Web service has been deployed. The /username
and /username
options are required to authenticate on the Web server hosting the Web service.
[Top]
Instantiating and Configuring the Generated Proxy
In order to consume an implementation of the ENOVWSProdStructCpp CAA Web service deployed on a target Web server,
you first need to instantiate the proxy generated using the wsdl.exe utility. This proxy must then 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.
The generated proxy class is used in order to marshall method calls and objects to SOAP requests, and to
unmarshall SOAP responses to objects. The following code describes how to instantiate and configure it:
public class CAAENOVWSProdStructCppWrapper {
private const string SERVICE_ID =
"urn:com:dassault_systemes:ENOVWSProdStructImpl:ENOVWSProdStructImpl:ENOVWSProdStructCpp";
private CAAENOVWSProdStructCppProxy proxy = null;
public CAAENOVWSProdStructCppWrapper(
CookieContainer container,
string uri,
string credUser,
string credPwd,
int timeOut) {
proxy = new CAAENOVWSProdStructCppProxy();
// Compute the SOAP endpoint URI value that bounds to the deployed
// implementation of the ENOVWSProdStructCpp CAA Web service
proxy.Url = uri + "servicerouter?service=" + SERVICE_ID;
// Required for HTTP session state management
proxy.CookieContainer = container; (1)
// Required for the Basic Authentication mechanism
ICredentials credentials = new NetworkCredential(credUser,
credPwd);
proxy.Credentials = credentials; (2)
// Increase the default client time-out
proxy.Timeout = timeOut; (3)
}
}
|
(1): in order to maintain the HTTP session state between successive calls performed using either
the same or multiple proxy instances, the CookieContainer
property must be set on the proxy. This is
mandatory in the context of ENOVIA LCA V5 CAA Web services,
(2): when security is enabled on the remote Web server, it is mandatory to set the
Credentials
property on the proxy. The values specified must match a valid set of credentials for
the Basic Authentication mechanism,
(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 value specified in the code is in
milliseconds.
[Top]
Creating Parts
In order to create parts, you can use the following method available through the generated proxy interface:
public Status CreatePart(ENOVIA
iObjects, string iConfigurable, ref ENOVIA
oObjects)
|
This method accepts the following parameters:
[in] iObjects
|
List of Part Versions to be created
|
[in] iConfigurable
|
TRUE or FALSE (default of FALSE)
|
[in/out] oObjects
|
The successfully created objects
|
The following code demonstrates the use of the CreatePart
method:
public class CAAENOVWSProdStructCppWrapper {
...
public ENOVIA CreatePartRef(
string[] partNumbers,
string domain,
string configurable) {
if (partNumbers == null) {
throw new ApplicationException("Illegal argument: part
number array is null");
} else if (domain == null) {
throw new ApplicationException("Illegal argument:
environment domain is null");
} else if (configurable == null)
{
throw new ApplicationException("Illegal argument:
configurable flag is null");
}
ENOVIA_VPMPartVersion[] vpmPartVersions =
new ENOVIA_VPMPartVersion[partNumbers.Length];
for (int i = 0; i <
partNumbers.Length; i++) {
vpmPartVersions[i] = new ENOVIA_VPMPartVersion();
vpmPartVersions[i].Domain = domain;
vpmPartVersions[i].ENOVIA_VPMPartMasterV_ID = partNumbers[i];
}
ENOVIA input = new ENOVIA();
input.ENOVIA_VPMPartVersion = vpmPartVersions;
ENOVIA resultSet = null;
try {
Status status = proxy.CreatePart(input, configurable, ref resultSet);
Console.Out.WriteLine("Status: {0}", status.Status1);
} catch (Exception e) {
throw new ApplicationException("Failed to create part
reference(s)", e);
}
if (resultSet == null) {
throw new Exception("Failed to create part
reference(s)");
}
return resultSet;
}
public string[] GetENOVIA_VPMPartVersionUUIDs(ENOVIA resultSet) {
if (resultSet == null) {
throw new ApplicationException("Illegal argument exception: ENOVIA result set is
null");
}
ENOVIA_VPMPartVersion[] vpmPartVersions =
resultSet.ENOVIA_VPMPartVersion;
if (vpmPartVersions == null) {
throw new ApplicationException("Failed to retrieve
ENOVIA_VPMPartVersion objects");
}
string[] vpmPartVersionUUIDs = new
string[vpmPartVersions.Length];
for (int i = 0; i < vpmPartVersions.Length; i++) {
vpmPartVersionUUIDs[i] = vpmPartVersions[i].CATJsyUUID;
}
return vpmPartVersionUUIDs;
}
}
|
The GetENOVIA_VPMPartVersionUUIDs
method is used to scan the ENOVIA result set returned and retrieve
the UUIDs of the created part references.
[Top]
Adding Child Parts
In order to add child parts, you can use the following method available through the generated proxy interface:
public Status
AddChildPart(Identifier iParentId, Identifier[] iChildIds, ref ENOVIA
oResult)
|
The method accepts the following parameters:
[in] iParentId
|
The identifier of the parent object
|
[in] iChildIds
|
The array of child identifiers
|
[in/out] oResult
|
The child part instances added to the parent
|
The following code demonstrates the use of the AddChildPart
method:
public class CAAENOVWSProdStructCppWrapper {
...
private Identifier ToIdentifier(string id)
{
if (id == null) {
throw new ApplicationException("Illegal argument:
identifier value is null");
}
Identifier identifier = new Identifier();
identifier.Identifier1 = CAAENOVWSUtils.ConvertFromHexToBinary(id);
return identifier;
}
private Identifier[] ToIdentifierArray(string[] ids) {
if (ids == null) {
throw new ApplicationException("Illegal argument:
identifiers array is null");
}
Identifier[] identifiers = new Identifier[ids.Length];
for (int i = 0; i < ids.Length;
i++) {
identifiers[i] = ToIdentifier(ids[i]);
}
return identifiers;
}
public ENOVIA CreatePartInst(string
parentUUID, string[] partRefUUIDs) {
if (parentUUID == null) {
throw new Exception("Illegal argument: parent UUID is
null");
} else if (partRefUUIDs == null)
{
throw new Exception("Illegal argument: part instance UUID
array is null");
}
Identifier parentId = ToIdentifier(parentUUID);
Identifier[] partRefIds = ToIdentifierArray(partRefUUIDs);
ENOVIA resultSet = null;
try {
Status status =
proxy.AddChildPart(parentId, partRefIds, ref
resultSet); Console.Out.WriteLine("Status: {0}", status.Status1);
} catch (Exception e) {
throw new ApplicationException("Failed to create part
instance(s)", e);
}
if (resultSet == null) {
throw new Exception("Failed to create part
instance(s)");
}
return resultSet;
}
public string[] GetVPMBOPartInstanceUUIDs(ENOVIA resultSet) {
if (resultSet == null) {
throw new ApplicationException("Illegal argument
exception: ENOVIA result set is null");
}
VPMBOPartInstance[] vpmBOPartInstances = resultSet.VPMBOPartInstance;
if (vpmBOPartInstances == null)
{
throw new ApplicationException("Failed to retrieve
VPMBOPartInstance objects");
}
string[] vpmBOPartInstanceUUIDs = new
string[vpmBOPartInstances.Length];
for (int i = 0; i <
vpmBOPartInstances.Length; i++) {
vpmBOPartInstanceUUIDs[i] = vpmBOPartInstances[i].CATJsyUUID;
}
return vpmBOPartInstanceUUIDs;
}
}
|
The CAAENOVWSUtils.ConvertFromHexToBinary
method can be found at:
<Source>\CAAENOVWSUtils.cs
|
-
<Source>
:
<Install>\CAAENOVWS.edu\CAAENOVWSDotNet1_1ClientBase.m\src
,
-
<Install>
: the root directory where the CAA CD-ROM is installed.
[Top]
Expanding Product Structures
In order to expand a product structure, you can use the following method available through the generated proxy
interface:
public
Status ExpandProductStructure(Identifier iObjectId, SelectExpression iSelect, int iDepth, ref ENOVIA oResult)
|
This method accepts the following parameters:
[in] iObjectId
|
The identifier of the parent object
|
[in] iSelect
|
The SelectExpression for query. See for [3] details
|
[in] iDepth
|
The depth of the structure that needs to be returned. '-1' will return all, '0' will return parent
(and optionally attached documents), '1' will return first level children
|
[in/out] oResult
|
The child part instances added to the parent
|
The following code demonstrates the use of the ExpandProductStructure
method:
public class CAAENOVWSProdStructCppWrapper {
...
public ENOVIA ExpandProductStructure(
string parentUUID,
int level,
string selectExpression) {
if (parentUUID == null) {
throw new ApplicationException("Illegal argument: parent
UUID is null");
} else if (level < 0) {
throw new ApplicationException("Illegal argument:
invalid level value");
}
Identifier parentId = ToIdentifier(parentUUID);
SelectExpression selectExp = new SelectExpression();
selectExp.Value = selectExpression;
ENOVIA resultSet = null;
try {
Status status =
proxy.ExpandProductStructure(
parentId, selectExp, level, ref
resultSet);
Console.WriteLine("Status: {0}", status.Status1);
} catch (Exception e) {
throw new ApplicationException("Failed to expand product
structure", e);
}
if (resultSet == null) {
throw new ApplicationException("Failed to expand product
structure");
}
return resultSet;
}
}
|
Deleting Child Parts
In order to delete child parts, you can use the following method available through the generated proxy interface:
public Status
DeleteChildPart(Identifier iParentId, Identifier[] iChildIds)
|
This method accepts the following parameters:
[in] iParentId
|
The identifier of the parent object in ENOVIA LCA V5
|
[in] iChildIds
|
The array of child identifiers
|
The following code demonstrates the use of the DeleteChildPart
method:
public class CAAENOVWSProdStructCppWrapper {
...
public void DeletePartInst(string
parentUUID, string[] partInstUUIDs) {
if (parentUUID == null) {
throw new Exception("Illegal argument: parent unique
identifier is null");
} else if (partInstUUIDs == null)
{
throw new Exception("Illegal argument: part instance UUID
array is null");
}
Identifier parentId = ToIdentifier(parentUUID);
Identifier[] partInstIds = ToIdentifierArray(partInstUUIDs);
try {
Status status = proxy.DeleteChildPart(parentId, partInstIds);
Console.Out.WriteLine("Status: {0}", status.Status1);
} catch (Exception e) {
throw new ApplicationException("Failed to delete part
instance(s)", e);
}
}
}
|
[Top]
Deleting Parts
In order to delete parts, you can use the following method available through the generated proxy interface:
public Status
DeletePart(Identifier[] iObjectIds)
|
This method accepts the following parameters:
[in] iObjectIds
|
List of identifiers for parts to be deleted
|
The following code demonstrates the use of the DeletePart
method:
public class CAAENOVWSProdStructCppWrapper {
...
public void DeletePartRef(string[]
partRefUUIDs) {
if (partRefUUIDs == null) {
throw new Exception("Illegal argument: part reference
UUID array is null");
}
Identifier[] partRefIds = ToIdentifierArray(partRefUUIDs);
try {
Status status = proxy.DeletePart(partRefIds);
Console.Out.WriteLine("Status: {0}", status.Status1);
} catch (Exception e) {
throw new ApplicationException("Failed to delete part
reference(s)", e);
}
}
}
|
[Top]
Sample Usage Scenario
The following code assumes assumes that a Product Root Class has been created using the ENOVIA V5 LCA product,
and that its V_ID is "IProdStructWS_CAA_PRC1". The code depends on:
- the CAAENOPosApplicationBinderImplWrapper class to manage a session with ENOVIA LCA V5. See [4] for details,
- the CAAENOVWSQueryCppWrapper class for query. See [5],
- the CAAENOVWSProdStructWrapper class to handle product structure management. See this document.
It demonstrates a sample usage scenario for the ENOVWSProdStructCpp CAA Web service:
public class CAAENOVWSProdStructCppUseCase {
private string uri = null;
private string credUser = null;
private string credPwd = null;
public CAAENOVWSProdStructCppUseCase(
string uri,
string credUser,
string credPwd) {
this.uri = uri;
this.credUser = credUser;
this.credPwd = credPwd;
}
public void RunSampleUsageScenario(string
enoviaUser) {
enoposapplicationbinderimpl.CAAENOPosApplicationBinderImplWrapper binderWrapper =
null;
enoposapplicationbinderimpl.SessionToken sessionToken = null;
try {
//
------------------------------------------------------------
// Step 1 - Instantiate and configure the proxies
// ------------------------------------------------------------
// Create a CookieContainer object to maintain the HTTP
session
// state accross proxies
CookieContainer container = new CookieContainer();
// Instantiate wrapper client classes
int timeOut = 360000;
binderWrapper =
new
enoposapplicationbinderimpl.CAAENOPosApplicationBinderImplWrapper(
container, uri, credUser, credPwd, timeOut);
enovwsquerycpp.CAAENOVWSQueryCppWrapper queryWrapper =
new
enovwsquerycpp.CAAENOVWSQueryCppWrapper(
container, uri, credUser, credPwd, timeOut);
enovwsprodstructcpp.CAAENOVWSProdStructCppWrapper prodStructWrapper =
new
enovwsprodstructcpp.CAAENOVWSProdStructCppWrapper(
container, uri, credUser, credPwd, timeOut);
//
------------------------------------------------------------
// Step 2 - Open session with ENOVIA LCA V5
// ------------------------------------------------------------
// Get user contexts
string[] userContexts =
binderWrapper.GetUserContexts(enoviaUser);
// Log in using the first available context
if (userContexts.Length == 0) {
throw new ApplicationException("No context found
for the user specified");
}
sessionToken = binderWrapper.Login(userContexts[0]);
//
------------------------------------------------------------
// Step 3 - Look up for product
//
// -- IProdStructWS_CAA_PRC1
// ------------------------------------------------------------
string productId = "IProdStructWS_CAA_PRC1";
StringBuilder xmlFilter = new StringBuilder();
xmlFilter.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
xmlFilter.Append("<FILTER CASESENSITIVE=\"TRUE\">");
xmlFilter.Append("<SELECT>");
xmlFilter.Append("<OBJECT DOMAIN=\"PRODUCT\" NAME=\"ENOVIA_VPMProductRootClass\"
>");
xmlFilter.Append("<ATTRIBUTE NAME=\"ENOVIA_VPMProductRootClass.V_ID\" />");
xmlFilter.Append("</OBJECT>");
xmlFilter.Append("</SELECT>");
xmlFilter.Append("<WHERE>");
xmlFilter.Append("<FILTER_CONDITION OPERATOR=\"AND\">");
xmlFilter.Append("<ATTRIBUTE_FILTER>");
xmlFilter.Append("<EXPRESSION OP=\"LIKE\" VALUE=\"" + productId + "\">");
xmlFilter.Append("<ATTRIBUTE NAME=\"ENOVIA_VPMProductRootClass.V_ID\" />");
xmlFilter.Append("</EXPRESSION>");
xmlFilter.Append(" </ATTRIBUTE_FILTER>");
xmlFilter.Append("</FILTER_CONDITION>");
xmlFilter.Append("</WHERE>");
xmlFilter.Append("</FILTER>");
enovwsquerycpp.ENOVIA queryResultSet =
queryWrapper.QueryObjects(xmlFilter.ToString());
string[] productUUIDs =
queryWrapper.GetENOVIA_VPMProductRootClassUUIDs(queryResultSet);
if (productUUIDs.Length == 0) {
throw new ApplicationException("Failed to find
product");
} else if (productUUIDs.Length > 1) {
throw new ApplicationException("Invalid state:
more than one product matched the input criteria");
}
string productUUID = productUUIDs[0];
CAAENOVWSUtils.DisplayResults(queryResultSet, 1);
//
------------------------------------------------------------
// Step 4 - Creating the following data
//
// --+ IProdStructWS_CAA_PRC1
// !
// +--+ IProdSrtuctWS_CAA_PartRef1.1 | IProdStructWS_CAA_PartRef1
// !
// +-- IProdStructWS_CAA_PartRef2.1 | IProdStructWS_CAA_PartRef2
// ------------------------------------------------------------
string envDomain = "PRODUCT";
// It is recommended that you always have user session setting
for create configured parts to FALSE,
// and pass in true here when you need to create configured
// We pass in false here in order to ensure that we can delete the object stucture
when finished
string configurable = "FALSE";
string partNumber1 = "IProdStructWS_CAA_PartRef1";
string partNumber2 = "IProdStructWS_CAA_PartRef2";
string[] partNumbers = { partNumber1, partNumber2 };
// Create the two part references
enovwsprodstructcpp.ENOVIA createPartRefResultSet =
prodStructWrapper.CreatePartRef(
partNumbers, envDomain, configurable);
string[] partRefUUIDs =
prodStructWrapper.GetENOVIA_VPMPartVersionUUIDs(
createPartRefResultSet);
if (partRefUUIDs.Length > 2) {
throw new ApplicationException("Invalid state:
more than 2 part references were returned");
} else if (partRefUUIDs.Length != 2) {
throw new ApplicationException("Failed to create
the 2 part references");
}
string partRefUUID1 = partRefUUIDs[0];
string partRefUUID2 = partRefUUIDs[1];
// Create first part instance
enovwsprodstructcpp.ENOVIA createPartInstResultSet1 =
prodStructWrapper.CreatePartInst(
productUUID, new string[] { partRefUUID1
});
string[] vpmBOPartInstanceUUIDArray1 =
prodStructWrapper.GetVPMBOPartInstanceUUIDs(
createPartInstResultSet1);
if (vpmBOPartInstanceUUIDArray1.Length != 1) {
throw new ApplicationException("Failed to create
part instance");
} else if (vpmBOPartInstanceUUIDArray1.Length > 1)
{
throw new ApplicationException("Invalid state:
more than one part instance was returned");
}
string partInstUUID1 =
vpmBOPartInstanceUUIDArray1[0];
// Create second part instance
enovwsprodstructcpp.ENOVIA createPartInstResultSet2 =
prodStructWrapper.CreatePartInst(
partInstUUID1, new string[] { partRefUUID2
});
string[] vpmBOPartInstanceUUIDArray2 =
prodStructWrapper.GetVPMBOPartInstanceUUIDs(
createPartInstResultSet2);
if (vpmBOPartInstanceUUIDArray2.Length != 1) {
throw new ApplicationException("Failed to create
part instance");
} else if (vpmBOPartInstanceUUIDArray2.Length > 1)
{
throw new ApplicationException("Invalid state:
more than one part instance was returned");
}
string partInstUUID2 =
vpmBOPartInstanceUUIDArray2[0];
//
------------------------------------------------------------
// Step 6 - Expand product structure and display content
// ------------------------------------------------------------
enovwsprodstructcpp.ENOVIA expandResultSet =
prodStructWrapper.ExpandProductStructure(productUUID, 2, null);
if (expandResultSet.ENOVIA_VPMProductRootClass ==
null || expandResultSet.ENOVIA_VPMProductRootClass.Length != 1) {
throw new ApplicationException("Failed to find
product root class");
} else if (expandResultSet.VPMBOPartInstance ==
null || expandResultSet.VPMBOPartInstance.Length != 2) {
throw new ApplicationException("Failed to find
item instances");
}
CAAENOVWSUtils.DisplayResults(expandResultSet, 2);
//
------------------------------------------------------------
// Step 6 - Deleting created data
//
------------------------------------------------------------
// Delete second part instance
prodStructWrapper.DeletePartInst(
partInstUUID1, new string[] { partInstUUID2
});
// Delete first instance
prodStructWrapper.DeletePartInst(
productUUID, new string[] { partInstUUID1
});
// Delete part references
prodStructWrapper.DeletePartRef(partRefUUIDs);
} catch (Exception e) {
...
} finally {
//
------------------------------------------------------------
// Step 7 - Terminate opened session
// ------------------------------------------------------------
// The session must be closed even if a call to a method on the
ENOVWSQueryCpp
// CAA Web service fails
binderWrapper.Logout(sessionToken);
}
}
}
|
The CAAENOVWSUtils.DisplayResults
method can be found at:
<Source>\CAAENOVWSUtils.cs
|
-
<Source>
:
<Install>\CAAENOVWS.edu\CAAENOVWSDotNet1_1ClientBase.m\src
,
-
<Install>
: the root directory where the CAA CD-ROM is installed.
[Top]
In Short
This use case explains how to use the C# client binding generated using the wsdl.exe utility in order to consume
the ENOVWSProdStructCpp CAA Web service. It also gives an overview of the available methods:
[Top]
References
History
Version: 1 [Jan 2006]
|
Document created
|
[Top]
|
Copyright © 2006, Dassault Systèmes. All rights reserved.