{"id":4412,"date":"2019-09-05T00:02:52","date_gmt":"2019-09-04T22:02:52","guid":{"rendered":"https:\/\/www.dontesta.it\/?p=4412"},"modified":"2021-10-05T10:26:30","modified_gmt":"2021-10-05T08:26:30","slug":"how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure","status":"publish","type":"post","link":"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/","title":{"rendered":"How to implement a SOAP client using JAX-WS Liferay infrastructure"},"content":{"rendered":"<p><\/p>\n<div style=\"text-align: justify;\">At the 2016 Liferay Symposium (Italy) I presented the topic: <a href=\"https:\/\/www.slideshare.net\/amusarra\/jaxws-e-jaxrs\">How to develop SOAP and REST services in JAX-WS and JAX-RS<\/a> standard on Liferay. During the presentation I illustrated how to expose both <strong>REST<\/strong> (Representational State Transfer) and <strong>SOAP\u00a0<\/strong>(Simple Object Access Protocol) services for each application using the <a href=\"https:\/\/portal.liferay.dev\/docs\/7-0\/tutorials\/-\/knowledge_base\/t\/jax-ws-and-jax-rs\">Liferay Extender<\/a>.<\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\">In this article I want to show you how to build a SOAP <strong>JAX-WS<\/strong> (Java API for XML Web Services) client using the Liferay infrastructure. Let's start with a concrete example. The entire development project for this article is available on my GitHub <a href=\"https:\/\/github.com\/amusarra\/liferay-72-soap-client-examples\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>liferay-72-soap-client-examples repository<\/strong><\/a>.<\/div>\n<p>&nbsp;<\/p>\n<h2>1. Overview<\/h2>\n<div style=\"text-align: justify;\">Let's consider the SOAP Calculator service whose <a href=\"http:\/\/www.dneonline.com\/calculator.asmx\">WSDL<\/a> (Web Services Description Language) descriptor is available at the following address <a href=\"http:\/\/www.dneonline.com\/calculator.asmx\">http:\/\/www.dneonline.com\/calculator.asmx<\/a> which exposes the four arithmetic operations between two integers.<\/div>\n<p>&nbsp;<\/p>\n<div>\n<div style=\"text-align: justify;\">The goal is to make this service available to any application installed on our Liferay instance. We then structure our Liferay project in this way:<\/div>\n<p>&nbsp;<\/p>\n<ol>\n<li>\n<div>Implementation of the <strong>calculator-api<\/strong> module. This module defines the APIs that each application can invoke to use the services of arithmetic operations (addition, subtraction, division and multiplication);<\/div>\n<\/li>\n<li>\n<div>Implementation of the <strong>calculator-service<\/strong> module. This module implements the APIs defined by the calculator-api module and acts as a client to the SOAP Calculator service;<\/div>\n<\/li>\n<li>\n<div>Implementation of the <strong>calculator-gogo-shell <\/strong>module. This module implements the Gogo Shell commands that use the APIs defined by the calculator-api module to perform the arithmetic operations;<\/div>\n<\/li>\n<li>\n<div>Implementation of the <strong>calculator-web<\/strong> module. This module implements a standard MVC portlet that uses the APIs defined by the calculator-api module to perform the arithmetic operations.<\/div>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<div id=\"attachment_4414\" style=\"width: 699px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ModuleRelationshipDiagram.png\"><img aria-describedby=\"caption-attachment-4414\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-4414 size-full\" title=\"Figure 1 - Diagram of the relationships between the modules\" src=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ModuleRelationshipDiagram.png\" alt=\"Figure 1 - Diagram of the relationships between the modules\" width=\"689\" height=\"242\" srcset=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ModuleRelationshipDiagram.png 689w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ModuleRelationshipDiagram-300x105.png 300w\" sizes=\"auto, (max-width: 689px) 100vw, 689px\" \/><\/a><p id=\"caption-attachment-4414\" class=\"wp-caption-text\">Figure 1 - Diagram of the relationships between the modules<\/p><\/div>\n<\/div>\n<div><\/div>\n<div>The figure below shows the class diagram of the main classes of the various modules. In detail:<\/div>\n<p>&nbsp;<\/p>\n<ul>\n<li>\n<div><strong>calculator-api<\/strong><\/div>\n<ul>\n<li>\n<div><b><\/b><em>Calculator<\/em> is the interface that defines the arithmetic operations between two integers;<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<div><strong>calculator-service<\/strong><\/div>\n<ul>\n<li>\n<div><em>CalculatorClientImpl<\/em> implements the APIs defined by the Calculator interface and acts as a client to the SOAP Calculator service;<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<div><strong>calculator-web<\/strong><\/div>\n<ul>\n<li>\n<div><em>AddOperationMVCActionCommand<\/em>:\u00a0MVC Action Command of the Calculator Web Module for the request of the addition operation;<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<div><strong>calculator-gogo-shell<\/strong><\/div>\n<ul>\n<li>\n<div><em>CalculatorCommand<\/em>: Gogo Shell Commands of the Calculator Gogo Shell Module.<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div id=\"attachment_4415\" style=\"width: 1034px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ClassDiagram_2.png\"><img aria-describedby=\"caption-attachment-4415\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-4415\" src=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ClassDiagram_2-1024x366.png\" alt=\"Figure 2 - Class diagram\" width=\"1024\" height=\"366\" srcset=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ClassDiagram_2-1024x366.png 1024w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ClassDiagram_2-300x107.png 300w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ClassDiagram_2-768x274.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><p id=\"caption-attachment-4415\" class=\"wp-caption-text\">Figure 2 - Class diagram<\/p><\/div>\n<p>&nbsp;<\/p>\n<h2>1 -\u00a0Implementation of the SOAP client<\/h2>\n<div style=\"text-align: justify;\">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.<\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\">To create all the java code we need, starting from the WSDL document, we usually use the <a href=\"https:\/\/docs.oracle.com\/javase\/8\/docs\/technotes\/tools\/unix\/wsimport.html\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>wsimport<\/strong><\/a> tool.\u00a0Instead of using the command-line tool directly, we'll set up the project to use a Gradle task that does everything for us.<\/div>\n<div><\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\">The one shown below is the build.gradle file of the calculator-service module. The parts highlighted make it possible to use the Gradle <b>gradle-jaxws-plugin<\/b> plugin.<\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\">The second block highlighted, sets the directory of <em>WSDL documents<\/em> and the directory that will contain the java files generated from the WSDL document.\u00a0The WSDL document can be downloaded from the address <a href=\"http:\/\/www.dneonline.com\/calculator.asmx?WSDL\">http:\/\/www.dneonline.com\/calculator.asmx?WSDL<\/a> and saved in the directory indicated.<\/div>\n<div><\/div>\n<div>\n<pre class=\"theme:solarized-dark toolbar:1 lang:default mark:1-12,22-25 decode:true \" title=\"Source code 1 - build.gradle of the calculator-service module\">buildscript {\r\n   repositories {\r\n      maven {\r\n         url \"https:\/\/plugins.gradle.org\/m2\/\"\r\n      }\r\n   }\r\n   dependencies {\r\n      classpath \"gradle.plugin.cz.swsamuraj:gradle-jaxws-plugin:0.6.1\"\r\n   }\r\n}\r\n\r\napply plugin: \"cz.swsamuraj.jaxws\"\r\n\r\n\r\ndependencies {\r\n   compileOnly group: \"com.liferay.portal\", name: \"com.liferay.portal.kernel\", version: \"4.4.0\"\r\n   compileOnly group: \"org.osgi\", name: \"org.osgi.service.component.annotations\", version: \"1.3.0\"\r\n   compileOnly project(\":modules:calculator:calculator-api\")\r\n}\r\n\r\n\r\njaxws {\r\n   wsdlDir = 'src\/main\/resources\/META-INF\/wsdl'\r\n   generatedSources = 'generatedsources\/src\/main\/java'\r\n}<\/pre>\n<div><\/div>\n<div style=\"text-align: justify;\">After editing the build.gradle file you should (and after a refresh gradle project) the new Gradle tasks and in particular: <strong>wsImport<\/strong><\/div>\n<\/div>\n<div><\/div>\n<div>\n<div id=\"attachment_4417\" style=\"width: 940px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebServiceGradleTask.png\"><img aria-describedby=\"caption-attachment-4417\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-4417 size-full\" title=\"Figure 3 - New Gradle tasks added after configuring the gradle-jaxws-plugin plugin\" src=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebServiceGradleTask.png\" alt=\"Figure 3 - New Gradle tasks added after configuring the gradle-jaxws-plugin plugin\" width=\"930\" height=\"914\" srcset=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebServiceGradleTask.png 930w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebServiceGradleTask-300x295.png 300w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebServiceGradleTask-768x755.png 768w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebServiceGradleTask-65x65.png 65w\" sizes=\"auto, (max-width: 930px) 100vw, 930px\" \/><\/a><p id=\"caption-attachment-4417\" class=\"wp-caption-text\">Figure 3 - New Gradle tasks added after configuring the gradle-jaxws-plugin plugin<\/p><\/div>\n<\/div>\n<div><\/div>\n<div style=\"text-align: justify;\">At this point all that remains is to run the <em>wsImport<\/em> task 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.<\/div>\n<div><\/div>\n<div>\n<div id=\"attachment_4418\" style=\"width: 742px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GenerateStubJavaClass.png\"><img aria-describedby=\"caption-attachment-4418\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-4418 size-full\" title=\"Figure 4 - Java classes generated by the Gradle wsImport task starting from the WSDL of the SOAP Calculator service.\" src=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GenerateStubJavaClass.png\" alt=\"Figure 4 - Java classes generated by the Gradle wsImport task starting from the WSDL of the SOAP Calculator service.\" width=\"732\" height=\"952\" srcset=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GenerateStubJavaClass.png 732w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GenerateStubJavaClass-300x390.png 300w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><\/a><p id=\"caption-attachment-4418\" class=\"wp-caption-text\">Figure 4 - Java classes generated by the Gradle wsImport task starting from the WSDL of the SOAP Calculator service.<\/p><\/div>\n<div><\/div>\n<div style=\"text-align: justify;\">The code shown below is the implementation of the <strong>CalculatorClientImpl<\/strong> class that implements the Calculator interface and uses the stub classes to get the interface to SOAP services.<\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\">The <strong>_getService()<\/strong> method gets the reference to the <strong>CalculatorSOAP<\/strong> interface, the latter is used within all the methods that implement arithmetic operations.<\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\">Note that CalculatorClientImpl is a <a href=\"https:\/\/osgi.org\/specification\/osgi.cmpn\/7.0.0\/service.component.html\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>DS component<\/strong><\/a>, this will allow us to use the services of the Calculator interface with the simple <strong>@Reference<\/strong> annotation.<\/div>\n<\/div>\n<div><\/div>\n<div>\n<pre class=\"theme:solarized-dark toolbar:1 lang:java mark:15,59-67 decode:true \" title=\"Source code 2 - Implementation of the CalculatorClientImpl class\">package it.dontesta.labs.liferay.webservice.calculator.client.soap;\r\n...\r\n\r\n\/**\r\n* @author Antonio Musarra\r\n*\/\r\n@Component(immediate = true, property = {}, service = Calculator.class)\r\npublic class CalculatorClientImpl implements Calculator {\r\n\r\n\r\n   @Override\r\n   public int add(int number1, int number2)\r\n      throws CalculatorOperationException {\r\n      try {\r\n         return _getService().add(number1, number2);\r\n      }\r\n      catch (CalculatorServiceException cse) {\r\n         throw new CalculatorOperationException(cse.getMessage(), cse);\r\n      }\r\n   }\r\n\r\n\r\n   @Override\r\n   public int divide(int number1, int number2)\r\n      throws CalculatorOperationException {\r\n      try {\r\n         return _getService().divide(number1, number2);\r\n      }\r\n      catch (CalculatorServiceException cse) {\r\n         throw new CalculatorOperationException(cse.getMessage(), cse);\r\n      }\r\n   }\r\n\r\n\r\n   @Override\r\n   public int multiply(int number1, int number2)\r\n      throws CalculatorOperationException {\r\n      try {\r\n         return _getService().multiply(number1, number2);\r\n      }\r\n      catch (CalculatorServiceException cse) {\r\n         throw new CalculatorOperationException(cse.getMessage(), cse);\r\n      }\r\n   }\r\n\r\n\r\n   @Override\r\n   public int subtract(int number1, int number2)\r\n      throws CalculatorOperationException {\r\n      try {\r\n         return _getService().subtract(number1, number2);\r\n      }\r\n      catch (CalculatorServiceException cse) {\r\n         throw new CalculatorOperationException(cse.getMessage(), cse);\r\n      }\r\n   }\r\n   private CalculatorSoap _getService() throws CalculatorServiceException {\r\n      if (Validator.isNull(_calculatorSoap)) {\r\n         try {\r\n            org.tempuri.Calculator calculator =\r\n               new org.tempuri.Calculator();\r\n            _calculatorSoap = calculator.getCalculatorSoap();\r\n         }\r\n         catch (WebServiceException wse) {\r\n            throw new CalculatorServiceException(wse.getMessage(), wse);\r\n         }\r\n         return _calculatorSoap;\r\n      }\r\n      else {\r\n         return _calculatorSoap;\r\n      }\r\n   }\r\n\r\n   private CalculatorSoap _calculatorSoap;\r\n}<\/pre>\n<p style=\"text-align: justify;\">From this moment we can use the Calculator service on any module. Who uses the service is absolutely abstract from the fact that the implementation uses external SOAP services.<\/p>\n<h2>2 -\u00a0Implementation of Gogo Shell commands<\/h2>\n<div style=\"text-align: justify;\">Now let's see how to use the service to create a series of Gogo Shell commands that allow us to perform arithmetic operations.<\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\">The following code shows the class CalculatorCommand which uses the Calculator service referenced by the @Reference annotation and implement the arithmetic operations we defined in the Calculator interface.<\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\">I have reported only the most significant parts of the code that are highlighted.<\/div>\n<\/div>\n<div><\/div>\n<div>\n<pre class=\"theme:solarized-dark toolbar:1 lang:java mark:12-16,23,27-28 decode:true \" title=\"Source code 3 - Implementation of Gogo Shell commands for arithmetic operations\">package it.dontesta.labs.liferay.webservice.calculator.gogoshell;\r\n\r\nimport it.dontesta.labs.liferay.webservice.calculator.api.Calculator;\r\n\r\n...\r\n\r\n\/**\r\n* @author Antonio Musarra\r\n*\/\r\n@Component(\r\n   property = {\r\n      \"osgi.command.function=add\",\r\n      \"osgi.command.function=divide\",\r\n      \"osgi.command.function=multiply\",\r\n      \"osgi.command.function=subtract\",\r\n      \"osgi.command.scope=calculator\"\r\n   },\r\n   service = Object.class\r\n)\r\npublic class CalculatorCommand implements Calculator {\r\n   public int add(int number1, int number2)\r\n      throws CalculatorOperationException {\r\n      return getCalculatorService().add(number1, number2);\r\n   }\r\n\r\n   ...\r\n\r\n   @Reference(policyOption = ReferencePolicyOption.GREEDY)\r\n   private volatile Calculator _calculator;\r\n}<\/pre>\n<p style=\"text-align: justify;\">Once the module has been deployed, we have the commands to make the arithmetic operations available. Just connect to the Gogo Shell and try.<\/p>\n<div id=\"attachment_4419\" style=\"width: 1034px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellCalculatorCommands_1.png\"><img aria-describedby=\"caption-attachment-4419\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-4419\" src=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellCalculatorCommands_1-1024x84.png\" alt=\"Figure 5 - Division by zero!\" width=\"1024\" height=\"84\" srcset=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellCalculatorCommands_1-1024x84.png 1024w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellCalculatorCommands_1-300x25.png 300w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellCalculatorCommands_1-768x63.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><p id=\"caption-attachment-4419\" class=\"wp-caption-text\">Figure 5 - Division by zero!<\/p><\/div>\n<p>&nbsp;<\/p>\n<div id=\"attachment_4420\" style=\"width: 1034px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellCalculatorCommands_2.png\"><img aria-describedby=\"caption-attachment-4420\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-4420\" src=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellCalculatorCommands_2-1024x62.png\" alt=\"Figure 6 - Error in case of connectivity problems\" width=\"1024\" height=\"62\" srcset=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellCalculatorCommands_2-1024x62.png 1024w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellCalculatorCommands_2-300x18.png 300w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellCalculatorCommands_2-768x47.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><p id=\"caption-attachment-4420\" class=\"wp-caption-text\">Figure 6 - Error in case of connectivity problems<\/p><\/div>\n<h2><\/h2>\n<h2>3 -\u00a0Implementation of Calculator Web<\/h2>\n<div style=\"text-align: justify;\">We have seen how to use the Calculator service for Gogo Shell commands, why not implement a simple very basic web calculator?<\/div>\n<p>&nbsp;<\/p>\n<div>In the class diagram of figure 2 we have seen that there are four MVC Command, one for each operation.<\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\">Following is the MVC Command code responsible for performing the addition operation and making the result available to the view.<\/div>\n<\/div>\n<div><\/div>\n<div>\n<pre class=\"theme:solarized-dark toolbar:1 lang:java decode:true \" title=\"Source code 4 - Implementation of the MVC Command for the addition operation.\">package it.dontesta.labs.liferay.web.calculator.portlet.action;\r\n\r\nimport it.dontesta.labs.liferay.webservice.calculator.api.Calculator;\r\n\r\n...\r\n\r\n\/**\r\n* @author Antonio Musarra\r\n*\/\r\n@Component(\r\n   immediate = true,\r\n   property = {\r\n      \"javax.portlet.name=\" + CalculatorAppPortletKeys.CALCULATOR_SOAP_APP,\r\n      \"mvc.command.name=\/calculator\/add-operation\"\r\n   },\r\n   service = MVCActionCommand.class\r\n)\r\npublic class AddOperationMVCActionCommand extends BaseMVCActionCommand {\r\n\r\n\r\n   @Override\r\n   protected void doProcessAction(\r\n         ActionRequest actionRequest, ActionResponse actionResponse)\r\n      throws Exception {\r\n\r\n\r\n      _handleActionCommand(actionRequest);\r\n   }\r\n\r\n\r\n   private void _handleActionCommand(ActionRequest actionRequest) {\r\n      try {\r\n         int term1 = ParamUtil.getInteger(\r\n            actionRequest, CalculatorAppWebKeys.ADD_OPERATION_TERM_1);\r\n\r\n\r\n         int term2 = ParamUtil.getInteger(\r\n            actionRequest, CalculatorAppWebKeys.ADD_OPERATION_TERM_2);\r\n\r\n\r\n         int result = _calculator.add(term1, term2);\r\n\r\n\r\n         actionRequest.setAttribute(\r\n            CalculatorAppWebKeys.ADD_OPERATION_RESULT, result);\r\n      }\r\n      catch (SOAPFaultException soapfe) {\r\n         SessionErrors.add(actionRequest, soapfe.getClass(), soapfe);\r\n      }\r\n      catch (WebServiceException wse) {\r\n         SessionErrors.add(actionRequest, wse.getClass(), wse);\r\n      }\r\n      catch (Exception e) {\r\n         SessionErrors.add(\r\n            actionRequest, \"calculatorOperationError\", e.getMessage());\r\n      }\r\n   }\r\n\r\n   @Reference(policyOption = ReferencePolicyOption.GREEDY)\r\n   private Calculator _calculator;\r\n}<\/pre>\n<\/div>\n<p>The following figures show the simple calculator in action.<\/p>\n<div id=\"attachment_4421\" style=\"width: 1034px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebCalculatorSOAPInAction_1.png\"><img aria-describedby=\"caption-attachment-4421\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-4421 size-large\" title=\"Figure 8 - Still division by zero! Example of the GUI in case of error obtained from the execution of the operation\" src=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebCalculatorSOAPInAction_1-1024x481.png\" alt=\"Figure 7 - Example of the GUI for the division operation\" width=\"1024\" height=\"481\" srcset=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebCalculatorSOAPInAction_1-1024x481.png 1024w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebCalculatorSOAPInAction_1-300x141.png 300w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebCalculatorSOAPInAction_1-768x361.png 768w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebCalculatorSOAPInAction_1-520x245.png 520w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebCalculatorSOAPInAction_1.png 1928w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><p id=\"caption-attachment-4421\" class=\"wp-caption-text\">Figure 7 - Example of the GUI for the division operation<\/p><\/div>\n<div id=\"attachment_4422\" style=\"width: 1034px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebCalculatorSOAPInAction_2.png\"><img aria-describedby=\"caption-attachment-4422\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-4422 size-large\" title=\"Figure 8 - Still division by zero! Example of the GUI in case of error obtained from the execution of the operation\" src=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebCalculatorSOAPInAction_2-1024x657.png\" alt=\"Figure 8 - Still division by zero! Example of the GUI in case of error obtained from the execution of the operation\" width=\"1024\" height=\"657\" srcset=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebCalculatorSOAPInAction_2-1024x657.png 1024w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebCalculatorSOAPInAction_2-300x192.png 300w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebCalculatorSOAPInAction_2-768x493.png 768w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/WebCalculatorSOAPInAction_2.png 1964w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><p id=\"caption-attachment-4422\" class=\"wp-caption-text\">Figure 8 - Still division by zero! Example of the GUI in case of error obtained from the execution of the operation<\/p><\/div>\n<h2>4 - Configuration of the JAX-WS API and CXF EndPoints<\/h2>\n<div style=\"text-align: justify;\">Everything we have seen so far could not work until these two components are configured on the Liferay system:<\/div>\n<div><\/div>\n<ul>\n<li style=\"text-align: justify;\">CXF EndPoints<\/li>\n<li style=\"text-align: justify;\">JAX-WS API<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\">This configuration should only be necessary if we decide to develop and publish SOAP services on our Liferay instance.<\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\"><span style=\"text-decoration: underline;\">Even if we act as a SOAP client we must configure these two components so that the <strong>JAX-WS provider is correctly configured<\/strong> and we can use the JAX-WS API without incurring any error<\/span>.<\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\">The one shown in the figure is the error we would see if we did not configure the two components from the Liferay control panel.<\/div>\n<div><\/div>\n<div>\n<div id=\"attachment_4426\" style=\"width: 1034px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellErrorJAX-WS.png\"><img aria-describedby=\"caption-attachment-4426\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-4426 size-large\" title=\"Figure 9 - Error shown when the JAX-WS API bridge has not been configured.\" src=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellErrorJAX-WS-1024x199.png\" alt=\"Figure 9 - Error shown when the JAX-WS API bridge has not been configured.\" width=\"1024\" height=\"199\" srcset=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellErrorJAX-WS-1024x199.png 1024w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellErrorJAX-WS-300x58.png 300w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellErrorJAX-WS-768x149.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><p id=\"caption-attachment-4426\" class=\"wp-caption-text\">Figure 9 - Error shown when the JAX-WS API bridge has not been configured.<\/p><\/div>\n<\/div>\n<div><\/div>\n<div>The following figures show the configurations for CXF and JAX-WS and in particular the <strong>Context Path<\/strong> (for more info you can see this <a href=\"https:\/\/portal.liferay.dev\/docs\/7-0\/tutorials\/-\/knowledge_base\/t\/jax-ws-and-jax-rs\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/portal.liferay.dev\/docs\/7-0\/tutorials\/-\/knowledge_base\/t\/jax-ws-and-jax-rs<\/a>).<\/div>\n<div><\/div>\n<div>\n<div id=\"attachment_4423\" style=\"width: 1034px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ConfiguringCXFEndPoints.png\"><img aria-describedby=\"caption-attachment-4423\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-4423 size-large\" title=\"Figure 10 - CXF Endpoint configuration\" src=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ConfiguringCXFEndPoints-1024x283.png\" alt=\"Figure 10 - CXF Endpoint configuration\" width=\"1024\" height=\"283\" srcset=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ConfiguringCXFEndPoints-1024x283.png 1024w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ConfiguringCXFEndPoints-300x83.png 300w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ConfiguringCXFEndPoints-768x212.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><p id=\"caption-attachment-4423\" class=\"wp-caption-text\">Figure 10 - CXF Endpoint configuration<\/p><\/div>\n<p>&nbsp;<\/p>\n<div id=\"attachment_4424\" style=\"width: 1034px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ConfiguringJAX-WS-API.png\"><img aria-describedby=\"caption-attachment-4424\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-4424 size-large\" title=\"Figure 11 - JAX-WS API configuration\" src=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ConfiguringJAX-WS-API-1024x442.png\" alt=\"Figure 11 - JAX-WS API configuration\" width=\"1024\" height=\"442\" srcset=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ConfiguringJAX-WS-API-1024x442.png 1024w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ConfiguringJAX-WS-API-300x129.png 300w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/ConfiguringJAX-WS-API-768x331.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><p id=\"caption-attachment-4424\" class=\"wp-caption-text\">Figure 11 - JAX-WS API configuration<\/p><\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">If we want to be picky, we could run the <em>services \"(objectClass=javax.xml.ws.spi.Provider)\"<\/em> command from Gogo Shell to verify the <strong>JAX-WS API bridge<\/strong> has been properly configured. You should get it in output when shown in the figure below.<\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_4425\" style=\"width: 1034px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellCheckJAX-WS-APIBridgeConfiguration.png\"><img aria-describedby=\"caption-attachment-4425\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-4425\" src=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellCheckJAX-WS-APIBridgeConfiguration-1024x191.png\" alt=\"Figure 12 - Output of the command services &quot;(objectClass=javax.xml.ws.spi.Provider)\u201d\" width=\"1024\" height=\"191\" srcset=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellCheckJAX-WS-APIBridgeConfiguration-1024x191.png 1024w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellCheckJAX-WS-APIBridgeConfiguration-300x56.png 300w, https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/GogoShellCheckJAX-WS-APIBridgeConfiguration-768x144.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><p id=\"caption-attachment-4425\" class=\"wp-caption-text\">Figure 12 - Output of the command services \"(objectClass=javax.xml.ws.spi.Provider)\u201d<\/p><\/div>\n<div><\/div>\n<div style=\"text-align: justify;\">For more information on this aspect I recommend reading this <a href=\"https:\/\/issues.liferay.com\/browse\/LPS-67253\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>LPS - Supplied JAX-WS implementation not working<\/strong><\/a>.<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<h2>5 - Conclusions<\/h2>\n<div style=\"text-align: justify;\">In this article we saw how simple it is to implement a standard JAX-WS SOAP client using the JAX-WS infrastructure that Liferay makes available to us and whose implementation is achieved through the <a href=\"https:\/\/cxf.apache.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">Apache CXF framework<\/a>.\u00a0Liferay 7.2 CE GA1 uses version 3.2 of Apache CXF.<\/div>\n<p>&nbsp;<\/p>\n<div>In one of the next articles we will see more complex scenarios, where for example:<\/div>\n<p>&nbsp;<\/p>\n<ul>\n<li>\n<div>The SOAP service we want to use requires an SSL\/TLS Mutual authentication<\/div>\n<\/li>\n<li>\n<div>The SOAP service we want to access requires WS-Security<\/div>\n<\/li>\n<\/ul>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>At the 2016 Liferay Symposium (Italy) I presented the topic: How to develop SOAP and REST services in JAX-WS and JAX-RS standard on Liferay. During the presentation I illustrated how to expose both REST&#46;&#46;&#46;<\/p>\n","protected":false},"author":3,"featured_media":4439,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[490,15,39],"tags":[112,637,349,649],"class_list":["post-4412","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-2","category-liferay","category-web-services","tag-client-java-soap","tag-liferay","tag-soap","tag-web-services"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to implement a SOAP client using JAX-WS Liferay infrastructure<\/title>\n<meta name=\"description\" content=\"In this article I want to show you how to build a SOAP JAX-WS client using the Liferay infrastructure. Let&#039;s start with a concrete example. The entire development project for this article is available on my GitHub liferay-72-soap-client-examples repository.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to implement a SOAP client using JAX-WS Liferay infrastructure\" \/>\n<meta property=\"og:description\" content=\"In this article I want to show you how to build a SOAP JAX-WS client using the Liferay infrastructure. Let&#039;s start with a concrete example. The entire development project for this article is available on my GitHub liferay-72-soap-client-examples repository.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/\" \/>\n<meta property=\"og:site_name\" content=\"Antonio Musarra&#039;s Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/antoniomusarrablog\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/antoniomusarrablog\" \/>\n<meta property=\"article:published_time\" content=\"2019-09-04T22:02:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-05T08:26:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/HowToImplementSOAPClientUsingJAX-WSLiferayInfrastructure_FeatureImage.png\" \/>\n\t<meta property=\"og:image:width\" content=\"722\" \/>\n\t<meta property=\"og:image:height\" content=\"342\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Antonio Musarra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@antonio_musarra\" \/>\n<meta name=\"twitter:site\" content=\"@antonio_musarra\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Antonio Musarra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/\"},\"author\":{\"name\":\"Antonio Musarra\",\"@id\":\"https:\/\/www.dontesta.it\/#\/schema\/person\/0c69ed36230e1477875d6171b48b9b24\"},\"headline\":\"How to implement a SOAP client using JAX-WS Liferay infrastructure\",\"datePublished\":\"2019-09-04T22:02:52+00:00\",\"dateModified\":\"2021-10-05T08:26:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/\"},\"wordCount\":1357,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.dontesta.it\/#\/schema\/person\/0c69ed36230e1477875d6171b48b9b24\"},\"image\":{\"@id\":\"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/HowToImplementSOAPClientUsingJAX-WSLiferayInfrastructure_FeatureImage.png\",\"keywords\":[\"Client Java SOAP\",\"Liferay\",\"SOAP\",\"Web Services\"],\"articleSection\":[\"Blog\",\"Liferay\",\"Web Services\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/\",\"url\":\"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/\",\"name\":\"How to implement a SOAP client using JAX-WS Liferay infrastructure\",\"isPartOf\":{\"@id\":\"https:\/\/www.dontesta.it\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/HowToImplementSOAPClientUsingJAX-WSLiferayInfrastructure_FeatureImage.png\",\"datePublished\":\"2019-09-04T22:02:52+00:00\",\"dateModified\":\"2021-10-05T08:26:30+00:00\",\"description\":\"In this article I want to show you how to build a SOAP JAX-WS client using the Liferay infrastructure. Let's start with a concrete example. The entire development project for this article is available on my GitHub liferay-72-soap-client-examples repository.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/#primaryimage\",\"url\":\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/HowToImplementSOAPClientUsingJAX-WSLiferayInfrastructure_FeatureImage.png\",\"contentUrl\":\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/HowToImplementSOAPClientUsingJAX-WSLiferayInfrastructure_FeatureImage.png\",\"width\":722,\"height\":342,\"caption\":\"How to implement a SOAP client using JAX-WS Liferay infrastructure\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.dontesta.it\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to implement a SOAP client using JAX-WS Liferay infrastructure\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dontesta.it\/#website\",\"url\":\"https:\/\/www.dontesta.it\/\",\"name\":\"Antonio Musarra&#039;s Blog\",\"description\":\"The ideal solution for a problem\",\"publisher\":{\"@id\":\"https:\/\/www.dontesta.it\/#\/schema\/person\/0c69ed36230e1477875d6171b48b9b24\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dontesta.it\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.dontesta.it\/#\/schema\/person\/0c69ed36230e1477875d6171b48b9b24\",\"name\":\"Antonio Musarra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dontesta.it\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2024\/06\/cropped-foto_profilo.png\",\"contentUrl\":\"https:\/\/www.dontesta.it\/wp-content\/uploads\/2024\/06\/cropped-foto_profilo.png\",\"width\":512,\"height\":512,\"caption\":\"Antonio Musarra\"},\"logo\":{\"@id\":\"https:\/\/www.dontesta.it\/#\/schema\/person\/image\/\"},\"description\":\"I began my journey into the world of computing from an Olivetti M24 PC (http:\/\/it.wikipedia.org\/wiki\/Olivetti_M24) bought by my father for his work. Day after day, quickly taking control until \u2026 Now doing business consulting for projects in the enterprise application development using web-oriented technologies such as J2EE, Web Services, ESB, TIBCO, PHP.\",\"sameAs\":[\"https:\/\/www.dontesta.it\",\"https:\/\/www.facebook.com\/antoniomusarrablog\",\"https:\/\/www.linkedin.com\/in\/amusarra\/\",\"https:\/\/x.com\/antonio_musarra\",\"https:\/\/www.youtube.com\/channel\/UC5D3_EtVPbZYUhrUcEK_THA\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to implement a SOAP client using JAX-WS Liferay infrastructure","description":"In this article I want to show you how to build a SOAP JAX-WS client using the Liferay infrastructure. Let's start with a concrete example. The entire development project for this article is available on my GitHub liferay-72-soap-client-examples repository.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/","og_locale":"en_US","og_type":"article","og_title":"How to implement a SOAP client using JAX-WS Liferay infrastructure","og_description":"In this article I want to show you how to build a SOAP JAX-WS client using the Liferay infrastructure. Let's start with a concrete example. The entire development project for this article is available on my GitHub liferay-72-soap-client-examples repository.","og_url":"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/","og_site_name":"Antonio Musarra&#039;s Blog","article_publisher":"https:\/\/www.facebook.com\/antoniomusarrablog","article_author":"https:\/\/www.facebook.com\/antoniomusarrablog","article_published_time":"2019-09-04T22:02:52+00:00","article_modified_time":"2021-10-05T08:26:30+00:00","og_image":[{"width":722,"height":342,"url":"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/HowToImplementSOAPClientUsingJAX-WSLiferayInfrastructure_FeatureImage.png","type":"image\/png"}],"author":"Antonio Musarra","twitter_card":"summary_large_image","twitter_creator":"@antonio_musarra","twitter_site":"@antonio_musarra","twitter_misc":{"Written by":"Antonio Musarra","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/#article","isPartOf":{"@id":"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/"},"author":{"name":"Antonio Musarra","@id":"https:\/\/www.dontesta.it\/#\/schema\/person\/0c69ed36230e1477875d6171b48b9b24"},"headline":"How to implement a SOAP client using JAX-WS Liferay infrastructure","datePublished":"2019-09-04T22:02:52+00:00","dateModified":"2021-10-05T08:26:30+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/"},"wordCount":1357,"commentCount":0,"publisher":{"@id":"https:\/\/www.dontesta.it\/#\/schema\/person\/0c69ed36230e1477875d6171b48b9b24"},"image":{"@id":"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/HowToImplementSOAPClientUsingJAX-WSLiferayInfrastructure_FeatureImage.png","keywords":["Client Java SOAP","Liferay","SOAP","Web Services"],"articleSection":["Blog","Liferay","Web Services"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/","url":"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/","name":"How to implement a SOAP client using JAX-WS Liferay infrastructure","isPartOf":{"@id":"https:\/\/www.dontesta.it\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/#primaryimage"},"image":{"@id":"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/HowToImplementSOAPClientUsingJAX-WSLiferayInfrastructure_FeatureImage.png","datePublished":"2019-09-04T22:02:52+00:00","dateModified":"2021-10-05T08:26:30+00:00","description":"In this article I want to show you how to build a SOAP JAX-WS client using the Liferay infrastructure. Let's start with a concrete example. The entire development project for this article is available on my GitHub liferay-72-soap-client-examples repository.","breadcrumb":{"@id":"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/#primaryimage","url":"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/HowToImplementSOAPClientUsingJAX-WSLiferayInfrastructure_FeatureImage.png","contentUrl":"https:\/\/www.dontesta.it\/wp-content\/uploads\/2019\/09\/HowToImplementSOAPClientUsingJAX-WSLiferayInfrastructure_FeatureImage.png","width":722,"height":342,"caption":"How to implement a SOAP client using JAX-WS Liferay infrastructure"},{"@type":"BreadcrumbList","@id":"https:\/\/www.dontesta.it\/en\/2019\/09\/05\/how-to-implement-a-soap-client-using-jax-ws-liferay-infrastructure\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dontesta.it\/"},{"@type":"ListItem","position":2,"name":"How to implement a SOAP client using JAX-WS Liferay infrastructure"}]},{"@type":"WebSite","@id":"https:\/\/www.dontesta.it\/#website","url":"https:\/\/www.dontesta.it\/","name":"Antonio Musarra&#039;s Blog","description":"The ideal solution for a problem","publisher":{"@id":"https:\/\/www.dontesta.it\/#\/schema\/person\/0c69ed36230e1477875d6171b48b9b24"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dontesta.it\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.dontesta.it\/#\/schema\/person\/0c69ed36230e1477875d6171b48b9b24","name":"Antonio Musarra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dontesta.it\/#\/schema\/person\/image\/","url":"https:\/\/www.dontesta.it\/wp-content\/uploads\/2024\/06\/cropped-foto_profilo.png","contentUrl":"https:\/\/www.dontesta.it\/wp-content\/uploads\/2024\/06\/cropped-foto_profilo.png","width":512,"height":512,"caption":"Antonio Musarra"},"logo":{"@id":"https:\/\/www.dontesta.it\/#\/schema\/person\/image\/"},"description":"I began my journey into the world of computing from an Olivetti M24 PC (http:\/\/it.wikipedia.org\/wiki\/Olivetti_M24) bought by my father for his work. Day after day, quickly taking control until \u2026 Now doing business consulting for projects in the enterprise application development using web-oriented technologies such as J2EE, Web Services, ESB, TIBCO, PHP.","sameAs":["https:\/\/www.dontesta.it","https:\/\/www.facebook.com\/antoniomusarrablog","https:\/\/www.linkedin.com\/in\/amusarra\/","https:\/\/x.com\/antonio_musarra","https:\/\/www.youtube.com\/channel\/UC5D3_EtVPbZYUhrUcEK_THA\/"]}]}},"_links":{"self":[{"href":"https:\/\/www.dontesta.it\/en\/wp-json\/wp\/v2\/posts\/4412","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dontesta.it\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dontesta.it\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dontesta.it\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dontesta.it\/en\/wp-json\/wp\/v2\/comments?post=4412"}],"version-history":[{"count":0,"href":"https:\/\/www.dontesta.it\/en\/wp-json\/wp\/v2\/posts\/4412\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dontesta.it\/en\/wp-json\/wp\/v2\/media\/4439"}],"wp:attachment":[{"href":"https:\/\/www.dontesta.it\/en\/wp-json\/wp\/v2\/media?parent=4412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dontesta.it\/en\/wp-json\/wp\/v2\/categories?post=4412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dontesta.it\/en\/wp-json\/wp\/v2\/tags?post=4412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}