webservice client example
Description
Environment
Attachments
- 05 Mar 2019, 05:05 AM
- 04 Mar 2019, 10:56 AM
- 03 Mar 2019, 09:52 PM
- 03 Mar 2019, 09:47 PM
- 03 Mar 2019, 04:44 PM
- 02 Mar 2019, 01:25 PM
Activity
Carlos Ruiz February 11, 2023 at 2:53 PM
Adding software heritage links for the disappeared Bitbucket projects:

Hiep Lq February 20, 2020 at 8:21 AM
update example to use cxf stack with security policy
https://github.com/hieplq/web.service.client.bnd
Carlos Ruiz March 6, 2019 at 3:41 PM
Thanks @Hiep Lq, test plugin working now.
Carlos Ruiz March 5, 2019 at 10:06 AM
Thanks @Hiep Lq
I applied the patch and that solved the issue with server.product and also demo.globalqss.com is running now fine the webservices.
But now the project https://bitbucket.org/idplugin/org.globalqss.idempiere.test.fe is failing with a different error:
java.lang.Error: javax.xml.soap.SOAPException: Unable to create SAAJ meta-factory: Provider com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl not found

Hiep Lq March 5, 2019 at 5:06 AM
hi @Carlos Ruiz please apply that
need to refresh target platform, you can delete .metadata folder for easy
i just change dependency of axis to news
Carlos Ruiz March 4, 2019 at 7:10 PMEdited
Hi @Hiep Lq, after the latest commits I'm having problems to run server.product from eclipse.
Firstly it takes a lot of CPU and time to start, and then after started is showing the following error:
2019-03-04 20:07:36.351 -----------------------------------------------
eclipse.buildId=unknown
java.version=11.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=es_ES
Framework arguments: -product org.adempiere.server.server_product
Command-line arguments: -product org.adempiere.server.server_product -data /home/carlos/hgIdempiere/local62/runtime-server.product -dev file:/home/carlos/hgIdempiere/local62/.metadata/.plugins/org.eclipse.pde.core/server.product/dev.properties -os linux -ws gtk -arch x86_64 -consoleLog -console
!ENTRY org.idempiere.webservices 4 0 2019-03-04 20:09:39.173
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.idempiere.webservices [303]
Bundle was not resolved because of a uses constraint violation.
org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource org.idempiere.webservices [osgi.identity; osgi.identity="org.idempiere.webservices"; type="osgi.bundle"; version:Version="6.2.0.qualifier"; singleton:="true"] because it is exposed to package 'javax.xml.soap' from resources javax.xml.soap [osgi.identity; osgi.identity="javax.xml.soap"; type="osgi.bundle"; version:Version="1.3.0.v201105210645"] and jakarta.xml.soap-api [osgi.identity; osgi.identity="jakarta.xml.soap-api"; type="osgi.bundle"; version:Version="1.4.1"] via two dependency chains.
Chain 1:
org.idempiere.webservices [osgi.identity; osgi.identity="org.idempiere.webservices"; type="osgi.bundle"; version:Version="6.2.0.qualifier"; singleton:="true"]
require: (&(osgi.wiring.bundle=javax.xml.soap)(bundle-version>=1.3.0))
|
provide: osgi.wiring.bundle: javax.xml.soap
javax.xml.soap [osgi.identity; osgi.identity="javax.xml.soap"; type="osgi.bundle"; version:Version="1.3.0.v201105210645"]
Chain 2:
org.idempiere.webservices [osgi.identity; osgi.identity="org.idempiere.webservices"; type="osgi.bundle"; version:Version="6.2.0.qualifier"; singleton:="true"]
require: (osgi.wiring.bundle=org.apache.servicemix.bundles.spring-web)
|
provide: osgi.wiring.bundle; bundle-version:Version="4.3.19.RELEASE_1"; osgi.wiring.bundle="org.apache.servicemix.bundles.spring-web"
org.apache.servicemix.bundles.spring-web [osgi.identity; osgi.identity="org.apache.servicemix.bundles.spring-web"; type="osgi.bundle"; version:Version="4.3.19.RELEASE_1"]
import: (osgi.wiring.package=javax.xml.soap)
|
export: osgi.wiring.package: javax.xml.soap
jakarta.xml.soap-api [osgi.identity; osgi.identity="jakarta.xml.soap-api"; type="osgi.bundle"; version:Version="1.4.1"]
at org.eclipse.osgi.container.Module.start(Module.java:451)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1783)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1762)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1725)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1656)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:233)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:343)
Same error is appearing on server demo.globalqss.com - when starting the webservices plugin.
Sorry, I thought I tested the webservices before committing the patches, but maybe my tests were very quick and didn't notice this before.

