Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2008 BEA Systems, Inc. All Rights Reserved
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.wsrp.ext.holders
Class XmlPayload

    java.lang.Object
      com.bea.wsrp.ext.holders.XmlPayload

All Implemented Interfaces
  Serializable

    public class XmlPayload

extends Object
implements Serializable

For transporting custom data, instead of using MarkupRequestState, MarkupResponseState, InteractionRequestState or InteractionResponseState interfaces, you can send/receive an instance of this class.

Here is an example.

           Element xml = ... // Create this element. This represents your payload.
           XmlPayload payload = new XmlPayload(xml);
           httpRequest.setAttribute(MarkupRequestState.KEY, payload); // Send the xml payload

You can also use this class for transporting XML as payload with custom events.

Here is an example.

           // Create payload
           XmlPayload xmlPayload = new XmlPayload(someDomElement);

           // Fire an event
           HttpServletRequest httpRequest = (HttpServletRequest) actionRequest.getAttribute("javax.servlet.request");
           PortletBackingContext backingContext = PortletBackingContext.getPortletBackingContext(httpRequest);
           backingContext.fireCustomEvent("xmlPayloadEvent", xmlPayload);

XML elements supplied to this class without a namespace will inherit the namespace of the wrapping elements in the SOAP message, which is subjected to change. To avoid conflicting with namespaces declared in the WSRP protocol (and WLP extensions), please consider declaring the XML payload in a seperate application namespace.

See Also
  Serialized Form

Constructor Summary
`XmlPayload()` Creates an instance without the XML payload.
`XmlPayload(Element payload)` Creates an instance with an XML payload.

Method Summary
`Element` | `getPayload()` Returns the XML payload as an element.
`void` | `setPayload(Element payload)` Sets the XML payload as an element.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### XmlPayload

    public XmlPayload()

  Creates an instance without the XML payload.

### XmlPayload

    public XmlPayload(Element payload)

  Creates an instance with an XML payload. The given payload element will be copied into the SOAP message during serialization.

  Parameters
    `payload` -

Method Detail

### getPayload

    public Element getPayload()

  Returns the XML payload as an element.

  Returns
    payload

### setPayload

    public void setPayload(Element payload)

  Sets the XML payload as an element.

  Parameters
    `payload` -

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

Copyright © 2008 BEA Systems, Inc. All Rights Reserved