Dear Wiki user, You have subscribed to a wiki page or wiki category on "Ws Wiki" for change notification.
The following page has been changed by PaulFremantle: http://wiki.apache.org/ws/Synapse/UserGuide ------------------------------------------------------------------------------ * Fault management, tracing * Transformation, XSLT + == Getting started == Although there is a cleanly defined division between Synapse and Axis2, the Synapse system relies on Axis2 to run. Firstly, it uses the AXIOM object model, and secondly it uses Axis2 as a listener and sender for Web service requests. There are two ways to set up the Synapse server. 1. ''synapse.war'' which can be deployed in a servlet container. + 1. A lightweight server which runs with its own HTTP server (it uses Axis2âs SimpleHTTPServer which is a simple lightweight HTTP server option that does not require a Servlet Engine). The distribution is [http://www.apache.org/dist/ws/synapse/M1/ here]. You can either download these or build them using Maven. Please note we use Maven 1.02 at the moment. - You can build the war file by using the command: + You can build the binary distribution code by using the command: {{{ maven dist-bin }}} @@ -29, +31 @@ If you wish to use the standalone server, unzip the Synapse-Incubating-M1-bin.zip. In the bin directory you will find a script called: + {{{ synapse [.sh or .bat] }}} + You should also see a directory called {{{synapse_repository}}}. In there you should find the axis2.xml and synapse.xml config files. The axis2.xml should not need to be modified, but if you know what you are doing you can of course! @@ -45, +49 @@ bin\synapse synapse_repository -p8080 [Win] + You should also see a directory called {{{synapse_repository}}}. In there you should find the axis2.xml and synapse.xml config files. The axis2.xml should not need to be modified, but if you know what you are doing you can of course! + + The command line for synapse takes (optionally) the repository directory and listening port. For the base examples you shouldn't need those parameters. + + {{{ + sh bin/synapse.sh + + bin\synapse + + sh bin/synapse.sh synapse_repository -p8080 [Linux] + + bin\synapse synapse_repository -p8080 [Win] + }}} The default ''bin\synapse'' should work fine. + + The default ''bin\synapse'' should work fine. == Deployment models == Synapse can intermediate in a number of different models: @@ -60, +79 @@ - Synapse can work with both WS-A and non-WS-A SOAP messages in this model. - * Gateway mode + * Gateway mode - In this mode, the client explicitly sends a message to Synapse (with or without WS-A headers) @@ -69, +88 @@ * Smart client mode - In this mode, the client sends the message to Synapse but sets the WSA headers to the ultimate destination + + == Stockquote samples == + + To see these models you can try the examples. There are three sample clients that each use one of the methods. Switch to the '''synapse\samples''' directory and type {{{ant}}}. This will show the help on how to run these. + == Processing model == @@ -374, +398 @@ }}} The logging uses the Log4J/Commons Logging support in Apache. You can configure it using {{{log4j.properties}}}. - The sample client is a standard Axis2 client built to run against the XMethods Quote Service. However, it has been modified to use a different transport address from the Web Services Addressing TO header. In other words, the SOAP envelope is addressed to the XMethods service, but the actual HTTP request goes to Synapse. + The sample client is a standard Axis2 client built to run against the XMethods Quote Service. However, it has been modified to use a different transport address from the Web Services Addressing TO header. In other words, the SOAP envelope is addressed to the stockquote service, but the actual HTTP request goes to Synapse. The sample client has three (optional) parameters: {{{ - StockQuoteClient SYMBOL XmethodsURL TransportURL + StockQuoteClient SYMBOL URL TransportURL }}} e.g. {{{ - StockQuoteClient IBM http://64.124.140.30:9090/soap http://localhost:8080 + StockQuoteClient IBM http://www.webservicex.net/stockquote.asmx http://localhost:8080 }}} The sample synapse.xml can be used to demonstrate a few simple behaviours. 1) Firstly try this: {{{ - StockQuoteClient IBM http://64.124.140.30:9090/soap http://64.124.140.30:9090/soap + java StockQuoteClient IBM http://www.webservicex.net/stockquote.asmx http://www.webservicex.net/stockquote.asmx }}} - This will bypass Synapse and simply call XMethods. + This will bypass Synapse and simply call the real endpoint. 2) Now start Synapse on port 8080 and try {{{ @@ -399, +423 @@ 3) This time try {{{ - StockQuoteClient IBM urn:xmethods-delayed-quotes + StockQuoteClient IBM http://stockquote }}} This should hit a regex rule which replaces the âvirtual URIâ that is in the wsa:To header with the real URL.
