Java Reference
In-Depth Information
Solution
Spring-WS provides a set of facilities for you to develop contract-first web services. The essential tasks
for building a Spring-WS web service include the following:
Setting up and configuring a Spring MVC application for Spring-WS
Mapping web service requests to endpoints
Creating service endpoints to handle the request messages and return the
response messages
Publishing the WSDL file for this web service
The concept of an endpoint in web services is much like that of a controller in web applications.
The difference is that a web controller deals with HTTP requests and HTTP responses, while a service
endpoint deals with XML request messages and XML response messages. They both need to invoke
other back-end services to handle the requests.
Spring-WS provides various abstract endpoint classes for you to process the request and response
XML messages using different XML processing technologies/APIs. These classes are all located in the
org.springframework.ws.server.endpoint package. You can simply extend one of them to process the
XML messages with a particular technology/API. Table 5-2 lists these endpoint classes.
Table 5-2. Endpoint Classes for Different XML Processing Technologies/APIs
Technology/API
Endpoint Class
AbstractDomPayloadEndpoint
DOM
AbstractJDomPayloadEndpoint
JDOM
dom4j
AbstractDom4jPayloadEndpoint
AbstractXomPayloadEndpoint
XOM
AbstractSaxPayloadEndpoint
SAX
AbstractStaxEventPayloadEndpoint
Event-based StAX
AbstractStaxStreamPayloadEndpoint
Streaming StAX
AbstractMarshallingPayloadEndpoint
XML marshalling
Note that the preceding endpoint classes are all for creating payload endpoints. That means you can
access only the payloads of the request and response messages (i.e., the contents in the SOAP body, but
not other parts of the messages like the SOAP headers). If you need to get access to the entire SOAP
message, you should write an endpoint class by implementing the
org.springframework.ws.server.endpoint.MessageEndpoint interface.
Search WWH ::




Custom Search