Uploading customization package to SDL WorldServer using Java

In this article, I present a solution for uploading a customization package (zip file containing a desc.xml) using a Java method.

Click here to view the upload customization method code

The method takes three parameters:

  1. wsBaseUrl
  2. token
  3. customizationFile

The wsBaseUrl must be the <serverURL>:<portnumber> where your WorldServer instance is running.

The second parameter is a security token, which can be retrieved by using the SDL WorldServer REST API as explained here.

The third parameter is the customization zip file containing the compiled customization classes and the XML descriptor file.

This solution relies on the same "management_customization" servlet used by the WorldServer UI for uploading customizations. Certain parameter values (i.e. "comp_type", "submittedBy") are hard-coded to impersonate the UI selection process and allow the upload to proceed.