2008/06/13

SpringOne 2008 - Using Spring Web Services 1.5 by Arjen Poutsma

Contract-first is considered best practice for designing a WebService:
  1. create a sample xml message
  2. generate the xsd based on the xml: use trang or XmlSpy
  3. 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