You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by pi...@almerys.com on 2008/08/01 13:57:01 UTC

[Synapse 1.2] Proxying a WS

Hello all,
I am currently managing a web app based on Axis2 which exposes 6 WS. All 
is working perfectly and is in production.
There is a WS, coded in .Net and hosted on IIS server wants to access 
functionnalities of the webapp.
After some searches and a question on axis2 user list, it seems that the 
best is to use synapse.
After some readings, here is what I understand:
- I need to add synapse.mar axis module
- I engage the module globally
- I configure the proxy functions of synapse in the xml configuration file

Is that right?

The problem is that I want to do a bit more than simply redirecting the 
client request: I want to check coherency of the data and add information 
in the SOAP-BODY.
How can I do that? Do I have to implement a Mediator? What changes in 
synapse configuration file do I have to perform (I think in the insequence 
tag)?
As you can see, i'm a bit confused...

Thanks in advance for your help,

Pierre

Re: [Synapse 1.2] Proxying a WS

Posted by Ruwan Linton <ru...@gmail.com>.
Hi Pierre,

You need to use an XSLT mediator or XQuery Mediator to alter the SOAP BODY,
please have a look at the

http://synapse.apache.org/Synapse_Samples.html#Sample8
http://synapse.apache.org/Synapse_Configuration_Language.html#xslt

Thanks,
Ruwan

On Fri, Aug 1, 2008 at 8:38 PM, <pi...@almerys.com> wrote:

> Hi Asankha,
> Thanks a lot for the answers.
> As I told in my previous email, the current web app is already in
> production. So I want to modify it as less as possible...
> For caching and load balancing, I an using Websphere mechanism wich match
> our needs right now. I know I would used about 0.01% of synapse
> possibilities if I'm using it as an axis2 module but I just need to
> perform proxying for one WS... The others embedded in my web app don't
> have to change.
> I'll perhaps set up "complete" synapse solution to get trained though.
>
> I am not sure, i've been clear on what I want to do, so I will describe
> the scenario:
> - The client sends a request to my web app. This request contains in the
> SOAP Header information on the client and the user of the client. The SOAP
> Body contains the business information for the WS
> - My web app (which extends Axis2 servlet) receives the request, parses
> the SOAP Header to extract information, set in the context if SSL is used
> and let Axis2 forwards the request through the module.
> - Synapse module would treat the request and if it is a request for the
> new WS; check coherency (message validation using validate mediator) and
> add some information ('is SSL used' for example) in a new tag of the
> SOAP-BODY before sending it to a .Net WS hosted on a iis server.
> - The .Net WS treats the request, sends it back to Synapse which sends it
> back to the client withou doing anything.
>
> I have tested some samples, I get what synapse can do... but not for
> altering the message (by adding SOAP-BODY tags)...
> Synapse seems to be a really good product.
>
> Thanks in advance for your answers
>
> Pierre
>
>
>
>
>
> "Asankha C. Perera" <as...@wso2.com>
> 01/08/2008 16:42
> Veuillez répondre à
> user@synapse.apache.org
>
>
> A
> user@synapse.apache.org
> cc
>
> Objet
> Re: [Synapse 1.2] Proxying a WS
>
>
>
>
>
>
> Hi Pierre
> > After some readings, here is what I understand:
> > - I need to add synapse.mar axis module
> > - I engage the module globally
> > - I configure the proxy functions of synapse in the xml configuration
> file
> >
> Well.. an ESB could do do a lot more than just front end Axis2 WS
> sitting on the same Axis2 runtime.. so I would suggest you deploy
> Synapse standalone. This would be easier for you to start up and get
> going as well, and would allow you to do much more than just forwarding,
> such as throttling, caching, load balancing, transport switching, etc..
> and much more.
> > The problem is that I want to do a bit more than simply redirecting the
> > client request: I want to check coherency of the data and add
> information
> > in the SOAP-BODY.
> > How can I do that? Do I have to implement a Mediator?
> No, you can use the validate mediator and validate your message, or a
> fragment of it against a schema. See
> http://synapse.apache.org/Synapse_Configuration_Language.html#validate
> http://synapse.apache.org/Synapse_Samples.html#Sample7
> > As you can see, i'm a bit confused...
> >
> Hope the above helps.. you can first try the samples to understand how
> Synapse can help you.. feel free to ask more questions
>
> asankha
>
> --
> Asankha C. Perera
>
> WSO2 - http://wso2.org
> http://esbmagic.blogspot.com
>
>
>


