synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Fremantle" <pzf...@gmail.com>
Subject Adding support for Payload data types into MessageContext and actually deeper into Axiom
Date Fri, 14 Sep 2007 09:41:42 GMT
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

---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Mime
View raw message