support multiple webservice project

Description

overview

When create new webservice with rest (spring + cxf) project, there are some aspect that we can improve:

  1. There is an endpoint already running on /rest

  2. duplicate resource and code

solution

  1. issue 1: already has solution on link. that parameter should be added by default to core

  2. issue 2: reuse resources with following improvements:

    1. add new plugin org.idempiere.webservices.helper.resoucelookup

    2. move xsd file to the new plugin and export it

    3. move META-INF/cxf to the new plugin and export it

    4. move ContextLoaderListener to the new plugin and modify contextInitialized code to set classloader of webservice project as ContextClassLoader of current thread

    5. web service project will import the new plugin to gain access to resources and ContextLoaderListener class

Environment

None

Activity

Show:

Carlos Ruiz December 30, 2023 at 10:54 AM

Thanks - tested and merged

Hiep Lq December 30, 2023 at 5:11 AM

cxf-core do Export-Package: META-INF.cxf so spring can read bean define inside

cxf-rt-frontend-jaxws has cxf-servlet.xml but not export.

org.idempiere.webservices.xml/rest-context.xml use cxf-servlet.xml, so org.idempiere.webservices.resources need to export META-INF.cxf
i try to add META-INF.cxf to excludes but it complain “invalid package name“ maybe by upper case

so i move cxf-servlet.xml to org.idempiere.webservices.resources/cxf

Carlos Ruiz December 29, 2023 at 2:55 PM

Hi - I pushed the pull request 2167.

Leaving this here open for your review, in case the package needs to be renamed in other way, or the Export-Package needs to be moved elsewhere.

Carlos Ruiz December 28, 2023 at 7:40 PM

Hi

Could you please review the pull request 2167 ?

With this ticket you added a like Export-Package: META-INF.cxf to the MANIFEST.MF on org.idempiere.webservices.resources package, and that’s stopping the javadoc from working correctly, please check my comments here:

 

As I don’t use this feature you added, I don’t know the impact of removing that line from the MANIFEST.MF

When I remove that line (in the pull request) then the javadoc completes successfully, but it maybe can impact what you are trying to achieve with this ticket.

Regards,

Carlos Ruiz

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Created November 1, 2023 at 7:11 PM
Updated February 1, 2024 at 12:04 PM
Resolved December 30, 2023 at 10:54 AM