Hiep Lq March 4, 2019 at 10:57 AM
is fix for issue discover when test on clean environment. also fix launching issue report above

Hiep Lq March 3, 2019 at 9:56 PM
hi @Carlos Ruiz, please add commit
and
still have a warning when run from eclipse
can add jaxb-osgi to satisfied it, but it show miss other package "com.sun.source.tree"
look jaxb isn't complete, so better stop at this point and wait to see any issue to resolved
Carlos Ruiz March 3, 2019 at 1:08 PM
Thanks @Hiep Lq, I did some tests but still is not working, let me describe my test:
1 - integrate patch IDEMPIERE-3908.patch
2 - integrate patch IDEMPIERE-3909.patch
3 - mvn verify -U
4 - reload target platform in eclipse
5 - maven update project in whole eclipse
6 - refresh project - close eclipse
7 - on reopen eclipse - project build cleaning all - compiled without errors
until now everything fine
then I cloned the repository https://bitbucket.org/idplugin/org.globalqss.idempiere.test.fe and imported the project for testing
when I added that project to the launcher server.product then it complains about missing plugins.
I need to add manually:
com.sun.istack.commons-runtime
com.sun.xml.bind.jaxb-impl
com.sun.xml.ws.jaxws-rt
jakarta.xml.soap-api
After that I run the server.product launcher successfully, and did the following tests:
1 - run the idempiere webservices from SoapUI - to check that is not broken there with the change of libraries:
it worked fine
2 - log into iDempiere and run the process "Synchronize Doc Translation" (to test the client webservice).
Exception
14:02:55.317===========> SvrProcess.process: com/sun/org/apache/xml/internal/resolver/CatalogManager [96]
java.lang.ClassNotFoundException: com.sun.org.apache.xml.internal.resolver.CatalogManager cannot be found by com.sun.xml.ws.jaxws-rt_2.3.2
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:511)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at com.sun.xml.ws.util.xml.XmlUtil.createDefaultCatalogResolver(XmlUtil.java:296)
at com.sun.xml.ws.client.WSServiceDelegate.createCatalogResolver(WSServiceDelegate.java:348)
at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:334)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:292)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:201)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:182)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:178)
at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:89)
at javax.xml.ws.Service.<init>(Service.java:82)
at co.gov.dian.servicios.facturaelectronica.reportarfactura.FacturaElectronicaPortNameService.<init>(FacturaElectronicaPortNameService.java:43)
at org.globalqss.test.process.TestWSDANE.doIt(TestWSDANE.java:30)
at org.compiere.process.SvrProcess.process(SvrProcess.java:201)
at org.compiere.process.SvrProcess.startProcess(SvrProcess.java:147)
at org.adempiere.util.ProcessUtil.startJavaProcess(ProcessUtil.java:173)
at org.compiere.apps.AbstractProcessCtl.startProcess(AbstractProcessCtl.java:467)
at org.compiere.apps.AbstractProcessCtl.run(AbstractProcessCtl.java:235)
3 - also, something strange, there are not errors in the Problems tab in eclipse, but when I open the class FacturaElectronicaPortNameService the 4 import lines from javax.xml.ws are shown in red saying cannot be resolved.

Hiep Lq March 2, 2019 at 1:26 PM
the patch to build p2 repository for web client
how to make simple webservice client run inside idempiere?
1. clone simple client https://bitbucket.org/idplugin/org.globalqss.idempiere.test.fe
2. clone feature manage bundle use for client webservice https://bitbucket.org/idplugin/org.idempiere.webservices.client-feature
3. import both into idempiere source
(org.idempiere.webservices.client-feature reference to parent pom by relative path do bellow step to remove that dependency)
go to [idempiere-source]/org.idempiere.parent
run mvn install
4. open org.idempiere.p2.targetplatform/org.idempiere.p2.targetplatform.target
add more repository: https://raw.githubusercontent.com/idempiere/binary.file/master/p2.maven/org.idempiere.webservice.client-p2-R20190302
5. reload target platform
6. open org.adempiere.server-feature/server.product
7. go to content tab to add feature org.idempiere.webservices.client-feature
8. go to overview tab to run server by click to (launch an eclipse application)
(have warning dialog about missing constraing of org.glassfish.pfl.pfl-basic but can ignore by continue )