A Java compliant WSDL file for Zimbra Admin’s SOAP API

Not too long ago I had to interface with Zimbra‘s admin API for one of my projects, and quickly realized that it is er.. a little weird. You see, Zimbra has a SOAP (and also a limited REST) API, but does not does not publish a WSDL for them. Neither is an xsd or DTD available to validate your requests against or to generate client stubs. To make things worse, the only documentation available is a lengthy but simple text file which lists the available operation names as tags and the attributes / elements that go with each of them. In case you are interested in this file, you can find it in the docs folder of your Zimbra installation.

The first thing I tried was, of course, to try and flesh out my own, but quickly realized that I was going to miss my project deadline if I went that route. I then remembered that Zimbra already has a Java client. Aha! So I checked the project out from the repository and started exploring the source code. The code encapsulated each operation into a request and a response object, which were really extensions of their parent templates. The algorithm for interfacing with the server was implemented in these abstract parent classes, and each sub class overrode a couple of methods and provided the behaviour specific to each operation. While the source code gave me great insight into the inner workings of the API, one problem still remained.

All the operations available in the API are segregated into one of two sections, the mailbox (user) side and the admin side. The problem was that the Zimbra client only had implementations for the user set of APIs, and I needed to interface with the admin side of things.

So I went back to Google, and this time stumbled upon this great piece of work done by the folks running this website here. These folks must have been in the same boat as me a while back, and they actually managed to roll out their own WSDL for the admin api. Awesome! I finally had something concrete to work with. I quickly downloaded the wsdl and pointed CXF’s wsdl2java at it. Alas, it wasn’t that easy. The folks who wrote this seem to be Rubyists, and even though they claim it works with their Ruby client builder script, none of the Java implementations agreed with them.

So I fired up Eclipse, and had to apply a bunch of fixes, most of them related to namespaces and element ordering, before I had a file that validated perfectly. I also added a couple more operations that I thought I would need while I was at it. Note that all available operations still haven’t been implemented. If you do improve on it, please report back so I can update the file and others could benefit as well. This file has been tested to work with ZCS 6 and 7.

So there you have it folks, without any further ado, I present the elusive Java compliant WSDL for Zimbra’s SOAP API.

You can download the WSDL file here.

Last time I checked Java 6′s wsimport and wsgen were still complaining about something in the file, so I also zipped up the proxy client stubs generated by CXF 2.5, which can be downloaded here

You might also like
I had to learn the hard way today about the nasty issue surrounding Java's TreeSet / TreeMap implementations. The problem is that the removeAll method doesn't always do what it ...
READ MORE
If you are reading this post, chances are you administer a Zimbra mail server, and you need to recover an email that was blocked by amavisd for one of your ...
READ MORE
ZadmiN Monitor
ZadmiN lets you manage, monitor and administer any number of VMware Zimbra email servers from your Android smartphone or tablet without enduring the hassles of using ...
READ MORE
I recently had to evaluate CXF to expose existing services in a Spring project. I thought I would jot down my thoughts and conclusions from my experiments with the technology, ...
READ MORE
Tapestry 5 DateField as 3 Select Dropdowns
Tapestry 5 has an excellent javascript-based date picker component called DateField, which greatly simplifies the task of entering a properly formatted date for the user. The component gets the job ...
READ MORE
Zimbra and Postfix Policyd (cbpolicyd)
I was looking for a way to throttle the number of emails sent / received per account per hour on Zimbra servers. After a little digging around, I stumbled upon ...
READ MORE
Step 1
If you are reading this post, chances are, you have either recently purchased or are contemplating purchasing the ZadmiN app. If you haven't checked it out already, Prerequisites The following ...
READ MORE
Modifying a JasperReports chart at run time
To modify a report at run time, it is imperative to understand the overall process of how a jrxml ends up in its final form as an image / pdf ...
READ MORE
Block entire countries on Ubuntu server with Xtables and GeoIP
Anyone who has administered even a moderately high traffic server will have noticed that certain unwelcome traffic such as port scans and probes tend to come from IP addresses belonging ...
READ MORE
Manually Installing Alfresco on Ubuntu Server
I had to install Alfresco recently on a 32 bit server. Since Alfresco does not provide a 32 bit installer any more, I had to put everything together manually, and ...
READ MORE
Bitten by the Java TreeMap removeAll bug
Zimbra – Releasing quarantined emails and attachments
ZadmiN – VMware Zimbra Administration app for Android
JAX-WS Web Services with Spring and Apache CXF
Tapestry 5 DateField as 3 Select Dropdowns
Zimbra and Postfix Policyd (cbpolicyd)
Configuring ZadmiN for Android with your VMWare Zimbra
Modifying a JasperReports chart at run time
Block entire countries on Ubuntu server with Xtables
Manually Installing Alfresco on Ubuntu Server

Leave a Reply

Your email address will not be published. Required fields are marked *


nine × 1 =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>