Version 9.6
 —  Importing Objects Using the API  —

Invoking an Importer from a Java Class

Each importer includes a main() method, which allows it to be called from a Windows batch file or from a UNIX shell script.

To invoke an importer from the command line, you must perform the following high-level steps:

  1. Create a script file as described in Creating a Script File to Invoke an Importer.

  2. Execute the script file with the appropriate input parameters as described in Executing the Script File that Invokes an Importer.


Creating a Script File to Invoke an Importer

The importers are Java classes whose main() method executes when you run the importer class from the command line. To ensure that the CLASSPATH and other environment variables are set properly when you run the importer class, you must create a script file as described in the following sections:

Creating a Script File for Windows (a .bat file)

Create a script file that looks as follows if CentraSite is running under Windows.

@echo off 
set JAVAEXE=fullPathToJava.exe
set REDIST=CentraSiteHomeDirectory\redist
set BASEDIR=%~dp0
cd /d %REDIST%

REM build CLASSPATH with all files from jar directory
set LOCAL_CLASSPATH= 
for %%I in (".\*.jar") do call "CentraSiteHomeDirectory\bin\cfg\lcp.cmd" %%I

%JAVAEXE% -cp %LOCAL_CLASSPATH% importerClassName %*
cd /d %BASEDIR%

Where importerClassName is the name of the Importer class that you want to run. See Importer Class Names for a list of the importer class names.

Example

The following is an example of a script file that calls the XML Schema importer:

@echo off 
REM
REM Run XML Schema Importer 
REM
set JAVAEXE=D:\software\java\jdk1.5.0_12\bin\java
set REDIST=C:\SoftwareAG\CentraSite\redist 
set BASEDIR=%~dp0
cd /d %REDIST%

REM build CLASSPATH with all files from jar directory
set LOCAL_CLASSPATH= 
for %%I in (".\*.jar") do call "C:\SoftwareAG\CentraSite\bin\cfg\lcp.cmd" %%I

%JAVAEXE% -cp %LOCAL_CLASSPATH% com.centrasite.jaxr.schema.SchemaImporter %* 
cd /d %BASEDIR%

Creating a Script File for Unix (C-shell script)

Create a script file that looks as follows if CentraSite is running under Unix.

set javaexe="fullPathToJava.exe"
set redist="CentraSiteHomeDirectory/redist"
set mainjar="CentraSiteUtils.jar" 
set delim='\:'
cd "$redist" 
set cl="" 
foreach j ( 'ls *.jar' ) 
  if ($cl != "") set cl=${cl}${delim} 
  set cl=${cl}${j} 
end
setenv CLASSPATH ${mainjar}${delim}${cl}
$javaexe importerClassName $*

Where importerClassName is the name of the Importer class that you want to run. See Importer Class Names for a list of the importer class names.

Example

The following is an example of a script file that calls the XML Schema importer:

#!/bin/csh 
#
# Run XML Schema Importer 
#
set javaexe="/mydir/softwareag/cjp/v16/bin/java" 
set redist="/mydir/softwareag/CentraSite/redist" 
set mainjar="CentraSiteUtils.jar" 
set delim='\:' 
# build CLASSPATH with all files from jar directory
cd "$redist" 
set cl="" 
foreach j ( 'ls *.jar' )
  if ($cl != "") set cl=${cl}${delim}
  set cl=${cl}${j}
end
setenv CLASSPATH ${mainjar}${delim}${cl} 
$javaexe com.centrasite.jaxr.schema.SchemaImporter $*

Top of page

Importer Class Names

The following are the class names for the importers:

Note:
Some importers have an import class, which you use to import the asset, and an admin utility class, which you can use to delete or replace the asset after it has been imported.

