|
Oracle Fusion Middleware Java API for Oracle WebLogic Portal 10g Release 3 (10.3.4) E14255-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bea.wsrp.ext.holders.XmlPayload
public class XmlPayload
This class can be used to add XML payload for custom data transport and events.
When used for event payloads over WSRP 2.0, the XmlPayload object is marshalled into the WSRP event payload in the SOAP message directly, and any WSRP 2.0 event payloads that WLP does not know how to convert into a native Java object are represented asXmlPayload
objects.
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. For WSRP 2.0 this is required by the schema.
Constructor Summary | |
---|---|
XmlPayload()
Creates an instance without the XML payload. |
|
XmlPayload(Element payload)
Creates an instance with an XML payload. |
|
XmlPayload(Element payload,
QName type)
Creates an instance with an XML payload and the specified XML type. |
Method Summary | |
---|---|
Element |
getPayload()
Returns the XML payload as an element. |
QName |
getType()
Returns the XML type of this XmlPayload, if set. |
void |
setPayload(Element payload)
Sets the XML payload as an element. |
void |
setType(QName type)
Sets the XML type of this XmlPayload, to be used in the WSRP event metadata if the XmlPayload is used as an event payload. |
String |
toString()
Returns the XML this XmlPayload object's DOM element represents as a somewhat normalized string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XmlPayload()
public XmlPayload(Element payload)
payload
- public XmlPayload(Element payload, QName type)
payload
- Method Detail |
---|
public Element getPayload()
public void setPayload(Element payload)
payload
- public void setType(QName type)
type
- the XML typepublic QName getType()
null
if not set.public String toString()
toString
in class Object
|
Oracle Fusion Middleware Java API for Oracle WebLogic Portal 10g Release 3 (10.3.4) E14255-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |