Sample 441: Respond Mediator - Mock a service with a proxy service

<definitions xmlns=""> <proxy name="MockService"> <target> <inSequence> <log level="full"/> <payloadFactory> <format> <m:Sample xmlns:m="http://services.samples"> <m:Response> <m:value>foo</m:value> </m:Response> </m:Sample> </format> <args/> </payloadFactory> <respond/> </inSequence> </target> </proxy> </definitions>


Demonstrate how to create a simple mock service with a proxy service using the respond mediator.


  • Start Synapse using the configuration number 441 (repository/conf/sample/
    Unix/Linux: sh -sample 441
    Windows: synapse.bat -sample 441

Executing the Client

Invoke the MockService proxy service with a payload. Following is how we can use curl as the client

curl -v -X POST -H "Content-type: application/xml" -d '<request>foo</request>' 'http://localhost:8280/services/MockService'

Back to Catalog