Hi,

I think I might be pushing/abusing mediators, by doing more that message
manipulation, I'm trying to call endpoint from within a script, and would be
grateful for some advice.

Here is the setup:

1. Synapse

a) publishing a predefined WSDL of 'composite' services. e.g.
createTroubleTicket.
b) a mediator chops up incoming SOAP Payload XML into parent child records
c) the mediator calls (external) lower level atomic services (e.g. create
record) for the parent
d) the mediator needs to either calculate child id (e.g. sequential index)
or use the result of parent ids created at runtime
e) the mediator calls (external) lower level create record for the children

2. RESTful server for the (external) Atomic services
a). create record in a DB (not JPA, uses propritary API to create 1 row in
an underlying DB)


I am writing a Groovy mediator to take the parent and child records and then
call the atomic service endpoitns using somehtin glike:

    def createEP = mc.getEndpoint("SOME_API_CREATE")
    createEP.send(newMc)

I've basically got 1a,1b & 2a working, but for 1c-e  trying to create the
new MessaceContext ('newMc') is perhaps telling me I should not be doing
this?

I wanted to avoid 'programming in XML' via the declarative Synapse
mediators, but perhaps I will have to?

Regards
Wayne

Reply via email to