Problem getting jax-ws-catalog to work on deployed environment

Viewed 13

I am trying to implement SOAP in a REST universe and I have run into some issues in regards to wsdl location in the past. I have browsed here and all over the internet and, at the time, I managed to fix my problems using jax-ws-catalog approach. My @WebServiceClient signature looks like this: @WebServiceClient(name = "ExampleService", targetNamespace = "http://some.internet.address/", wsdlLocation = "http://localhost/wsdl/Example.wsdl")

Basically, I have added a jax-ws-catalog file with the following content under my META-INF folder:

catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
    <system systemId="http://localhost/wsdl/Example.wsdl"
            uri="Example.wsdl"
</catalog>

Example.wsdl is inside the META-INF folder as well, on the same level:

 META-INF

  --- jax-ws-catalog.xml 
  --- Example.wsdl

This works well in development mode, when I launch my application from IDEA, since it is using the sources inside the Target folder. In this setup, I have:

 target
    -- classes
       -- META-INF    
         --- jax-ws-catalog.xml 
         --- Example.wsdl
       --wsdlFolder
         ---Example.wsdl

The .jar looks fine during maven-jar-plugin.

However, it seems that during build phase, spring-boot-maven-plugin does repackaging, even if my pom.xml does not include this specific goal and I end up with a .jar file containing the following structure:

META-INF:    
  --- jax-ws-catalog.xml 
  --- Example.wsdl
BOOT-INF:
  -- classesFolder
     -- point of launch for app

[INFO] --- spring-boot-maven-plugin:2.3.7.RELEASE:repackage (repackage) @ pharmec-services-ehr --- [INFO] Replacing main artifact with repackaged archive.

Because of this, when I deploy to CI env, I get the following errors calling the endpoint:

{
    "status": 0,
    "code": "0",
    "exception": "org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.",
    "message": "Error processing request.",
    "message_key": "Error",
    "timestamp": 1663670612002
}

It is weird because I have fixed this issue exactly as described above in May of 2022 and QA validated and closed it. It seems to be back.

My question is: is there a way to make the wsdl location happy for both dev and deployed environments? (more focus on deployments, since I already have a working solution for dev) and is there a repackager running by default because of some dependency that I am missing?

Should I perhaps talk to DevOps and change our deployment pipeline so that it does not require a repackaged .jar structure?

Thanks in advance!

0 Answers
Related