Monday, April 6, 2009

Endpoint Configurator tool in AIA FP

What is this tool?

This tool should be used to replace Dev/QA server details from the source code with the token values and at install time, it should be used to replace the token values to target server urls.

Endpoint Configurator can be used on any xml based file, provided the URL can be obtained using an xpath. It will replace the server details where the urls are of the form http://hostname:port/....
Examples of xpaths can be: //@schemaLocation , //@location

Where to find:
AIA_HOME/util/EndpointConfigurator

How to use:

1. Create the EndpointConfig.properties file

We need to create one EndPointConfig.properties file. The contents of the file would look as below:

home.dir1.http.hostname = soa.hostname
home.dir1.http.port = soa.port
home.dir1 = aia.home/AIAComponents
home.dir1.filetypes = bpel,esbsvc,wsdl,xsl,xsd
home.dir1.xpath1 = //@schemaLocation
home.dir1.xpath2 = processing-instruction("oracle-xsl-mapper")
home.dir1.xpath3 = /BPELSuitcase/BPELProcess/partnerLinkBindings/property
home.dir1.xpath4 = //wsdlURL
home.dir1.xpath5 = //concreteWSDLURL
home.dir1.xpath6 = //soapEndpointURI

· At build time, home.dir1.http.hostname, home.dir1.http.port properties should be populated with token values and, at install time these values should be populated with target server details
· home.dir1 takes the directory location which Endpoint Configurator should traverse.
· home.dir1.filetypes takes the list of file extensions which Endpoint Configurator should consider for parsing. File extensions should be separated by a comma and no space is allowed after the comma.
Valid: home.dir1.filetypes = bpel,esbsvc,wsdl,xsl,xsd
Invalid: home.dir1.filetypes = bpel, esbsvc, wsdl, xsl, xsd
Invalid: home.dir1.filetypes = .bpel, .esbsvc, .wsdl, .xsl, .xsd
· List of xpaths should be specified using home.dir1.xpath property. There is no limit on the no of xpaths, but all the xpath numbers should be sequential.


We can execute Endpoint Configurator on multiple directories by specifying multiple home.dir values.
Look at AIA_HOME/util/EndpointConfigurator/FPEndpointConfigurator.properties.tmpl for a sample properties file.


The directory locations specified by home.dir should always be relative to AIA Home and AIA home should always be represented with token “aia.home”

2. Invoking Endpoint Configurator from command prompt

To invoke Endpoint Configurator from command line custom properties file should be passed as an argument. Navigate to Endpoint Configurator folder AIAHome/util/EndpointConfigurator and invoke Endpoint Configurator as follows:

ant runEndpointConfigurator –DEndPointConfigFilePath=”EndpointConfig_ file_path”

Ex:
ant runEndpointConfigurator –DEndPointConfigFilePath=${aia.home}/util/EndpointConfigurator/EndpointConfigurator.properties.

Post Execution steps:
Check the server url mentioned in the xpaths from the EndpointConfigurator.properties, check whether the URL have been changed from the dev url to QA url.