Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.muse.core.routing
Interface MessageHandler

All Known Implementing Classes:
  AbstractMessageHandler

public interface MessageHandler

MessageHandler defines the methods needed to serialize and deserialize the parameters and responses for a web service operation. It also references a Java method that is used to invoke the operation.
This interface is used for receiving incoming messages on the server-side, not the client-side. Sending web service requests is handled by ProxyHandler.

Author:
  Dan Jemiolo (danj)

Method Summary
`java.lang.Object[]` | `fromXML(org.w3c.dom.Element xml)` Deserializes the given DOM Element into a set of POJOs that can be used when invoking a Java method.
`java.lang.String` | `getAction()`
`java.lang.reflect.Method` | `getMethod()`
`QName` | `getRequestName()`
`QName` | `getResponseName()`
`void` | `setMethod(java.lang.reflect.Method method)`
`org.w3c.dom.Element` | `toXML(java.lang.Object result)` Serializes the given object into a DOM Element.

Method Detail

### fromXML

    public java.lang.Object[] fromXML(org.w3c.dom.Element xml)
                               throws SoapFault

  Deserializes the given DOM Element into a set of POJOs that can be used when invoking a Java method. Implementations should use Muse's registered Serializers in order to deserialize the XML into objects of the proper types.

  Parameters:
    `xml` - The contents of a SOAP Body, where the root element contains all of the method parameters. For simple parameters, this element may contain the actual parameter data.
  Returns:
    An array with the method parameters in the correct order for invocation. This array can be passed to the invoke() method in java.lang.reflect.Method. If the method takes no parameters, an empty array is returned.
  Throws:
    `SoapFault` -
    - If the number of parameters does not match the number of child Elements.
    - If no serialization mechanism exists for the object's type.
    - If any child elements could not be deserialized into an object.
  See Also:
    `Serializer.fromXML(Element)`

### getAction

    public java.lang.String getAction()

  Returns:
    The WS-A Action associated with the handler's operation.

### getMethod

    public java.lang.reflect.Method getMethod()

  Returns:
    The Java method that should be used to execute the operation.

### getRequestName

    public QName getRequestName()

  Returns:
    The QName of the SOAP request element that deserializable DOM Elements will be wrapped in.

### getResponseName

    public QName getResponseName()

  Returns:
    The QName of the SOAP response element that deserializable DOM Elements will be wrapped in.

### setMethod

    public void setMethod(java.lang.reflect.Method method)

  Parameters:
    `method` - The Java method that should be used to execute the operation.

### toXML

    public org.w3c.dom.Element toXML(java.lang.Object result)
                              throws SoapFault

  Serializes the given object into a DOM Element. Implementations should use Muse's registered Serializers in order to serialize the objects into the proper formats.

  Parameters:
    `result` - The response value from the operation, which must be serialized into XML.
  Returns:
    The XML equivalent of the given object, wrapped in an element whose QName is the value of getResponseName().
  Throws:
    `SoapFault` -
    - If no serialization mechanism exists for the object's type.
    - If the object could not be serialized into XML.
  See Also:
    `getResponseName()`, `Serializer.toXML(Object, QName)`

Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD