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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
-
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
-
Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.