synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Asankha C. Perera" <asan...@wso2.com>
Subject Re: Supporting content types in Synapse and Axiom
Date Fri, 27 Jul 2007 12:18:50 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Paul<br>
<br>
I may be wrong, however, I haven't seen many people actually using JMS
Map messages.. The Axis2 JMS transport thus supports bytes and text
messages. So I would think this is a cool feature, but only few many
find it actually useful...<br>
<br>
asankha<br>
<br>
Paul Fremantle wrote:
<blockquote
 cite="mid88f5d710707270313r7f885594k5158115890b01054@mail.gmail.com"
 type="cite">
  <pre wrap="">One more thought. A number of systems use a java Map message as a core
data type. Especially a Map&lt;String,Object&gt; where Object is actually a
simple type object such as Float, Double, String, Boolean

In particular JMS supports these. I think it would be valuable to
define this as a core Synapse datatype. For example, it would be cool
to be able to mediate between a JMS Map message and another JMS Map
message, and have a well-defined schema for what the Axiom
representation would look like in Synapse.

Paul

On 7/26/07, Paul Fremantle <a class="moz-txt-link-rfc2396E" href="mailto:pzfreo@gmail.com">&lt;pzfreo@gmail.com&gt;</a>
wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi

As Synapse is getting more interest I see a number of people looking
to use it and extend it for binary and text content types as well as
XML.

We already support those from some transports (e.g. JMS) but each
transport defines its own way of handling these things, and so I can't
be sure that a message coming in as binary/jms can go out correctly as
binary/http post.

So here is what I'd like to do:

I'd like to have explicit methods:

OMElement get/setPayload()
DataHandler get/setBytesPayload()
String get/setTextPayload()
boolean isBinary();
boolean isText();
int getPayloadType()

In order to make this work, we should have two well defined QNames -
one for binary and one for text.

For example binary payload will be in a wrapper element called:
&lt;a:binary xmlns:a=<a class="moz-txt-link-rfc2396E" href="http://ws.apache.org/commons/axiom/ns/data">"http://ws.apache.org/commons/axiom/ns/data"</a>&gt;

And text payload could be in
&lt;a:text  xmlns:a=<a class="moz-txt-link-rfc2396E" href="http://ws.apache.org/commons/axiom/ns/data">"http://ws.apache.org/commons/axiom/ns/data"</a>&gt;

So if I setBinaryPayload, basically what happens (under the covers is)

OMElement el = fac.createOMElement("binary", axNS);
OMText bin = fac.createOMText(dh, true);
el.addChild(bin);
getBody().setFirstChild(el);

Now I'd be very happy to do this just in Synapse, but it makes much
more sense to do it in Axiom. That would mean everyone using this
(axis2 transports, synapse mediators, etc) would inherit the same
definitions and use the data in a consistent way. Which is the point
of this.

Paul


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

blog: <a class="moz-txt-link-freetext" href="http://pzf.fremantle.org">http://pzf.fremantle.org</a>
<a class="moz-txt-link-abbreviated" href="mailto:paul@wso2.com">paul@wso2.com</a>

"Oxygenating the Web Service Platform", <a class="moz-txt-link-abbreviated" href="http://www.wso2.com">www.wso2.com</a>

    </pre>
  </blockquote>
  <pre wrap=""><!---->

  </pre>
</blockquote>
</body>
</html>

---------------------------------------------------------------------
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