Contract-first is considered best practice for designing a WebService:
- create a sample xml message
- generate the xsd based on the xml: use trang or XmlSpy
- tweak the xsd
Define your Spring-WS endpoints as a POJO with @EndPoint:
- input message
- start a business service
- result message
Let Spring generate the WSDL-boilerplate around your existing xsd and @Endpoints. For the xml parsing/generation, you can use SAX, DOM or Trax or use a more advanced (un)marshaller with the Spring OXM module: e.g. Jaxb2 or XmlBeans.
For testing your WS, use
soapUI.
Other Spring WS features are:
- pluggable interceptors: logging, optional validating,...
- client WS: WebServiceTemplate
- WS over JMS or SMTP
- OSGI Bundles
- WS Security (see ws.apache.org/wss4j/)
- WS-Addressing
No comments:
Post a Comment