GuicedEE Web Services
SOAP web services using Apache CXF conventions inside GuicedEE.
Core Concept
Build SOAP services using standard JAX-WS annotations (@WebService, @WebMethod, @WebParam, @WebResult) and configure endpoints, bindings, interceptors, and WS-Security in the same way you would with CXF. Works alongside GuicedEE Vert.x Web and REST/OpenAPI modules.
Required Flow
- Add
com.guicedee:web-servicesandrequires com.guicedee.webservices;. - Define the service contract:
@WebService(targetNamespace = "http://example.com/hello", name = "HelloService") public interface HelloService { @WebMethod(operationName = "sayHello") @WebResult(name = "greeting") String sayHello(@WebParam(name = "name") String name); } - Implement the service:
@WebService(endpointInterface = "com.example.ws.HelloService", serviceName = "HelloService", portName = "HelloPort", targetNamespace = "http://example.com/hello") public class HelloServiceImpl implements HelloService { @Override public String sayHello(String name) { return "Hello " + name; } } - Enable scanning of the implementation package.
WebServicePostStartupdiscovers concrete@WebServiceclasses, obtains Guice-managed instances, and publishes through CXF's Vert.x transport. UseWSContextfor explicit endpoint registration when scanning is insufficient; do not publish a duplicate endpoint from another startup hook. - For WSDL-first, use the CXF codegen plugin (
cxf-codegen-plugin).
Features
- JAX-WS code-first or WSDL-first
- CXF configuration: addresses, bindings (SOAP 1.1/1.2), interceptors, logging
- MTOM for binary attachments
- WS-Security (WSS4J)
- Guice DI friendly: bind implementations via SPI/lifecycle
- JPMS + ServiceLoader discovery
Non-Negotiable Constraints
- Use standard JAX-WS annotations for service contracts.
- Endpoint publishing should be done during
IGuicePostStartup. - SPI implementations must be dual-registered (
module-info.java+META-INF/services/).