Importer or Admin Utility that You Want to Use Class Name
Web Service (Importer) com.centrasite.jaxr.webservice.WebServiceRegistrator
Web Service (Admin utility) com.centrasite.jaxr.webservice.WebServiceAdministrator
XML Service (Importer) com.centrasite.jaxr.xmlservice.XMLServiceManager
REST Service (Importer) com.centrasite.jaxr.xmlservice.XMLServiceManager
XML Schema (Importer) com.centrasite.jaxr.schema.SchemaImporter
XML Schema (Admin utility) com.centrasite.jaxr.schema.SchemaAdministrator
BPEL Process Definition (Importer) com.centrasite.jaxr.bpel.BPELRegistrator
BPEL Process Definition (Admin utility) com.centrasite.jaxr.bpel.BPELAdministrator
XPDL File (Importer) com.centrasite.jaxr.xpdl.ImportXPDL

Top of page

Executing the Script File that Invokes an Importer

To invoke the importer, you must run the importer script file with the required set of input parameters. (If you need information about creating the script file, see Creating a Script File to Invoke an Importer.)

The input parameters that are required to run the script file will vary depending on the importer your script file invokes. The input parameters for each importer are described in the following sections:

Importing a Web Service

To import a Web service, run your importer script file with the following required input parameters:

yourScriptFile -w wsdlFile -o orgName -user yourCSUserID -password yourPassword

Example

myScript -w d:\myDirectory\myWSDLFile.wsdl -o "Customer Service" -user jcambrose -password j45Hk19a

Input Parameters

The following table describes the complete set of input parameters that you can use with the Web Service importer:

Parameter Description
-w wsdlFile Required. The fully qualified name of the WSDL file that you want to import.
-o orgName Required. The name of the organization into which you want to import the Web service. If the organization name contains a space, enclose the name in double-quotes.
-user yourCSUserID Required. Your CentraSite user ID.
-password password Required. The password for your CentraSite user account.
-h hostName The host name or IP address of the computer where the CentraSite registry/repository component is running.

If you omit this parameter, the importer assumes that the registry/repository is running on localhost.

-p portNumber The port number on which the CentraSite registry/repository is configured to listen for incoming requests.

If you omit this parameter, the importer assumes that the registry/repository is listening on the default port, 53307.

-dburl url The fully qualified URL for the CentraSite registry/repository.

If you omit this parameter, the importer assumes that the registry/repository resides at http://localhost:53307/CentraSite/CentraSite.

Note:
You can also obtain the complete list of input parameters for the Web Service importer by invoking the importer with no input parameters.

Invoking the Web Service Administrator from the Command Line

You can invoke the Web Service Administrator utility to delete a Web service that has been imported into CentraSite. To obtain the input parameters used by this utility, run the script file with no input parameters.

Importing an XML Schema

To import an XML Schema, run your importer script file with the following input parameters:

yourScriptFile -s xsdFile -user yourCSUserID -password yourPassword

Example

myScript -s d:\myDirectory\myXSDFile.xsd -user jcambrose -password j45Hk19a

Input Parameters

The following table describes the complete set of input parameters that you can use with the XML Schema importer:

Parameter Description
-s xsdFile Required. The fully qualified name of the XML Schema file that you want to import.
-user user ID Required. Your CentraSite user ID.
-password password Required. The password for your CentraSite user account.
-h hostName The host name or IP address of the computer where the CentraSite registry/repository component is running.

If you omit this parameter, the importer assumes that the registry/repository is running on localhost.

-p portNumber The port number on which the CentraSite registry/repository is configured to listen for incoming requests.

If you omit this parameter, the importer assumes that the registry/repository is listening on the default port, 53307.

-dburl url The fully qualified URL for the CentraSite registry/repository.

If you omit this parameter, the importer assumes that the registry/repository resides at http://localhost:53307/CentraSite/CentraSite.

Note:
If the registry/repository is running on a different machine and port number, you can use this parameter to specify its location instead of using the individual -h and -p parameters. (If you specify the -dburl parameter with the -h and/or -p parameters, the -h and -p parameters will be ignored.)

-noover Prevents the importer from overwriting a schema if it is already present in the registry.

Note:
You can also obtain the complete list of input parameters for the XML Schema importer by invoking the importer with no input parameters.

Invoking the XML Schema Administrator from the Command Line

