From f1ddfb63e94b79117b697dad2e3e598227c249ae Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Sun, 22 Apr 2007 08:49:16 +0000 Subject: [PATCH] --- src/docbkx/tutorial.xml | 90 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 src/docbkx/tutorial.xml diff --git a/src/docbkx/tutorial.xml b/src/docbkx/tutorial.xml new file mode 100644 index 00000000..9e11fcf4 --- /dev/null +++ b/src/docbkx/tutorial.xml @@ -0,0 +1,90 @@ + + + + Writing Contract-First Web Services +
+ Introduction + + This tutorial shows you how to write contract-first Web services, i.e. starting with the XML Schema/WSDL + contract instead of Java code. Spring Web Services focuses on this development style, and this tutorial + helps you get started. Note that the first part of this tutorial contains almost no Spring-WS specific + information: it is mostly about XML, XSD, and WSDL. The second part focusses on implementing this contract + using Spring-WS. + + + In this tutorial, we will define a Web service that is created by a Human Resources department. Clients can + send holiday request forms to this service to book a holiday. + + + The most important thing when doing contract-first Web service development is to try and think in terms of + XML. This means that Java-language concepts are of lesser importance. It is the XML that is sent across the + wire, and you should focus on that. The fact that Java is used to implement the Web service is an + implementation detail. An important detail, but a detail nonetheless. + +
+
+ Messages + + In this section, we will focus on the actual XML messages that are sent to and from the service. We will + start out by determining what these messages look like. + +
+ Holiday + + In the scenario, we have to deal with holiday request, so it makes sense to determine what a holiday + looks like: + + + 2006-07-03 + 2006-07-07 +]]> + + A holiday consists of a start date and an end date. We decided to use the standard + ISO 8601 date format for the dates, + because that will save a lot of parsing hassle. We also added a namespace to the element, to make sure + our elements can used within other XML documents. + +
+
+ Employee + + There is also the notion of an employee in the scenario. Here's what it looks like: + + + 42 + Arjen + Poutsma +]]> + + We have used the same namespace as before. If this employee element could be used in other scenarios, it + might make sense to use a different namespace, such as + http://mycompany.com/employees/schemas. + +
+
+ HolidayRequest + + Both the holiday and employee element can be put in a HolidayRequest: + + + + 2006-07-03 + 2006-07-07 + + + 42 + Arjen + Poutsma + +]]> + + The order of the two element does not matter: Employee could have been the first element just as well. As long as all the data is there; that's what is + important. In fact, the data is the only thing that is important: we are taking a data-driven approach. + +
+
+