Legacy Knowledge Base
Published Jul. 2, 2025

How to build a SOAP JAX-WS (Java API for XML Web Services) client using the Liferay infrastructure.

Written By

Sergio Alonso

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

Issue

  • We have a WSDL (Web Services Description Language) descriptor and we need to build a client from it. Finally, we will make this service (client) available to any application installed on our Liferay instance.

Environment

  • Liferay DXP 7.x
  • wsimport tool from Oracle JDK 8.

Resolution

Implementation of the SOAP client
In order to call the SOAP service we need to create the stubs that will be our interface that will allow us to interact with the remote service through the SOAP protocol.

To create all the java code we need, starting from the WSDL document, we usually use the wsimport tool.

At this point all that remains is to run the wsimport command whose output will be the generation of the Java classes (stub). Now we have everything we need to be able to implement the SOAP client.

Configuration of the JAX-WS API and CXF EndPoints
Everything we have seen so far could not work until these two components are configured on the Liferay system:

  • CXF EndPoints
  • JAX-WS API

This configuration should only be necessary if we decide to develop and publish SOAP services on our Liferay instance.

Even if we act as a SOAP client we must configure these two components so that the JAX-WS provider is correctly configured and we can use the JAX-WS API without incurring any error.

The configurations for CXF and JAX-WS, and in particular the Context Path, can be consulted in following Liferay article: JAX-WS-and-JAX-RS

 

Additional Information

 

 

 

Did this article resolve your issue ?

Legacy Knowledge Base