Re: Adding support for Payload data types into MessageContext and actually deeper into Axiom

"Paul Fremantle" <[email protected]>
Newsgroups gmane.text.xml.axis.devel,gmane.text.xml.commons.devel
Message-ID <[email protected]>
Another reason to do this at the Axiom level - I think we can build
support into the Jaxen XPath helper so that it efficiently computes
XPaths on Beans/Rowsets/recursive Maps.

Paul

On 9/14/07, Paul Fremantle <[email protected]> wrote:
> I recently added a PayloadHelper class to Synapse.
> http://svn.apache.org/repos/asf/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/util/PayloadHelper.java
>
>  It can help get/set the following datatypes from a MessageContext:
>
> XML (OMElement)
> XML (StAX)
> Binary (DataHandler)
> Text (String)
> Map (I created a class called SimpleMap which only allows certain
> simple datatypes as parameters - e.g. Int, Double, etc). see
> http://svn.apache.org/repos/asf/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/util/SimpleMap.java
> The map needs to have SimpleMap as a further data type allowing some
> recursion. This would also allow Beans and JSON to be handled.
>
> You can also find out what payload type the message is. These messages
> are all stored as XML in the Body element using various tags.
>
> for example binary data is always stored as: <ax:binary
> xmlns:ax="http://ws.apache.org/commons/ns/binary">MTOM
> here</ax:binary>
>
> I'd like to move this support directly into the MessageContext class,
> which will make it much easier to write mediators.
>
> Secondly, I'd like to convert the Map model to use an OMSourcedElement
> which would allow us to be more efficient about handling this type. In
> other words, if I put in a Map and get it as a Map, no XML processing
> happens. If someone remotely sends in an XML Map then I can access it
> as a Map object, etc.
>
> Thirdly, I'd like to add a Rowset object (also based on
> OMSourcedElement) which allows us to pass around tabular data (JBDC
> tables, etc)
>
> So in summary, I'd like to be able to store and retrieve "natively"
> the following datatypes:
> * XML (obviously) but with access via: OM, DOM, StaX and String
> * Text access via String/StringBuffer
> * Bean/JSON/Map
> * Binary access via DataHandler and byte[]
> * Rowset
>
> NEXT!
>
> I *really* think this support should be in the base Axiom library.
>
> Here are three reasons:
> 1) It means everyone will use the same code, eg. Axis2 JMS transport
> will put a Map in and Synapse mediator will get it in the same way
> 2) If I just put it in Synapse then I have a problem syncing with
> Axis2 transports. If I put it in Axis2 then I add a new dependency to
> the public API of Synapse (which currently doesn't expose Axis2 - only
> Axiom), or I do a lot of work to hide it.
> 3) I think this would be a really cool addition to Axiom!
>
> Thoughts? Also, who is willing to work with me on coding this?
>
> Paul
>


-- 
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
[email protected]

"Oxygenating the Web Service Platform", www.wso2.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.