You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Paul Fremantle <pz...@gmail.com> on 2007/08/02 21:59:48 UTC

Re: Mediator adapters for ease of use

Glen

Firstly, I think we should Synapse-user as well :-)

Personally, I'm not *so* sure the OMElement one is that useful -
because if you grok OMElement you can easily figure out MC.

On the other hand the DOM and StAX have an advantage that they are
java standard APIs. So I find those two more useful. Especially DOM as
you have to do some freaky stuff to convert from an OMElement to a
DOOM Element so if we got that out of the way for the user then that
would be goodness. Also we might end up fixing the bugs in the
LLOM->DOOM conversion process that have been bugging me the last
couple of days!!!

Paul

On 8/2/07, Glen Daniels <gl...@thoughtcraft.com> wrote:
> So right now, people building Synapse Mediators need to grok the
> MessageContext interface, and how to pull data from / push data to
> there.  Granted, not a huge problem, but Paul and I were talking earlier
> about the Class Mediator, and that got me thinking we might also
> consider a couple of convenience classes:
>
> abstract class DOMMediator implements Mediator {
>    public final boolean mediate(MessageContext synCtx) {
>      // Get DOM, pass to...
>    }
>
>    // Here's what you override
>    public abstract boolean mediate(Element element);
> }
>
> ...and the same thing with StAXMediator, which hands off an
> XmlStreamReader instead of an Element.  In either case, we'd want an
> available switch to decide whether the passed object points to the
> entire SOAP envelope or just the first body element.
>
> This is really just like Axis1's MessageProvider allowing operation
> signatures that take Element or SOAPEnvelope or MessageContext.
>
> Does this actually seem useful, or is it really simple enough just to
> get the content from the MessageContext in the form you want?  I'm not
> sure, hence this mail. :)
>
> Thanks,
> --Glen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>


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

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

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


Re: Mediator adapters for ease of use

Posted by Paul Fremantle <pz...@gmail.com>.
Glen

I just checked in a Helper class:

https://svn.apache.org/repos/asf/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/util
PayloadHelper

It allows you to get/set a variety of data into both MessageContext
and/or SOAPEnveloper, including binary, text, a SimpleMap, OMElement
and StAX all as the payload (i.e. the first element of the Body).

[SimpleMap is a map from string->int, float, double, String, byte[], etc.]

One option would be to expose these helpers on the MessageContext
itself and thereby mean that mediator writers would have easy access
into MC.

What do you all think?

Paul

On 8/2/07, Paul Fremantle <pz...@gmail.com> wrote:
> Glen
>
> Firstly, I think we should Synapse-user as well :-)
>
> Personally, I'm not *so* sure the OMElement one is that useful -
> because if you grok OMElement you can easily figure out MC.
>
> On the other hand the DOM and StAX have an advantage that they are
> java standard APIs. So I find those two more useful. Especially DOM as
> you have to do some freaky stuff to convert from an OMElement to a
> DOOM Element so if we got that out of the way for the user then that
> would be goodness. Also we might end up fixing the bugs in the
> LLOM->DOOM conversion process that have been bugging me the last
> couple of days!!!
>
> Paul
>
> On 8/2/07, Glen Daniels <gl...@thoughtcraft.com> wrote:
> > So right now, people building Synapse Mediators need to grok the
> > MessageContext interface, and how to pull data from / push data to
> > there.  Granted, not a huge problem, but Paul and I were talking earlier
> > about the Class Mediator, and that got me thinking we might also
> > consider a couple of convenience classes:
> >
> > abstract class DOMMediator implements Mediator {
> >    public final boolean mediate(MessageContext synCtx) {
> >      // Get DOM, pass to...
> >    }
> >
> >    // Here's what you override
> >    public abstract boolean mediate(Element element);
> > }
> >
> > ...and the same thing with StAXMediator, which hands off an
> > XmlStreamReader instead of an Element.  In either case, we'd want an
> > available switch to decide whether the passed object points to the
> > entire SOAP envelope or just the first body element.
> >
> > This is really just like Axis1's MessageProvider allowing operation
> > signatures that take Element or SOAPEnvelope or MessageContext.
> >
> > Does this actually seem useful, or is it really simple enough just to
> > get the content from the MessageContext in the form you want?  I'm not
> > sure, hence this mail. :)
> >
> > Thanks,
> > --Glen
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: synapse-dev-help@ws.apache.org
> >
> >
>
>
> --
> Paul Fremantle
> Co-Founder and VP of Technical Sales, WSO2
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>


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

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

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


Re: Mediator adapters for ease of use

Posted by Paul Fremantle <pz...@gmail.com>.
Glen

I just checked in a Helper class:

https://svn.apache.org/repos/asf/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/util
PayloadHelper

It allows you to get/set a variety of data into both MessageContext
and/or SOAPEnveloper, including binary, text, a SimpleMap, OMElement
and StAX all as the payload (i.e. the first element of the Body).

[SimpleMap is a map from string->int, float, double, String, byte[], etc.]

One option would be to expose these helpers on the MessageContext
itself and thereby mean that mediator writers would have easy access
into MC.

What do you all think?

Paul

On 8/2/07, Paul Fremantle <pz...@gmail.com> wrote:
> Glen
>
> Firstly, I think we should Synapse-user as well :-)
>
> Personally, I'm not *so* sure the OMElement one is that useful -
> because if you grok OMElement you can easily figure out MC.
>
> On the other hand the DOM and StAX have an advantage that they are
> java standard APIs. So I find those two more useful. Especially DOM as
> you have to do some freaky stuff to convert from an OMElement to a
> DOOM Element so if we got that out of the way for the user then that
> would be goodness. Also we might end up fixing the bugs in the
> LLOM->DOOM conversion process that have been bugging me the last
> couple of days!!!
>
> Paul
>
> On 8/2/07, Glen Daniels <gl...@thoughtcraft.com> wrote:
> > So right now, people building Synapse Mediators need to grok the
> > MessageContext interface, and how to pull data from / push data to
> > there.  Granted, not a huge problem, but Paul and I were talking earlier
> > about the Class Mediator, and that got me thinking we might also
> > consider a couple of convenience classes:
> >
> > abstract class DOMMediator implements Mediator {
> >    public final boolean mediate(MessageContext synCtx) {
> >      // Get DOM, pass to...
> >    }
> >
> >    // Here's what you override
> >    public abstract boolean mediate(Element element);
> > }
> >
> > ...and the same thing with StAXMediator, which hands off an
> > XmlStreamReader instead of an Element.  In either case, we'd want an
> > available switch to decide whether the passed object points to the
> > entire SOAP envelope or just the first body element.
> >
> > This is really just like Axis1's MessageProvider allowing operation
> > signatures that take Element or SOAPEnvelope or MessageContext.
> >
> > Does this actually seem useful, or is it really simple enough just to
> > get the content from the MessageContext in the form you want?  I'm not
> > sure, hence this mail. :)
> >
> > Thanks,
> > --Glen
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: synapse-dev-help@ws.apache.org
> >
> >
>
>
> --
> Paul Fremantle
> Co-Founder and VP of Technical Sales, WSO2
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>


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

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

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