You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Thomas Lundqvist <tl...@gmail.com> on 2007/05/25 12:21:00 UTC
Calling EJB when using Synapse as web service proxy
Hello!
I would like to understand more about the possibilities of invoking external
components when using Synapse as a web service proxy. In one instance I
would like the proxy to intercept a web service call from a Client. The
proxy should make a call to an EJB for e g performing an evaluation based on
the request data. After the (successful) evaluation the call should proceed
by invoking the Server. In this example the proxy (Synapse) would expose
same WS interface as the Server. My main concern is how to integrate / call
the EJB.
Can someone give some pointers / examples on how to achieve this with
Synapse? Any views on the scenario as such are also appreciated...
Many thanks,
Thomas
Re: Calling EJB when using Synapse as web service proxy
Posted by Paul Fremantle <pz...@gmail.com>.
In that case, Asankha's advice was absolutely correct - please write a
class mediator that calls the EJB.
Paul
On 5/28/07, Thomas Lundqvist <tl...@gmail.com> wrote:
> Paul,
>
> Thanks for your reply.
>
> I probably wasn't clear enough in my original mail. The EJB call is only an
> intermediary call (east/west-bound). The south-bound node is any case a web
> service.
>
> Regards,
> Thomas
>
>
> 2007/5/26, Paul Fremantle <pz...@gmail.com>:
> >
> > Thomas
> >
> > I assume you are calling the EJB remotely. Maybe it would be easier to
> > use Axis2 which has an EJB provider and can directly expose EJBs as
> > Web services.
> >
> > Paul
> >
> > On 5/25/07, Thomas Lundqvist <tl...@gmail.com> wrote:
> > > Hello!
> > >
> > > I would like to understand more about the possibilities of invoking
> > external
> > > components when using Synapse as a web service proxy. In one instance I
> > > would like the proxy to intercept a web service call from a Client. The
> > > proxy should make a call to an EJB for e g performing an evaluation
> > based on
> > > the request data. After the (successful) evaluation the call should
> > proceed
> > > by invoking the Server. In this example the proxy (Synapse) would expose
> > > same WS interface as the Server. My main concern is how to integrate /
> > call
> > > the EJB.
> > >
> > > Can someone give some pointers / examples on how to achieve this with
> > > Synapse? Any views on the scenario as such are also appreciated...
> > >
> > > Many thanks,
> > >
> > > Thomas
> > >
> >
> >
> > --
> > 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
> >
> >
>
--
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: Calling EJB when using Synapse as web service proxy
Posted by Thomas Lundqvist <tl...@gmail.com>.
Paul,
Thanks for your reply.
I probably wasn't clear enough in my original mail. The EJB call is only an
intermediary call (east/west-bound). The south-bound node is any case a web
service.
Regards,
Thomas
2007/5/26, Paul Fremantle <pz...@gmail.com>:
>
> Thomas
>
> I assume you are calling the EJB remotely. Maybe it would be easier to
> use Axis2 which has an EJB provider and can directly expose EJBs as
> Web services.
>
> Paul
>
> On 5/25/07, Thomas Lundqvist <tl...@gmail.com> wrote:
> > Hello!
> >
> > I would like to understand more about the possibilities of invoking
> external
> > components when using Synapse as a web service proxy. In one instance I
> > would like the proxy to intercept a web service call from a Client. The
> > proxy should make a call to an EJB for e g performing an evaluation
> based on
> > the request data. After the (successful) evaluation the call should
> proceed
> > by invoking the Server. In this example the proxy (Synapse) would expose
> > same WS interface as the Server. My main concern is how to integrate /
> call
> > the EJB.
> >
> > Can someone give some pointers / examples on how to achieve this with
> > Synapse? Any views on the scenario as such are also appreciated...
> >
> > Many thanks,
> >
> > Thomas
> >
>
>
> --
> 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: Calling EJB when using Synapse as web service proxy
Posted by Paul Fremantle <pz...@gmail.com>.
Thomas
I assume you are calling the EJB remotely. Maybe it would be easier to
use Axis2 which has an EJB provider and can directly expose EJBs as
Web services.
Paul
On 5/25/07, Thomas Lundqvist <tl...@gmail.com> wrote:
> Hello!
>
> I would like to understand more about the possibilities of invoking external
> components when using Synapse as a web service proxy. In one instance I
> would like the proxy to intercept a web service call from a Client. The
> proxy should make a call to an EJB for e g performing an evaluation based on
> the request data. After the (successful) evaluation the call should proceed
> by invoking the Server. In this example the proxy (Synapse) would expose
> same WS interface as the Server. My main concern is how to integrate / call
> the EJB.
>
> Can someone give some pointers / examples on how to achieve this with
> Synapse? Any views on the scenario as such are also appreciated...
>
> Many thanks,
>
> Thomas
>
--
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: Calling EJB when using Synapse as web service proxy
Posted by "Asankha C. Perera" <as...@wso2.com>.
Hi Thomas
The easiest way to accomplish this is through a Class mediator. i.e. you
write a simple POJO to initialize (for JNDI lookup etc) your code, and
then on each received message, you perform your call to the EJB, and
then based on the result, enrich/transform the message as necessary and
then pass it on. Your code will have full access to the message, and
thus you could do anything you want. Of course, before your class
mediator intercepts the message (and after) you could use the other
mediators to perform your call only on a specific filter etc. or perform
transforms etc through other means..
Please see the following link to see how you could write a sample
mediator
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html?content-type=text%2Fhtml&view=co#Sample510
Also see http://ws.apache.org/synapse/Synapse_Extending.html
Also see http://issues.apache.org/jira/browse/SYNAPSE-50 for a sample
mediator by one of our users
If you wish, you may also use Spring to wire up your mediator.. Let me
know if you need any more help on this!
asankha
Thomas Lundqvist wrote:
> Hello!
>
> I would like to understand more about the possibilities of invoking
> external
> components when using Synapse as a web service proxy. In one instance I
> would like the proxy to intercept a web service call from a Client. The
> proxy should make a call to an EJB for e g performing an evaluation
> based on
> the request data. After the (successful) evaluation the call should
> proceed
> by invoking the Server. In this example the proxy (Synapse) would expose
> same WS interface as the Server. My main concern is how to integrate /
> call
> the EJB.
>
> Can someone give some pointers / examples on how to achieve this with
> Synapse? Any views on the scenario as such are also appreciated...
>
> Many thanks,
>
> Thomas
>
---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-user-help@ws.apache.org