JEE Project Setup with Gradle, Spring and JAX-WS integration
What I’m going to cover in this sample implementation:
- JAX-WS 2.2 Standard conform implementation
- Spring 3.0.5 Integration due SpringBeanAutowiringSupport
- Generic JPA 2.0 DAO with Hibernate as persistence provider
- Gradle 1.x as Build tool
- MTOM Transport for medium-size attachments
- Generic SLF4J logging with jcl and jul to log4j
- JUnit Testing with Spring Integration
- Generic Class for Services due DRY principles
Download the example here.
Run the example using: gradle jettyRun on the console. You should see something like:
INFO - <In-Memory Content Repository started...>
INFO - <Product Service started...>
INFO - <Product Service WS-* Endpoint started...>
The sample contains a simple domain with a few objects (Category, Product and Item) where Item is an generic byte[] abstraction item to store contents in a JCR compliant repository like Apache Jackrabbit. In the example it’s just in a Memory table to store Binary attachments. The Repository can be changed by implementing Repository<byte[]> with custom functionality.
Test the sample using SoapUI:

Ensure that Enable MTOM and Force MTOM are enabled. If other transports are available, SoapUI only uses MTOM if the attachment exceeds a specified size. Enforce this transport model to test the webservice.
The services are deployed at the following URL: “http://localhost:8080/shoppingEngine/services/product” . Append “?wsdl” to read the WSDL (during “add project” in SoapUI).