diff --git a/src/docbkx/client.xml b/src/docbkx/client.xml index a42c1a99..a9cf44b6 100644 --- a/src/docbkx/client.xml +++ b/src/docbkx/client.xml @@ -31,19 +31,21 @@ object again.
- Transports + URIs and Transports - The WebServiceTemplate requires a reference to a - MessageSender. The message sender is responsible for sending the XML - message across a transport layer. + The WebServiceTemplate uses an URI as the message destination. You can either + set a defaultUri property on the template itself, or give an URI when calling + a method on the template. The URI will be resolved into a + a MessageSender. The message sender is responsible for sending the XML + message across a transport layer. You can set one or more message senders using the + messageSender or messageSenders. There are two implementations of the MessageSender interface for sending - messages via HTTP. The simplest implementation is the + messages via HTTP. The default implementation is the HttpUrlConnectionMessageSender, which uses the facilities provided by Java SE itself. The alternative is the CommonsHttpMessageSender, which uses the Jakarta Commons HttpClient. Use the latter if you need more advanced and easy-to-use functionality. - Both HTTP message senders require an URL to be set using the url property.
@@ -79,15 +81,11 @@ import org.springframework.ws.transport.WebServiceMessageSender; public class WebServiceClient { - private static final String MESSAGE = "Hello World"; + private static final String MESSAGE = "Hello Web Service World"; private WebServiceTemplate webServiceTemplate = new WebServiceTemplate(); - public void setMessageFactory(WebServiceMessageFactory messageFactory) { - webServiceTemplate.setMessageFactory(messageFactory); - } - - public void setMessageSender(WebServiceMessageSender messageSender) { - webServiceTemplate.setMessageSender(messageSender); + public void setDefaultUri(String defaultUri) { + webServiceTemplate.setDefaultUri(defaultUri); } public void simpleSendAndReceive() { @@ -104,18 +102,14 @@ public class WebServiceClient { - - - - - + ]]> This example uses the template to send a hello world message to the web service located at http://localhost:8080/WebService, and writes the result to the console. The - WebServiceTemplate is injected with the message sender. A zero argument + WebServiceTemplate is injected with the default URI. A zero argument constructor and messageFactory/messageSender bean properties are provided and can be used for constructing the instance (using a BeanFactory or plain Java code). Alternatively, consider deriving from