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 Griffiths <pa...@oclc.org> on 2008/01/09 17:53:25 UTC
Defining a pipeline of WSDL endpoints
Hell
I've been looking at Synapse to see whether it's suitable for creating
pipelines of WSDL based services with CBR rules to either select a
particular pipeline or just to by-pass particular services. I've worked
through the samples + configuration language guide, but haven't found a
way to do this. A <send> to a WSDL endpoint completes the input message
processing, so I've not been able to chain services together.
Is it possible to create pipelines of WSDL endpoints in Synapse, where
the message is routed through a sequence of WSDL endpoints? Possibly
with message transformation between each stage to ensure input/output
messages match ? Or do I need to use an external tool such as Camel ?
Apologies if this is already covered in the documentation, or if I've
missed the point of Synapse (message mediation).
Thanks - Paul
--
*Paul Griffiths*
Developer *·* OCLC Ltd
Brincliffe House · 861 Ecclesall Road *·* Sheffield S11 7AE *·* United
Kingdom
t +44-(0)114-281 6467 *·* f +44-(0)114-281 60 41
e paul.griffiths@oclc.org <ma...@oclc.org> *·* w
www.oclc.org <http://www.oclc.org>
Re: Defining a pipeline of WSDL endpoints
Posted by Paul Griffiths <pa...@oclc.org>.
Hi
Thanks for the responses. The initial basic scenario is a sequence of
services that extend a metadata document. e.g.
Input metadata message1 -> synapse proxy service:
Proxy sends message1 -> classification service -> gets message2 response
Transform message2 -> input format message3
Send message3 -> summarisation service -> gets message4 response
Proxy service returns message4 as response to caller.
All the calls are synchronous and the services must be called as a
pipeline, rather than as parallel processes.
At some point in the future I'll probably get the final response message
forwarded to another service as well as the caller, or may use a
fireAndForget type approach to forward it to another system without
returning a response to the original caller. But I need to solve simple
pipeline approach first.
I've tried using the <property name="RESPONSE" value="false"/> snippet
Ruwan suggested, but cannot make it work correctly.
The config I've been experimenting with is below (there is a simple CBR
switch to test that both endpoints can be called) :
> <!-- Attempt at basic CBR using Synapse -->
> <definitions xmlns="http://ws.apache.org/ns/synapse">
>
> <!-- Create the proxy endpoint for the pipeline -->
> <proxy name="pipelineProxy" trace="enable">
> <target inSequence="processMetadata" outSequence="metadataOut"/>
> </proxy>
>
> <!-- XSLT to transform response message to request message -->
> <localEntry key="metadataResponseToRequest"
> src="file:repository/mm/transform/MetadataResponseToRequest.xslt"/>
>
> <!-- Process via pipeline iff content == pipline -->
> <sequence name="processMetadata">
> <!-- Inefficient switch without regard to message
> structure/namespace -->
> <switch source="//*/arg0"
> xmlns:clas="http://indexing.multimatch.oclc.org/">
> <case regex="pipeline">
> <send>
> <endpoint>
> <wsdl
> uri="http://localhost:8080/Classifier/classifier?wsdl"
> service="ClassificationService" port="ClassifierPort"/>
> </endpoint>
> </send>
> <xslt key="metadataResponseToRequest"/>
> <send>
> <endpoint>
> <wsdl
> uri="http://localhost:8080/Summariser/summariser?wsdl"
> service="SummarisationService" port="SummariserPort"/>
> </endpoint>
> </send>
> </case>
> <default>
> <!-- Just summarise the message -->
> <send>
> <endpoint>
> <wsdl
> uri="http://localhost:8080/Summariser/summariser?wsdl"
> service="SummarisationService" port="SummariserPort"/>
> </endpoint>
> </send>
> </default>
> </switch>
> </sequence>
>
> <!-- Return the message -->
> <sequence name="metadataOut">
> <send/>
> </sequence>
>
> </definitions>
Thanks - Paul
--
*Paul Griffiths*
Developer *·* OCLC Ltd
Brincliffe House · 861 Ecclesall Road *·* Sheffield S11 7AE *·* United
Kingdom
t +44-(0)114-281 6467 *·* f +44-(0)114-281 60 41
e paul.griffiths@oclc.org <ma...@oclc.org> *·* w
www.oclc.org <http://www.oclc.org>
Re: Defining a pipeline of WSDL endpoints
Posted by Paul Fremantle <pz...@gmail.com>.
Paul
As Ruwan said, if you can give us a little example, we'll send you
back a Synapse config showing it.
Suppose I'm calling synapse with Message A. Synapse sends Message A to
Service S1 (first in the pipeline). Do you want the response from S1
(say message B) to be sent to the next service in the pipeline (S2)?
Paul
On Jan 9, 2008 4:53 PM, Paul Griffiths <pa...@oclc.org> wrote:
> Hell
> I've been looking at Synapse to see whether it's suitable for creating
> pipelines of WSDL based services with CBR rules to either select a
> particular pipeline or just to by-pass particular services. I've worked
> through the samples + configuration language guide, but haven't found a
> way to do this. A <send> to a WSDL endpoint completes the input message
> processing, so I've not been able to chain services together.
>
> Is it possible to create pipelines of WSDL endpoints in Synapse, where
> the message is routed through a sequence of WSDL endpoints? Possibly
> with message transformation between each stage to ensure input/output
> messages match ? Or do I need to use an external tool such as Camel ?
>
> Apologies if this is already covered in the documentation, or if I've
> missed the point of Synapse (message mediation).
>
> Thanks - Paul
>
> --
>
> *Paul Griffiths*
> Developer *·* OCLC Ltd
> Brincliffe House · 861 Ecclesall Road *·* Sheffield S11 7AE *·* United
> Kingdom
> t +44-(0)114-281 6467 *·* f +44-(0)114-281 60 41
> e paul.griffiths@oclc.org <ma...@oclc.org> *·* w
> www.oclc.org <http://www.oclc.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: Defining a pipeline of WSDL endpoints
Posted by Ruwan Linton <ru...@gmail.com>.
Hi Paul,
You could do this with synapse in two ways, and you will have to select the
right solution for you according to your exact requirement;
(1) - You can make an outgoing message an incoming message using the
following synapse snippet,
<propperty name="RESPONSE" value="false"/>
and then probably do an xslt transformation over the response of the first
service to convert it to a request for the second service according to your
services schemas and then use the Send mediator again to send the request to
the second service and so forth. If I got you correctly from your email this
is what your requirement is, and this second send also is going to be non
blocking and you will need to filter out the right messages.
(2) - You can use the Callout mediator to invoke a particular service and
get the response and aggregate that with another response from another
service. This call is blocking but, this is required if you want to
aggregate data from both responses of the services as the resultant
response. If you just need a pipeline then the ideal would be the first
case.
Let me know your exact scenario so that I can give you a sample
configuration to try out and also let me know if you need any more
clarifications.
Thanks,
Ruwan
On Jan 9, 2008 10:23 PM, Paul Griffiths <pa...@oclc.org> wrote:
> Hell
> I've been looking at Synapse to see whether it's suitable for creating
> pipelines of WSDL based services with CBR rules to either select a
> particular pipeline or just to by-pass particular services. I've worked
> through the samples + configuration language guide, but haven't found a
> way to do this. A <send> to a WSDL endpoint completes the input message
> processing, so I've not been able to chain services together.
>
> Is it possible to create pipelines of WSDL endpoints in Synapse, where
> the message is routed through a sequence of WSDL endpoints? Possibly
> with message transformation between each stage to ensure input/output
> messages match ? Or do I need to use an external tool such as Camel ?
>
> Apologies if this is already covered in the documentation, or if I've
> missed the point of Synapse (message mediation).
>
> Thanks - Paul
>
> --
>
> *Paul Griffiths*
> Developer *·* OCLC Ltd
> Brincliffe House · 861 Ecclesall Road *·* Sheffield S11 7AE *·* United
> Kingdom
> t +44-(0)114-281 6467 *·* f +44-(0)114-281 60 41
> e paul.griffiths@oclc.org <ma...@oclc.org> *·* w
> www.oclc.org <http://www.oclc.org>
>
>
--
Ruwan Linton
http://www.wso2.org - "Oxygenating the Web Services Platform"