RE: SOAP client not working on Liferay 7.4 and Java 11

Jamie Sammons, modified 2 Years ago. New Member Posts: 3 Join Date: 11/28/19 Recent Posts

Hi,

I'm upgrading the code of a SOAP client to Liferay 7.4 running on Java 11.I've been reading through loads of posts related to previous versions of Liferay, however, I haven't been able to make this work yet.

The closest I've got so far is by using org.apache.cxf.jaxws.spi.ProviderImpl instead of the previously available com.sun.xml.internal.ws.spi.ProviderImpl. However, the issue I'm facing now when I try to call the remote service is the following: 

javax.xml.ws.WebServiceException: Could not find wsdl:binding operation info for web method getWSCTaxGetAccountDetails

I've got to this point be following this interesting thread https://liferay.dev/ask/questions/development/re-re-make-soap-client-ootb-in-liferay-7-3-and-java-11-1 and the code provided by Fabian Bouché, but it's not working for me on 7.4.

I've got a ServiceFactory which tries to instantiate the provider before actually retrieving the service client class:

import javax.xml.ws.spi.Provider;
import org.apache.cxf.jaxws.spi.ProviderImpl;

	@Activate
	@Modified
	public void activate(BundleContext bundleContext, Map<String, Object> properties) throws Exception {

		ProviderImpl providerImpl = new ProviderImpl();

		Dictionary<String, Object> providerProperties = new Hashtable<>();

		bundleContext.registerService(Provider.class, providerImpl, providerProperties);

	}

 

Does anybody have any ideas of what can be wrong?

Thanks.

thumbnail
Jamie Sammons, modified 2 Years ago. Liferay Master Posts: 764 Join Date: 1/5/10 Recent Posts

Hi Ruben,

Unfortunately, I'm not sure what the problem is exactly, however, SOAP is not supported from 7.4 version anymore: https://learn.liferay.com/dxp/latest/en/installation-and-upgrades/upgrading-liferay/reference/maintenance-mode-and-deprecations-in-7-3.html#features-deprecated-in-7-3.

You can re-anable with a property, however, you may be better to find an alternative solution for that.

Regards,

Jamie Sammons, modified 2 Years ago. New Member Posts: 3 Join Date: 11/28/19 Recent Posts

Hi Zsigmond, thanks for your answer and sorry for the late reply. As mentioned in the link shared below by Christoph Rabel, the issue is related to the ProviderImpl not being available in Java 11.

I've been trying a number of things suggested in different threads and posts, but I ended up dealing with a nightmare of conflicting dependencies.

The latest issue I'm facing is:

Caused by: javax.xml.soap.SOAPException: Unable to create message factory for SOAP: Unable to create SAAJ meta-factory: Provider com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl not found

I've tried to fix it as suggested here, but it didn't work: 
https://help.liferay.com/hc/en-us/articles/11725669898125-Unable-to-create-message-factory-for-SOAP
thumbnail
Jamie Sammons, modified 2 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts

I am not sure if it helps you, but we also had the "ProviderImpl is gone" problem in Liferay. I discussed it with one of the developers and opened a ticket for it, which describes how it could be solved in 7.2. I am not sure if this still works in 7.4 or if it even applies to your issue, but it is probably worthwile to try it:

https://issues.liferay.com/browse/LPS-98339

Jamie Sammons, modified 2 Years ago. New Member Posts: 3 Join Date: 11/28/19 Recent Posts

Hi Christoph, thanks for your answer. I've tried that but, unfortunately, it didn't solve the issue for me. 

I've made some progress looking at this example here: https://gist.github.com/fabian-bouche-liferay/bf7fdfb7c3d02052f642314b1ae7549b

however, the issue I'm facing now is this one: 

Caused by: javax.xml.soap.SOAPException: Unable to create message factory for SOAP: Unable to create SAAJ meta-factory: Provider com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl not found

 

I've tried by adding the saaj-impl dependency to my module, as stated here: https://help.liferay.com/hc/en-us/articles/11725669898125-Unable-to-create-message-factory-for-SOAP,

but it doesn't seem to make any difference. I think the SAAJ library is not even picked up by Apache CXF.

Denis Cucchietti, modified 1 Year ago. New Member Posts: 20 Join Date: 9/15/14 Recent Posts

Hi,

I have the same problem : 

Caused by: javax.xml.soap.SOAPException: Unable to create message factory for SOAP: Unable to create SAAJ meta-factory: Provider com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl not found

Did you find a solution ?

Thanks