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.proxy
Interface ProxyHandler

All Known Implementing Classes:
  AbstractProxyHandler

public interface ProxyHandler

ProxyHandler defines the methods needed to serialize and deserialize the parameters an responses when making a remote web services invocation. The interface requires details about the target web service operation, all of which can be found in the service's WSDL. This information will allow the handler to construct appropriate SOAP messages after serializing request parameters.
This interface is used for sending outgoing messages on the client-side. Receiving web service requests is handled by MessageHandler.

Author:
  Dan Jemiolo (danj)

Method Summary
`java.lang.Object` | `fromXML(org.w3c.dom.Element xml)` Deserializes the given DOM Element into a POJO that can be returned to the invoker of the web service operation.
`java.lang.String` | `getAction()`
`QName` | `getRequestName()`
`QName[]` | `getRequestParameterNames()`
`QName[]` | `getRequestParameterSchemaTypes()`
`java.lang.Class[]` | `getRequestParameterTypes()`
`QName` | `getResponseName()`
`QName` | `getReturnSchemaType()`
`java.lang.Class` | `getReturnType()`
`void` | `setAction(java.lang.String action)`
`void` | `setRequestName(QName requestName)`
`void` | `setRequestParameterNames(QName[] parameterNames)`
`void` | `setRequestParameterSchemaTypes(QName[] parameterTypes)` This is an optional method.
`void` | `setRequestParameterTypes(java.lang.Class[] parameterTypes)` This is an optional method.
`void` | `setResponseName(QName responseName)`
`void` | `setReturnSchemaType(QName returnType)`
`void` | `setReturnType(java.lang.Class returnType)`
`org.w3c.dom.Element` | `toXML(java.lang.Object[] parameters)` Serializes the given objects into a DOM Element that can used in a request SOAP Body.

Method Detail

### fromXML

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

  Deserializes the given DOM Element into a POJO that can be returned to the invoker of the web service operation. Implementations should use Muse's registered Serializers in order to deserialize the XML into objects of the proper types.

  Parameters:
    `xml` - The contents of the response SOAP Body, where the root element contains either a simple value or a single child element that defines a complex type. Multiple return values will not be parsed - they must be part of a single data structure.
  Returns:
    The return value from the operation. This object will have the same type as getReturnType().
  Throws:
    `SoapFault` -
    - If the name of the element does not match the value of getResponseName().
    - If no serialization mechanism exists for the return value type.
    - If the XML could not be deserialized into an object.
  See Also:
    `getReturnType()`, `Serializer.fromXML(Element)`

### getAction

    public java.lang.String getAction()

  Returns:
    The WS-Addressing Action URI for the target operation.

### getRequestName

    public QName getRequestName()

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

### getRequestParameterNames

    public QName[] getRequestParameterNames()

  Returns:
    The QNames for the individual parameters in the SOAP request message, in the order they are defined by the target operation. These are defined in the type (schema) definition of the WSDL input message.
    If the operation takes no parameters (void), or if it takes one simple parameter that is wrapped in the root request element (i.e., WS-RP GetResourceProperty), then this method returns an empty array.

### getRequestParameterSchemaTypes

    public QName[] getRequestParameterSchemaTypes()

  Returns:
    The XSD types that define the operation's parameters. This is an optional method, and if the type data is not provided, the returned array will be empty.

### getRequestParameterTypes

    public java.lang.Class[] getRequestParameterTypes()

  Returns:
    The Java types that are expected by the serialization framework for each of the operation's parameters. This is an optional method, and if the type data is not provided, the returned array will be empty.

### getResponseName

    public QName getResponseName()

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

### getReturnSchemaType

    public QName getReturnSchemaType()

  Returns:
    The XSD type that defines the response value; if the operation has no response value, this method returns null.

### getReturnType

    public java.lang.Class getReturnType()

  Returns:
    The type to which the response value should be deserialized. If the operation has no response value, this method returns Void.TYPE (not null).

### setAction

    public void setAction(java.lang.String action)

  Parameters:
    `action` - The WS-Addressing Action URI for the target operation. This cannot be null.

### setRequestName

    public void setRequestName(QName requestName)

  Parameters:
    `requestName` - The QName of the SOAP request element that deserializable DOM Elements will be wrapped in.

### setRequestParameterNames

    public void setRequestParameterNames(QName[] parameterNames)

  Parameters:
    `parameterNames` - The QNames for the individual parameters in the SOAP request message, in the order they are defined by the target operation. These are defined in the type (schema) definition of the WSDL input message. This array cannot be null, but it can be empty.

### setRequestParameterSchemaTypes

    public void setRequestParameterSchemaTypes(QName[] parameterTypes)

  This is an optional method. If the type data is not provided, getRequestParameterSchema Types() will simply return an empty array.

  Parameters:
    `parameterTypes` - The XSD types that define the operation's parameters.

### setRequestParameterTypes

    public void setRequestParameterTypes(java.lang.Class[] parameterTypes)

  This is an optional method. If the type data is not provided, getRequestParameterTypes() will simply return an empty array.

  Parameters:
    `parameterTypes` - The Java types that are expected by the serialization framework for each of the operation's parameters.

### setResponseName

    public void setResponseName(QName responseName)

  Parameters:
    `responseName` - The QName of the SOAP response element that deserializable DOM Elements will be wrapped in.

### setReturnSchemaType

    public void setReturnSchemaType(QName returnType)

  Parameters:
    `returnType` - The XSD type that defines the response value. If the operation has no response value, the parameter should be null (as opposed to xsd:any).

### setReturnType

    public void setReturnType(java.lang.Class returnType)

  Parameters:
    `returnType` - The type to which the response value should be deserialized. If the operation has no response value, the parameter can be null or Void.TYPE (null will be translated as Void.TYPE).

### toXML

    public org.w3c.dom.Element toXML(java.lang.Object[] parameters)
                              throws SoapFault

  Serializes the given objects into a DOM Element that can used in a request SOAP Body. Implementations should use Muse's registered Serializers in order to serialize the objects into the proper formats.

  Parameters:
    `parameters` - The parameters for the operation, which must be serialized into XML.
  Returns:
    The XML equivalent of the given objects, wrapped in an element whose QName is the value of getRequestName(). Each object's XML fragment will be wrapped in the equivalent QName from the array returned by getRequestParameterNames().
  Throws:
    `SoapFault` -
    - If no serialization mechanism exists for an object's type.
    - If an object could not be serialized into XML.
  See Also:
    `getRequestName()`, `getRequestParameterNames()`, `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