Spring Web Services Framework

org.springframework.ws.soap.addressing.client
Class ActionCallback

java.lang.Object
  extended by org.springframework.ws.soap.addressing.client.ActionCallback
All Implemented Interfaces:
WebServiceMessageCallback

public class ActionCallback
extends Object
implements WebServiceMessageCallback

WebServiceMessageCallback implementation that sets the WS-Addressing Action header on the message.

A usage example with WebServiceTemplate:

 WebServiceTemplate template = new WebServiceTemplate(messageFactory);
 Result result = new DOMResult();
 template.sendSourceAndReceiveToResult(
     new StringSource("<content xmlns=\"http://tempuri.org\"/>"),
     new ActionCallback(new URI("http://tempuri.org/Action")),
     result);
 

Since:
1.0.0
Author:
Arjen Poutsma

Constructor Summary
ActionCallback(String action)
          Create a new ActionCallback with the given Action.
ActionCallback(URI action)
          Create a new ActionCallback with the given Action.
ActionCallback(URI action, AddressingVersion version)
          Create a new ActionCallback with the given version and Action.
ActionCallback(URI action, AddressingVersion version, URI to)
          Create a new ActionCallback with the given version, Action, and optional To.
 
Method Summary
 void doWithMessage(WebServiceMessage message)
          Execute any number of operations on the supplied message.
protected  URI getTo()
          Returns the Destination for outgoing messages.
 void setFaultTo(EndpointReference faultTo)
           
 void setFrom(EndpointReference from)
           
 void setMessageIdStrategy(MessageIdStrategy messageIdStrategy)
          Sets the message id strategy used for creating WS-Addressing MessageIds.
 void setReplyTo(EndpointReference replyTo)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionCallback

public ActionCallback(String action)
               throws URISyntaxException
Create a new ActionCallback with the given Action.

The To header of the outgoing message will reflect the connection URI.

The AddressingVersion is set to Addressing10.

Parameters:
action - the value of the action property to set
Throws:
URISyntaxException

ActionCallback

public ActionCallback(URI action)
Create a new ActionCallback with the given Action.

The To header of the outgoing message will reflect the connection URI.

The AddressingVersion is set to Addressing10.

Parameters:
action - the value of the action property to set

ActionCallback

public ActionCallback(URI action,
                      AddressingVersion version)
Create a new ActionCallback with the given version and Action.

The To header of the outgoing message will reflect the connection URI.

Parameters:
action - the value of the action property to set
version - the WS-Addressing version to use

ActionCallback

public ActionCallback(URI action,
                      AddressingVersion version,
                      URI to)
Create a new ActionCallback with the given version, Action, and optional To.

Parameters:
action - the value of the action property
version - the WS-Addressing version to use
action - the value of the destination property
Method Detail

setMessageIdStrategy

public void setMessageIdStrategy(MessageIdStrategy messageIdStrategy)
Sets the message id strategy used for creating WS-Addressing MessageIds.

By default, the UuidMessageIdStrategy is used on Java 5 and higher, and the RandomGuidMessageIdStrategy on Java 1.4.


setFrom

public void setFrom(EndpointReference from)

setReplyTo

public void setReplyTo(EndpointReference replyTo)

setFaultTo

public void setFaultTo(EndpointReference faultTo)

getTo

protected URI getTo()
Returns the Destination for outgoing messages.

Defaults to the connection URI if no destination was set.


doWithMessage

public void doWithMessage(WebServiceMessage message)
                   throws IOException,
                          TransformerException
Description copied from interface: WebServiceMessageCallback
Execute any number of operations on the supplied message.

Specified by:
doWithMessage in interface WebServiceMessageCallback
Parameters:
message - the message
Throws:
IOException - in case of I/O errors
TransformerException - in case of transformation errors

Spring Web Services Framework

Copyright © 2005-2011 The Spring Web Services Framework. All Rights Reserved.