You can invoke the XML Schema Administrator utility to delete an XML Schema that has been imported into CentraSite. To obtain the input parameters used by this utility, run the script file with no input parameters.

Importing an XML Service

To import an XML Service, run your importer script file with the following input parameters:

yourScriptFile -s xmlFileURI -n serviceName -e endpointURL -m httpMethods -dbuser yourCSUserID -dbpassword yourPassword

Example

myScript -s http://fs02hq/xml/myService.xsd -n myXMLService -e http://appsvr02:53307/myService -m GET PUT -dbuser jcambrose -dbpassword j45Hk19a

Input Parameters

The following table describes the complete set of input parameters that you can use with the XML Service importer:

Parameter Description
-s xsdFile Required. The URI (file: or http:) of the XML Schema file from which the XML service is created.
-n serviceName Required. The name that is to be assigned to the service.
-e endpointURL Required. The URL where the service is deployed. (The access point for the service.)
-m httpMethods Required. The HTTP access methods that the service supports. Valid values are: GET, POST, PUT, DELETE. If the service supports multiple methods, list the methods separated by spaces (e.g., -m GET PUT DELETE).
-dbuser user ID Required. Your CentraSite user ID. (This user account must have permission to create assets in the organization to which the service will be added.)
-dbpassword password Required. The password for your CentraSite user account.
-dbhost hostName

The host name or IP address of the computer where the CentraSite registry/repository component is running.

If you omit this parameter, the importer assumes that the registry/repository is running on localhost.

-dbport portNumber

The port number on which the CentraSite registry/repository is configured to listen for incoming requests.

If you omit this parameter, the importer assumes that the registry/repository is listening on the default port, 53307.

-suser xsdFileUser The user ID that is to be used if the XSD file (specified in the -s parameter) resides on a secure server and the importer is required to provide a user ID and password to access it.
-spassword xsdFilePassword The password for the user account in -suser.
-noover Do not overwrite existing imported XML Schemas that exist in the registry.
-desc description

The description that is to be assigned to the XML Service.

If you omit this parameter, the service description will be empty.

-ver versionID

The version identifier that is to be assigned to the XML Service. (This is the user-defined identifier, not the system-assigned version number.)

If you omit this parameter, the version identifier will be set to 1.0.

-porg providingOrg

The name of the organization that is to be designated as the providing organization for this service.

If you omit this parameter, the providing organization will be set to the Default Organization.

-sorg submittingOrg

The name of the organization to which this service is to be added.

If you omit this parameter, the service will be added to the Default Organization.

Note:
You can also obtain the complete list of input parameters for the XML Service importer by invoking the importer with no input parameters.

Importing a REST Service

To import a REST Service, run your importer script file with the following input parameters:

yourScriptFile -s xmlFileURI -n serviceName -e endpointURL -m httpMethods -dbuser yourCSUserID -dbpassword yourPassword

Example

myScript -s http://fs02hq/xml/myService.xsd -n myXMLService -e http://appsvr02:53307/myService -m GET PUT -dbuser jcambrose -dbpassword j45Hk19a

Input Parameters

The following table describes the complete set of input parameters that you can use with the REST Service importer:

Parameter Description
-s xsdFile Required. The URI (file: or http:) of the XML Schema file from which the REST service is created.
-n serviceName Required. The name that is to be assigned to the service.
-e endpointURL Required. The URL where the service is deployed. (The access point for the service.)
-m httpMethods Required. The HTTP access methods that the service supports. Valid values are: GET, POST, PUT, DELETE. If the service supports multiple methods, list the methods separated by spaces (e.g., -m GET PUT DELETE).
-dbuser user ID Required. Your CentraSite user ID. (This user account must have permission to create assets in the organization to which the service will be added.)
-dbpassword password Required. The password for your CentraSite user account.
-dbhost hostName

The host name or IP address of the computer where the CentraSite registry/repository component is running.

If you omit this parameter, the importer assumes that the registry/repository is running on localhost.

-dbport portNumber

