0

I use jaxws-2.2 feature and need to know how to configure JAX-WS for the WLP v 16.0.0.4.

WLP uses Apache CXF implementation for JAX-WS. Apache CXF JAX-WS configuration includes the next two steps.

  1. Create servlet class mapping (org.apache.cxf.transport.servlet.CXFServlet) in the web.xml

  2. Create the JAX-WS endpoint configuration (jaxws:endpoint) in the cxf-servlet.xml

Maybe there are the other ways for configuration JAX-WS Apache CXF implementation on Liberty, however, I don't know it. All examples for cxf-servlet.xml that I found related to Spring:

  1. https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.1/html/Deploying_into_a_Web_Server/DeployCxf.html

  2. Apache CXF http://cxf.apache.org/docs/jax-ws-configuration.html

  3. IBM https://www.ibm.com/developerworks/websphere/library/techarticles/1001_thaker/1001_thaker.html (please see attached pdf and sample application).

I couldn't find the cxf-servlet.xml example for the pure Java EE application without Spring (and any others 3rd party) dependencies.

Kind regards,

Alexander

senleft
  • 483
  • 1
  • 4
  • 17
  • I do not believe either of the steps you describe are required since they are not requirements of the Java EE spec. Have you tried configuring jaxws-2.2 and using the JAX-WS annotations? – Alasdair Apr 07 '17 at 17:43

2 Answers2

1

Once you've added the jax-ws feature to server.xml, the easiest thing is to create a war file with a class in it, just like you would a servlet, but this class has an @WebService annotation on it instead of an @WebServlet. The public methods will become your webservice operations. WSDL will be produced automatically when you deploy the war file. It's exact URL is probably detectable by looking at Liberty's messages.log file. Web.xml is optional.

Bruce T.
  • 992
  • 4
  • 5
0

It's a big mistake to deal with the JAX-WS implementation provided within WLP (here cxf)...
You don't need specific "configuration", just stick with the JAX-WS specification that has lots of annotations to define the services, the operations, the endpoints and the parameter mapping (JAX-B) etc. You don't need any configuration file
In short, just create a POJO, annotated the class with @WebService and the methods with @WebMethod
You'll find lots of tutorial on the web. One from Oracle is here
Check the classes in the javax.jwsand javax.jws.soap packages in the official jee6/jee7 javadoc
It's the same principle for REST services, ie plain annotated POJO classes..

titou10
  • 2,814
  • 1
  • 19
  • 42