Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: SOAP client not working on Liferay 7.4 and Java 11
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.
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,
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
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
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.
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
Powered by Liferay™