The port number on which the CentraSite registry/repository is configured to listen for incoming requests.

If you omit this parameter, the importer assumes that the registry/repository is listening on the default port, 53307.

-suser xsdFileUser The user ID that is to be used if the XSD file (specified in the -s parameter) resides on a secure server and the importer is required to provide a user ID and password to access it.
-spassword xsdFilePassword The password for the user account in -suser.
-noover Do not overwrite existing imported XML Schemas that exist in the registry.
-desc description

The description that is to be assigned to the REST Service.

If you omit this parameter, the service description will be empty.

-ver versionID

The version identifier that is to be assigned to the REST Service. (This is the user-defined identifier, not the system-assigned version number.)

If you omit this parameter, the version identifier will be set to 1.0.

-porg providingOrg

The name of the organization that is to be designated as the providing organization for this service.

If you omit this parameter, the providing organization will be set to the Default Organization.

-sorg submittingOrg

The name of the organization to which this service is to be added.

If you omit this parameter, the service will be added to the Default Organization.

Note:
You can also obtain the complete list of input parameters for the REST Service importer by invoking the importer with no input parameters.

Importing a BPEL Process

To import a BPEL process, call your importer script file with the following input parameters:

yourScriptFile -file bpelFile -user yourCSUserID -password yourPassword

Example

myScript -file d:\myDirectory\myBPELFile.bpel -user jcambrose -password j45Hk19a

Input Parameters

The following table describes the complete set of input parameters that you can use with the BPEL importer:

Parameter Description
-file bpelFile Required. The fully qualified name of the BPEL process file that you want to import.
-user user ID Required. Your CentraSite user ID.
-password password Required. The password for your CentraSite user account.
-h hostName Optional. The host name or IP address of the computer where the CentraSite registry/repository component is running.

If you omit this parameter, the importer assumes that the registry/repository is running on localhost.

-p portNumber The port number on which the CentraSite registry/repository is configured to listen for incoming requests.

If you omit this parameter, the importer assumes that the registry/repository is listening on the default port, 53307.

-dburl url The fully qualified URL for the CentraSite registry/repository.

If you omit this parameter, the importer assumes that the registry/repository resides at http://localhost:53307/CentraSite/CentraSite.

Note:
If the registry/repository is running on a different machine and port number, you can use this parameter to specify its location instead of using the individual -h and -p parameters. (If you specify the -dburl parameter with the -h and/or -p parameters, the -h and -p parameters will be ignored.)

-nowarning Suppresses the warning message that the importer issues if the BPEL process references a BPEL Partner Link Type that refers to a Web service that is not present in the CentraSite registry.

Note:
You can also obtain the complete list of input parameters for the BPEL importer by invoking the importer with no input parameters.

Invoking the BPEL Administrator from the Command Line

You can invoke the BPEL Administrator utility to delete or display a BPEL process that has been imported into CentraSite. To obtain the input parameters used by this utility, invoke the BPEL administrator with no input parameters.

Importing an XPDL File

To import an XPDL file, call the importer script file from the command line as shown below.

yourScriptFile -file xpdlFile -user yourCSUserID -password yourPassword

Note:
For additional input parameters that you can use with this importer, see Input Parameters below.

Example

myScript -file d:\myDirectory\myXPDLFile.xpdl -user jcambrose -password j45Hk19a

Input Parameters

The following table describes input parameters that you can use with the XPDL importer:

Parameter Description
-file xpdlFile Required. The fully qualified name of the XPDL file that you want to import.
-user user ID Required. Your CentraSite user ID.
-password password Required. The password for your CentraSite user account.
-h hostName The host name or IP address of the computer where the CentraSite registry/repository component is running.

If you omit this parameter, the importer assumes that the registry/repository is running on localhost.

-p portNumber The port number on which the CentraSite registry/repository is configured to listen for incoming requests.

If you omit this parameter, the importer assumes that the registry/repository is listening on the default port, 53307.

Note:
You can also obtain the complete list of input parameters for the XPDL importer by calling the script file with no input parameters.

Top of page