How to develop a SOAP client from Alfresco Repository

Due to integration requirements with legacy old systems, it happens that Alfresco Repository must invoke an external SOAP endpoint. As Alfresco Repository web application includes a changing JAR Library catalog, using an out-of-the-box implementation to build SOAP clients is advisable.

The target scenario

I selected a sample Global Weather SOAP Web Service endpoint available at 

Starting from WSDL is always a must when build a SOAP Web Service for both client and server parts.

Alfresco repository will invoke this endpoint from a Web Script to proxy parameters and results in a REST invocation.

Creating an standard JAXWS client project

Source code available at

Once the project is compiled with Maven, client Java classes are packaged into the target JAR. In order to use this client, simple invocations can be done.

GlobalWeather service = new GlobalWeather(new URL(""));
String cities = service.getGlobalWeatherSoap().getCitiesByCountry("Spain");

In order to make the JAR available to Maven for next step, an installation is required.

$ mvn clean install

Creating an Alfresco Repository Module for Web Scripts

Source code available at

As JAXWS client does not include any external dependency, the library can be included directly in pom.xml file.

Web Scripts are defined in a standard way:

SOAP Endpoint URL has been declared as property in to make easier changes in the configuration.

Inside Java controller implementation, SOAP JAXWS standard client is invoked:

String country = req.getServiceMatch().getTemplateVars().get("country");

GlobalWeather service = new GlobalWeather(new URL(url));
String cities = service.getGlobalWeatherSoap().getCitiesByCountry(country);

Map<String, Object> model = new HashMap<String, Object>();
model.put("cities", cities);
return model;


Once the project is deployed or even using script from Maven project, SOAP services can be accessed by using Alfresco REST API.



Including new features inside Alfresco Repository is not a complex project, but using the simplest way is always worthy: upgrading and updating processes will be as safe as the are!


Published by angelborroy

Understanding software.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: