All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Correcting endpoint urls

...

Code Block
languagehtml/xml
linenumberstrue
<!-- The example use of content based routing -->
<definitions xmlns="http://ws.apache.org/ns/synapse">
    <!-- The service which the sender will be invoking --> 
    <proxy name="ContentBasedRoutingProxy">
        <target>
           <!-- When a request arrives the following sequence will be followed -->    
           <inSequence>
			 <!-- The content of the incoming message will be isolated -->
             <switch source="//m0:getQuote/m0:request/m0:symbol" xmlns:m0="http://services.samples">
            	    <!-- The isolated content will be filtered --> 
                    <case regex="foo">
               			<!-- Will Route the content to the appropriate destination -->   
						<send>
                    		 <endpoint>
                   				 <address uri="http://localhost:9001/services/SimpleStockQuoteService?wsdl"/>
                     		 </endpoint>
                		</send>
            		</case>
            		<case regex="bar">
                		<send>
                     		<endpoint>
                    			<address uri="http://localhost:9002/services/SimpleStockQuoteService?wsdl"/>
                     		</endpoint>
                		</send>
            		</case>
            		<default>
               		 <!-- it is possible to assign the result of an XPath expression as well -->
                	<property name="symbol" expression="fn:concat('Normal Stock - ', //m0:getQuote/m0:request/m0:symbol)" xmlns:m0="http://services.samples"/>
            		</default>
            </switch>       
            </inSequence>
            <outSequence>
                <send/>
            </outSequence>
        </target>      
    </proxy>
</definitions> 

...