Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
How To Guide
- You must have access to a DataPower (physical or virtual) appliance as you must use the WSDL and XSD files provided by IBM which I cannot include in the project due to their licensing.
- Git must be installed on your machine (or you can use an alternative method to get a copy of the project).
- Maven must be installed on your machine.
Clone the project with Git
Use your IDE to clone the project from GitHub or use the Git command-line client as shown below. This will create a directory called 'datapower-api' in your current directory and will clone the project into that directory.
git clone https://github.com/conorgriffin/datapower-api.git
Add the files from the version of firmware you're using
From the appliance, download all files in the
store:/// directory with the prefix
xml-mgmt and place them inside the project directory
src/main/wsdl. This project was used with DataPower Firmware version 184.108.40.206 and below is a screenshot of the relevant directory listing from the
Note: You may exclude the files with
-2004 in their name as these are for backward compatibility with old versions. The remaining files that you should copy into the project's
src/main/wsdl directory from the appliance are listed below:
Customise the project
The project currently references IBM DataPower firmware version 220.127.116.11. If you are building a jar for any other firmware version you need to make the following change:
- Update the project version in the
pom.xmlfile to match the version of firmware the WSDL/XSD files are taken from. This ensures that when the jar is built it will have the correct version in its name and also if you publish the jar to your local Maven repository you can fetch it by this version number when you use it as a dependency in other projects.
Build the Java classes
Now that you have downloaded the project and copied the files from the IBM DataPower appliance into the correct directory, you just need to run a Maven build with the following goals:
You can do this in your IDE if it supports Maven or you can do it at the command line as follows:
mvn clean package
If you follow the instructions above and use the WSDL/XSD files from the 18.104.22.168 firmware you should not have any issues. However, if you use a different version of firmware you may get some errors during the build process. This will most likely be due to changes in the WSDL/XSD files for the specific version of firmware you're using. You may need to modify the
src/wsdl/bindings.xml file to resolve any issues you come across. There are already a number of bindings specified in that file for the 22.214.171.124 firmware version. To see a sample of the kinds of errors you may encounter you can remove some/all of the entries in that file and rebuild as described in the Build section above. Tackling specifics around this is beyond the scope of this guide.
The build should produce a jar file under the
target directory in the project named
datapower-api-126.96.36.199.jar. If you customised the version string because you were building for another DataPower firmware version then obviously the version strings will be different. The Maven
package command above will generate two source packages named
com.datapower.schemas.management.wsdl under the
src directory in the project containing all the java classes built from the WSDL file. These are the building blocks that you can combine to perform any sequence of administrative actions you need on DataPower appliances. You can run the jar file with the command below to verify which version of firmware it was built for:
conor@macbook:~/git/datapower/datapower-api $ java -jar target/datapower-api-188.8.131.52.jar Compiled from DataPower firmware version 184.108.40.206