While building the Ceres app which Ben Turner made a presentation about at a recent Percussion gathering, I felt compelled to build an Object-Oriented API to encapsulate the rather cryptic Web Services API.
The cool bit about this API it also reads from a custom XML format that’s much easier to build than a webservices xml request. This part of the process allows my app to use XSLT to convert RSS feeds into this XML format then immediately drop them into the CM System.
Unfortunately, my inline comments are a bit sparse and the javadocs haven’t been filled out yet.
However, I’ve included a schema file for the Item XML that should help if you want to use that feature. and a sample XML file to fiddle with… of course, since you’ll have different content types, the sample won’t work for you, but it should illustrate the format.
Finally revisited this code and found that, not only did I not free it from dependencies to my own code, I also didn’t list the external dependencies.
So, I’ve refactored the package names, cleaned up the dependencies and here’s a list of the external dependencies:
You will need to include the following JAR files in your classpath, most will be available in the standard Rhythmyx installation:
[ul]
[li]activation.jar - from http://java.sun.com; If you are using J2EE, you will not need this.
[/li][li]axis.jar
[/li][li]axis-ant.jar
[/li][li]comons-codec.jar
[/li][li]commons-collections.jar
[/li][li]commons-digester.jar
[/li][li]commons-discovery.jar
[/li][li]commons-lang.jar
[/li][li]commons-logging.jar
[/li][li]commons-logging-api.jar
[/li][li]jaxrpc.jar - from http://java.sun.com; If you are using J2EE, you will not need this.
[/li][li]log4j.jar
[/li][li]rxwebserviceclient.jar
[/li][li]saaj.jar
[/li][li]saxon.jar - available from http://saxon.sourceforge.net/
[/li][li]soap.jar
[/li][*]wsdl4j.jar[/ul]
This code doesn’t include any error checking or exception handling, but it’s the basic gist of how the package works.
You can also create RxItem objects by hand, pass them the save() method and accomplish the same things. The main thing about this package is that all the various webservices calls necessary to save an item to the server are encapsulated behind less intimidating methods.