diff --git a/src/docbkx/tutorial.xml b/src/docbkx/tutorial.xml index c934ab3d..e3fe89cf 100644 --- a/src/docbkx/tutorial.xml +++ b/src/docbkx/tutorial.xml @@ -474,7 +474,7 @@ mvn archetype:create -DarchetypeGroupId=org.springframework.ws \ -DarchetypeArtifactId=spring-ws-archetype \ - -DarchetypeVersion=2.0.0-M1 \ + -DarchetypeVersion=2.0.0-RC2 \ -DgroupId=com.mycompany.hr \ -DartifactId=holidayService @@ -484,8 +484,6 @@ You will find the standard web application deployment descriptor 'WEB-INF/web.xml' here, which defines a Spring-WS MessageDispatcherServlet and maps all incoming requests to this servlet. - We also set the transformWsdlLocations parameter to true, which we will get back to - later. /* - - transformWsdlLocations - true - - ]]> In addition to the above 'WEB-INF/web.xml' file, you will also need another, @@ -648,8 +641,12 @@ public class HolidayEndpoint { - The handleHolidayRequest(..) method is the main handling method method, which gets passed - with the <HolidayRequest/> element from the incoming XML message. + The handleHolidayRequest(..) method is the main handling method + method, which gets passed with the <HolidayRequest/> element from + the incoming XML message. + The @RequestPayload annotation indicates that the + holidayRequest parameter should be mapped to the payload of the + request message. We use the XPath expressions to extract the string values from the XML messages, and convert these values to Date objects using a SimpleDateFormat. @@ -715,7 +712,7 @@ public class HolidayEndpoint { handleHolidayRequest method. In Spring-WS, this process is the responsibility of an EndpointMapping. - In this tutorial, we route messages based on + Here we route messages based on their content, by using a PayloadRootAnnotationMethodEndpointMapping. The annotation used above: @PayloadRoot(namespace = "http://mycompany.com/hr/schemas", localPart = "HolidayRequest") @@ -723,6 +720,8 @@ public class HolidayEndpoint { http://mycompany.com/hr/schemas and the HolidayRequest local name, it will be routed to the handleHolidayRequest method. + It is possible (and quite common) to have multiple, related handling methods in an endpoint, each + of them handling different XML messages. There are also other ways to map endpoints to XML messages, which will be described in the next @@ -784,12 +783,18 @@ public class HolidayEndpoint { We set the location where the service can be reached: /holidayService/. We use a relative URI and we instruct the framework to transform it - dynamically to an absolute URI (hence the transformWsdlLocations setting in - web.xml). + dynamically to an absolute URI. Hence, if the service is deployed to different contexts we don't have to change the URI manually. For more information, please refer to + + For the location transformation to work, we need to add one more parameter to the + web.xml: + transformWsdlLocations + true +]]> +