-- 
Ruwan Linton
http://wso2.org - "Oxygenating the Web Services Platform"
http://ruwansblog.blogspot.com/

Re: [Synapse 1.2] Proxying a WS

Posted by pi...@almerys.com.
Hi Asankha,
Thanks a lot for the answers.
As I told in my previous email, the current web app is already in 
production. So I want to modify it as less as possible...
For caching and load balancing, I an using Websphere mechanism wich match 
our needs right now. I know I would used about 0.01% of synapse 
possibilities if I'm using it as an axis2 module but I just need to 
perform proxying for one WS... The others embedded in my web app don't 
have to change.
I'll perhaps set up "complete" synapse solution to get trained though.

I am not sure, i've been clear on what I want to do, so I will describe 
the scenario:
- The client sends a request to my web app. This request contains in the 
SOAP Header information on the client and the user of the client. The SOAP 
Body contains the business information for the WS
- My web app (which extends Axis2 servlet) receives the request, parses 
the SOAP Header to extract information, set in the context if SSL is used 
and let Axis2 forwards the request through the module.
- Synapse module would treat the request and if it is a request for the 
new WS; check coherency (message validation using validate mediator) and 
add some information ('is SSL used' for example) in a new tag of the 
SOAP-BODY before sending it to a .Net WS hosted on a iis server.
- The .Net WS treats the request, sends it back to Synapse which sends it 
back to the client withou doing anything.

I have tested some samples, I get what synapse can do... but not for 
altering the message (by adding SOAP-BODY tags)...
Synapse seems to be a really good product.

Thanks in advance for your answers

Pierre





"Asankha C. Perera" <as...@wso2.com> 
01/08/2008 16:42
Veuillez répondre à
user@synapse.apache.org


A
user@synapse.apache.org
cc

Objet
Re: [Synapse 1.2] Proxying a WS






Hi Pierre
> After some readings, here is what I understand:
> - I need to add synapse.mar axis module
> - I engage the module globally
> - I configure the proxy functions of synapse in the xml configuration 
file
> 
Well.. an ESB could do do a lot more than just front end Axis2 WS 
sitting on the same Axis2 runtime.. so I would suggest you deploy 
Synapse standalone. This would be easier for you to start up and get 
going as well, and would allow you to do much more than just forwarding, 
such as throttling, caching, load balancing, transport switching, etc.. 
and much more.
> The problem is that I want to do a bit more than simply redirecting the 
> client request: I want to check coherency of the data and add 
information 
> in the SOAP-BODY.
> How can I do that? Do I have to implement a Mediator?
No, you can use the validate mediator and validate your message, or a 
fragment of it against a schema. See
http://synapse.apache.org/Synapse_Configuration_Language.html#validate
http://synapse.apache.org/Synapse_Samples.html#Sample7
> As you can see, i'm a bit confused...
> 
Hope the above helps.. you can first try the samples to understand how 
Synapse can help you.. feel free to ask more questions

asankha

-- 
Asankha C. Perera

WSO2 - http://wso2.org
http://esbmagic.blogspot.com



Re: [Synapse 1.2] Proxying a WS

Posted by "Asankha C. Perera" <as...@wso2.com>.
Hi Pierre
> After some readings, here is what I understand:
> - I need to add synapse.mar axis module
> - I engage the module globally
> - I configure the proxy functions of synapse in the xml configuration file
>   
Well.. an ESB could do do a lot more than just front end Axis2 WS 
sitting on the same Axis2 runtime.. so I would suggest you deploy 
Synapse standalone. This would be easier for you to start up and get 
going as well, and would allow you to do much more than just forwarding, 
such as throttling, caching, load balancing, transport switching, etc.. 
and much more.
> The problem is that I want to do a bit more than simply redirecting the 
> client request: I want to check coherency of the data and add information 
> in the SOAP-BODY.
> How can I do that? Do I have to implement a Mediator?
No, you can use the validate mediator and validate your message, or a 
fragment of it against a schema. See
http://synapse.apache.org/Synapse_Configuration_Language.html#validate
http://synapse.apache.org/Synapse_Samples.html#Sample7
> As you can see, i'm a bit confused...
>   
Hope the above helps.. you can first try the samples to understand how 
Synapse can help you.. feel free to ask more questions

asankha

-- 
Asankha C. Perera

WSO2 - http://wso2.org
http://esbmagic.blogspot.com