The BEA AquaLogic Service Registry XSLT2UDDI demo set demonstrates the BEA AquaLogic Service Registry application programming interface's capabilities and shows how to use the XSLT2UDDI API to manipulate XSLT documents.
The demos set includes the following demos:
FindXslt
FindXsltMapping
GetXsltDetail
PublishXslt
UnpublishXslt
We expect that you have already installed the BEA AquaLogic Service Registry and set the REGISTRY_HOME environment variable to the registry's installation location.
To run the BEA AquaLogic Service Registry's demos, your registry must be running. To start the BEA AquaLogic Service Registry, execute the serverstart script:
Windows: | %REGISTRY_HOME%\bin\serverstart.bat |
UNIX: | $REGISTRY_HOME/bin/serverstart.sh |
It is necessary to configure the demos. The configuration system has two levels: global and local. The properties defined at the global level may be overwritten at the local level. The global properties are located in the file:
Windows: | %REGISTRY_HOME%\demos\env.properties |
UNIX: | $REGISTRY_HOME/demos/env.properties |
The values set during the installation of the BEA AquaLogic Service Registry work out of box, and their modification affects all demos. If you need to redefine the value of some property for a single demo (that is, at the local level), edit env.properties. This file is located in the same directory as the file run.sh (run.bat). Local level properties for the XSLT2UDDI demos are loaded from the file:
Windows: | %REGISTRY_HOME%\demos\resources\xslt\env.properties |
UNIX: | $REGISTRY_HOME/demos/resources/xslt/env.properties |
Table 20. Properties Used in Demos
Name | Default Value | Description |
---|---|---|
uddi.demos.user.john.name | demo_john | first user's name |
uddi.demos.user.john.password | demo_john | first user's password |
uddi.demos.url.xslt2uddi | http://localhost:8080/uddi/xslt2uddi | the xslt2uddi Web service port URL |
uddi.demos.url.security | http://localhost:8080/uddi/security | the security Web service port URL |
This section describes the programming pattern used in all demos using the PublishXslt demo as an example. You can find its source code in the file:
Windows: | %REGISTRY_HOME%\demos\resources\xslt\src\demo\uddi\xslt\PublishXslt.java |
UNIX: | $REGISTRY_HOME/demos/resources/xslt/src/demo/uddi/xslt/PublishXslt.java |
The helper method createPublishXslt creates a Publish_xslt structure:
public Publish_xslt createPublishXslt(String location, String publishingMethod, String importMethod, String schemaMethod, String authInfo) throws InvalidParameterException { System.out.println("location = " + location); Publish_xslt publish = new Publish_xslt(); publish.setLocation(location); publish.setPublishingMethod(PublishingMethod.getPublishingMethod(publishingMethod)); publish.setImportMethod(RefPublishingMethod.getRefPublishingMethod(importMethod)); publish.setSchemaMethod(RefPublishingMethod.getRefPublishingMethod(schemaMethod)); publish.setAuthInfo(authInfo); return publish; }
The publishXsltResource method performs the publishing operation:
public XsltMapping publishXsltResource(Publish_xslt publish) throws UDDIException, SOAPException { System.out.print("Check structure validity .. "); try { publish.check(); } catch (InvalidParameterException e) { System.out.println("Failed!"); throw new UDDIException(e); } System.out.println("OK"); Xslt2uddiApi xsltApi = getXslt2UddiStub(); System.out.print("Publishing in progress ..."); XsltMapping xsltMapping = xsltApi.publish_xslt(publish); System.out.println(" done"); return xsltMapping; }
This section shows, how to build and run the BEA AquaLogic Service Registry XSLT2UDDI demo set. Let us continue with our PublishXslt demo.
Be sure that the demos are properly configured and the BEA AquaLogic Service Registry is up and running.
Change your working directory to
Windows | %REGISTRY_HOME%\demos\resources\xslt |
UNIX | $REGISTRY_HOME/demos/resources/xslt |
Build all demos using:
Windows: | run.bat make |
UNIX: | ./run.sh make |
![]() | Note |
---|---|
When compiling demos on Windows platforms, you may see the following text: A subdirectory or file ..\..\common\.\build\classes already exists. This is expected and does not indicate a problem. |
To get list of all available demos, run
Windows: | run.bat help |
UNIX: | ./run.sh help |
The selected demo can be executed via the run command using the name of the demo as a parameter. For example, to run the PublishWSDL demo, invoke
Windows: | run.bat PublishXslt |
UNIX: | ./run.sh PublishXslt |
The output of this demo will resemble the following:
********************************************************************** *** BEA AquaLogic Service Registry Demo - PublishXslt *** ********************************************************************** Publishing XSLT with the following parameters: Enter XSLT location (URI) [http://localhost:8080/uddi/doc/demos/employeesToDepartments.xsl]: Enter publishing method (update,create) [update]: Enter import publishing method (reuse,create,ignore) [reuse]: Enter schema publishing method (reuse,create,ignore) [reuse]: Using Security at url https://localhost:8443/uddi/security .. done Logging in .. done location = http://localhost:8080/uddi/doc/demos/employeesToDepartments.xsl Check structure validity .. OK Using XSLT2UDDI at url https://localhost:8443/uddi/xslt2uddi .. done Publishing in progress ... done XSL transformation http://localhost:8080/uddi/doc/demos/employeesToDepartments.xsl <xsltMapping xmlns="http://systinet.com/uddi/xslt2uddi/v3/5.5"> <name xmlns="urn:uddi-org:api_v3">employeesToDepartments.xsl</name> <tModelKey xmlns="urn:uddi-org:api_v3">uddi:systinet.com:demo:xslt:employeesToDepartments</tModelKey> <location>http://localhost:8080/uddi/doc/demos/employeesToDepartments.xsl</location> <contentMapping> <inputSchemaList> <xmlSchema> <namespace>http://systinet.com/uddi/demo/employeeList</namespace> <location>http://localhost:8080/uddi/doc/demos/employees.xsd</location> <tModelRef> <name xmlns="urn:uddi-org:api_v3">employees.xsd</name> <tModelKey xmlns="urn:uddi-org:api_v3">uddi:systinet.com:demo:xsd:employees</tModelKey> </tModelRef> </xmlSchema> </inputSchemaList> <outputTypeList> <outputType> <xmlSchema> <namespace>http://systinet.com/uddi/demo/companyDepartments</namespace> <location>http://localhost:8080/uddi/doc/demos/departments.xsd</location> <tModelRef> <name xmlns="urn:uddi-org:api_v3">departments.xsd</name> <tModelKey xmlns="urn:uddi-org:api_v3">uddi:systinet.com:demo:xsd:departments</tModelKey> </tModelRef> </xmlSchema> </outputType> </outputTypeList> <outputMethod>xml</outputMethod> </contentMapping> </xsltMapping> Logging out .. done