Added: synapse/site/3_0_2/userguide/properties.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/properties.html?rev=1909775&view=auto ============================================================================== --- synapse/site/3_0_2/userguide/properties.html (added) +++ synapse/site/3_0_2/userguide/properties.html Fri May 12 16:09:34 2023 @@ -0,0 +1,1392 @@ +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2023-05-04 + | Rendered using Apache Maven Fluido Skin 1.6 +--> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <meta name="Date-Revision-yyyymmdd" content="20230504" /> + <meta http-equiv="Content-Language" content="en" /> + <title>Apache Synapse – Apache Synapse - Properties Catalog</title> + <link rel="stylesheet" href="../css/apache-maven-fluido-1.6.min.css" /> + <link rel="stylesheet" href="../css/site.css" /> + <link rel="stylesheet" href="../css/print.css" media="print" /> + <script type="text/javascript" src="../js/apache-maven-fluido-1.6.min.js"></script> + </head> + <body class="topBarDisabled"> + <div class="container-fluid"> + <div id="banner"> + <div class="pull-left"><div id="bannerLeft"><h2>Apache Synapse</h2> +</div> +</div> + <div class="pull-right"></div> + <div class="clear"><hr/></div> + </div> + + <div id="breadcrumbs"> + <ul class="breadcrumb"> + <li id="publishDate">Last Published: 2023-05-04<span class="divider">|</span> +</li> + <li id="projectVersion">Version: 3.0.2</li> + </ul> + </div> + <div class="row-fluid"> + <div id="leftColumn" class="span2"> + <div class="well sidebar-nav"> +<ul class="nav nav-list"> + <li class="nav-header">Main Menu</li> + <li><a href="../index.html" title="Home"><span class="none"></span>Home</a> </li> + <li><a href="../download.html" title="Download"><span class="none"></span>Download</a> </li> + <li><a href="../history.html" title="History"><span class="none"></span>History</a> </li> + <li><a href="http://www.apache.org/licenses/LICENSE-2.0" class="externalLink" title="License"><span class="none"></span>License</a> </li> + <li><a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"><span class="none"></span>Thanks</a> </li> + <li><a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship"><span class="none"></span>Sponsorship</a> </li> + <li><a href="http://www.apache.org/security/" class="externalLink" title="Security"><span class="none"></span>Security</a> </li> + <li class="nav-header">Documentation</li> + <li><a href="../userguide/installation.html" title="Installation Guide"><span class="none"></span>Installation Guide</a> </li> + <li><a href="../userguide/quick_start.html" title="Quick Start Guide"><span class="none"></span>Quick Start Guide</a> </li> + <li><a href="../userguide/samples/setup/index.html" title="Samples Setup Guide"><span class="none"></span>Samples Setup Guide</a> </li> + <li><a href="../userguide/samples.html" title="Samples Catalog"><span class="none"></span>Samples Catalog</a> </li> + <li><a href="../userguide/config.html" title="Configuration Language"><span class="none"></span>Configuration Language</a> </li> + <li><a href="../userguide/mediators.html" title="Mediators Catalog"><span class="none"></span>Mediators Catalog</a> </li> + <li><a href="../userguide/transports.html" title="Transports Catalog"><span class="none"></span>Transports Catalog</a> </li> + <li class="active"><a href="#"><span class="none"></span>Properties Catalog</a> + </li> + <li><a href="../userguide/xpath.html" title="XPath functions and Variables"><span class="none"></span>XPath functions and Variables</a> </li> + <li><a href="../userguide/extending.html" title="Extending Synapse"><span class="none"></span>Extending Synapse</a> </li> + <li><a href="../userguide/template_library.html" title="Synapse Template Libraries"><span class="none"></span>Synapse Template Libraries</a> </li> + <li><a href="../userguide/upgrading.html" title="Upgrading"><span class="none"></span>Upgrading</a> </li> + <li><a href="../userguide/deployment.html" title="Deployment"><span class="none"></span>Deployment</a> </li> + <li><a href="../apidocs/" title="Javadocs"><span class="none"></span>Javadocs</a> </li> + <li><a href="../userguide/faq.html" title="FAQ"><span class="none"></span>FAQ</a> </li> + <li class="nav-header">Developer Resources</li> + <li><a href="../dev/developer-guide.html" title="Developer Guide"><span class="none"></span>Developer Guide</a> </li> + <li><a href="../dev/best-practices.html" title="Development Best Practices"><span class="none"></span>Development Best Practices</a> </li> + <li><a href="../dev/release-process.html" title="Release Process"><span class="none"></span>Release Process</a> </li> + <li class="nav-header">Project Details</li> + <li><a href="../project-info.html" title="Overview"><span class="none"></span>Overview</a> </li> + <li><a href="../mail-lists.html" title="Mailing Lists"><span class="none"></span>Mailing Lists</a> </li> + <li><a href="../source-repository.html" title="Source Repository"><span class="none"></span>Source Repository</a> </li> + <li><a href="../issue-tracking.html" title="Issue Tracking"><span class="none"></span>Issue Tracking</a> </li> + <li><a href="../dependency-management.html" title="Dependencies"><span class="none"></span>Dependencies</a> </li> + <li><a href="../team-list.html" title="Project Team"><span class="none"></span>Project Team</a> </li> + </ul> + <hr /> + <div id="poweredBy"> + <div class="clear"></div> + <div class="clear"></div> + <div class="clear"></div> + <div class="clear"></div> + <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="../images/logos/maven-feather.png" /></a> + </div> + </div> + </div> + <div id="bodyColumn" class="span10" > + + + <a name="Introduction"></a> +<div class="section" id="Introduction"> +<h2><a name="Properties_Catalog"></a>Properties Catalog</h2> + +<p> + Properties provide the means of accessing various types of information + regarding a message that passes through the ESB. Furthermore, it is also + possible to use properties to control the behavior of the ESB on a given message flow. + </p> + </div> + <a name="Content"></a> +<div class="section" id="Content"> +<h2><a name="Content"></a>Content</h2> + +<ul> + +<li> + <a href="#Introduction">Introduction</a> + </li> + +<li> + <a href="#Contents">Contents</a> + </li> + +<li> + <a href="#Generic_Properties">Generic Properties</a> + +<ul> + +<li> + <a href="#PRESERVE_WS_ADDRESSING">PRESERVE_WS_ADDRESSING</a> + </li> + +<li> + <a href="#RESPONSE">RESPONSE</a> + </li> + +<li> + <a href="#OUT_ONLY">OUT_ONLY</a> + </li> + +<li> + <a href="#ERROR_CODE">ERROR_CODE</a> + </li> + +<li> + <a href="#ERROR_MESSAGE">ERROR_MESSAGE</a> + </li> + +<li> + <a href="#ERROR_DETAIL">ERROR_DETAIL</a> + </li> + +<li> + <a href="#ERROR_EXCEPTION">ERROR_EXCEPTION</a> + </li> + +<li> + <a href="#TRANSPORT_HEADERS">TRANSPORT_HEADERS</a> + </li> + +<li> + <a href="#messageType">messageType</a> + </li> + +<li> + <a href="#ContentType">ContentType</a> + </li> + +<li> + <a href="#preserveProcessedHeaders">preserveProcessedHeaders</a> + </li> + +<li> + <a href="#SERVER_IP">SERVER_IP</a> + </li> + + </ul> + </li> + +<li> + <a href="#HTTP_Transport_Properties">HTTP Transport Properties</a> + +<ul> + +<li> + <a href="#POST_TO_URI">POST_TO_URI</a> + </li> + +<li> + <a href="#FORCE_SC_ACCEPTED">FORCE_SC_ACCEPTED</a> + </li> + +<li> + <a href="#DISABLE_CHUNKING">DISABLE_CHUNKING</a> + </li> + +<li> + <a href="#NO_ENTITY_BODY">NO_ENTITY_BODY</a> + </li> + +<li> + <a href="#FORCE_HTTP_1.0">FORCE_HTTP_1.0</a> + </li> + +<li> + <a href="#HTTP_SC.0">HTTP_SC</a> + </li> + +<li> + <a href="#FAULTS_AS_HTTP_200">FAULTS_AS_HTTP_200</a> + </li> + +<li> + <a href="#NO_KEEPALIVE">NO_KEEPALIVE</a> + </li> + +<li> + <a href="#REST_URL_POSTFIX">REST_URL_POSTFIX</a> + </li> + +<li> + <a href="#REQUEST_HOST_HEADER">REQUEST_HOST_HEADER</a> + </li> + +<li> + <a href="#FORCE_POST_PUT_NOBODY">FORCE_POST_PUT_NOBODY</a> + </li> + +<li> + <a href="#FORCE_HTTP_CONTENT_LENGTH">FORCE_HTTP_CONTENT_LENGTH</a> + </li> + +<li> + <a href="#COPY_CONTENT_LENGTH_FROM_INCOMING">COPY_CONTENT_LENGTH_FROM_INCOMING</a> + </li> + +<li> + <a href="#COPY_CONTENT_LENGTH_FROM_INCOMING">COPY_CONTENT_LENGTH_FROM_INCOMING</a> + </li> + </ul> + </li> + +<li> + <a href="#Synapse_Message_Context_Properties">Synapse Message Context Properties</a> + +<ul> + +<li> + <a href="#SYSTEM_DATE">SYSTEM_DATE</a> + </li> + +<li> + <a href="#SYSTEM_TIME">SYSTEM_TIME</a> + </li> + +<li> + <a href="#MESSAGE_FORMAT">MESSAGE_FORMAT</a> + </li> + +<li> + <a href="#OperationName">OperationName</a> + </li> + </ul> + </li> + </ul> + </div> + <a name="Generic_Properties"></a> +<div class="section" id="Generic_Properties"> +<h2><a name="Generic_Properties"></a>Generic Properties</h2> + +<p>Generic properties allow to configure or change the behavior of the message flow as they are processed by the ESB.</p> + +<p></p> + <a name="PRESERVE_WS_ADDRESSING"></a> +<div class="section" id="PRESERVE_WS_ADDRESSING"> +<h3><a name="PRESERVE_WS_ADDRESSING"></a>PRESERVE_WS_ADDRESSING</h3> + +<p> + By default, the ESB adds a new set of WS-Addressing headers to the messages + forwarded from the ESB. If this property is set to "true" on a message, + the ESB will forward it without altering its existing WS-Addressing headers. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>"true", "false"</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>none</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>synapse</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="PRESERVE_WS_ADDRESSING" value="true"/></div> + </dd> + </dl> + </div> + <a name="RESPONSE"></a> +<div class="section" id="RESPONSE"> +<h3><a name="RESPONSE"></a>RESPONSE</h3> + +<p> + Once this property is set to 'true' on a message, the ESB will + start treating it as a response message. It is generally used to + route a request message back to its source as the response. + However, currently respond mediator perform the same functionality. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>"true", "false"</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>none</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>synapse</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="RESPONSE" value="true"/></div> + </dd> + </dl> + </div> + <a name="OUT_ONLY"></a> +<div class="section" id="OUT_ONLY"> +<h3><a name="OUT_ONLY"></a>OUT_ONLY</h3> + +<p> + Set this property to "true" on a message to indicate that no response + message is expected for it once it is forwarded from the ESB. In other + words, the ESB will do an out-only invocation with such messages. + + It is very important to set this property on messages that are involved + in out-only invocations to prevent the ESB from registering unnecessary + callbacks for response handling and eventually running out of memory. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>"true", "false"</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>none</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>synapse</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="OUT_ONLY" value="true"/></div> + </dd> + </dl> + </div> + <a name="ERROR_CODE"></a> +<div class="section" id="ERROR_CODE"> +<h3><a name="ERROR_CODE"></a>ERROR_CODE</h3> + +<p>Use this property to set a custom error code on a message which can be later + processed by a Synapse fault handler. If the Synapse encounters an error during + mediation or routing, this property will be automatically populated. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>String</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>none</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>synapse</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="error-code" expression="get-property('ERROR_CODE')"/></div> + </dd> + </dl> + </div> + <a name="ERROR_MESSAGE"></a> +<div class="section" id="ERROR_MESSAGE"> +<h3><a name="ERROR_MESSAGE"></a>ERROR_MESSAGE</h3> + +<p> + Use this property to set a custom error message on a message which can be + later processed by a Synapse fault handler. If the Synapse encounters an error + during mediation or routing, this property will be automatically populated. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>String</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>none</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>synapse</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="Cause" expression="get-property('ERROR_MESSAGE')"/></div> + </dd> + </dl> + </div> + <a name="ERROR_DETAIL"></a> +<div class="section" id="ERROR_DETAIL"> +<h3><a name="ERROR_DETAIL"></a>ERROR_DETAIL</h3> + +<p> + Use this property to set the exception stacktrace in case of an error. + If the ESB encounters an error during mediation or routing, this property + will be automatically populated. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>String</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>none</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>synapse</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="Trace" expression="get-property('ERROR_DETAIL')"/></div> + </dd> + </dl> + </div> + <a name="ERROR_EXCEPTION"></a> +<div class="section" id="ERROR_EXCEPTION"> +<h3><a name="ERROR_EXCEPTION"></a>ERROR_EXCEPTION</h3> + +<p> + Contains the actual exception thrown in case of a runtime error. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>String</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>none</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>synapse</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="error-exception" expression="get-property('ERROR_EXCEPTION')"/></div> + </dd> + </dl> + </div> + <a name="TRANSPORT_HEADERS"></a> +<div class="section" id="TRANSPORT_HEADERS"> +<h3><a name="TRANSPORT_HEADERS"></a>TRANSPORT_HEADERS</h3> + +<p>Contains the map of transport headers. Automatically populated. + Individual values of this map can be accessed using the property + mediator in the transport scope. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>java.util.Map</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>Populated with the transport headers of the incoming request.</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>axis2</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="TRANSPORT_HEADERS" action="remove" scope="axis2"/></div> + </dd> + </dl> + </div> + <a name="messageType"></a> +<div class="section" id="messageType"> +<h3><a name="messageType"></a>messageType</h3> + +<p>Message formatter is selected based on this property. + This property should have the content type, such as text/xml, + application/xml, or application/json. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>string</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>Content type of incoming request.</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>axis2</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="messageType" value="text/xml" scope="axis2"/></div> + </dd> + </dl> + </div> + <a name="ContentType"></a> +<div class="section" id="ContentType"> +<h3><a name="ContentType"></a>ContentType</h3> + +<p>This property will be in effect only if the messageType property is set. + If the messageType is set, the value of Content-Type HTTP header of the + outgoing request will be chosen based on this property. Note that this property + is required to be set only if the message formatter seeks it in the + message formatter implementation. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>string</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>Value of the Content-type header of the incoming request.</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>axis2</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="ContentType" value="text/xml" scope="axis2"/></div> + </dd> + </dl> + </div> + <a name="preserveProcessedHeaders"></a> +<div class="section" id="preserveProcessedHeaders"> +<h3><a name="preserveProcessedHeaders"></a>preserveProcessedHeaders</h3> + +<p>By default, Synapse removes the SOAP headers of incoming requests that have been processed. + If we set this property to 'true', Synapse preserves the SOAP headers. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>"true", "false"</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>Preserving SOAP headers</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>synapse</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="preserveProcessedHeaders" value="true" scope="default"/></div> + </dd> + </dl> + </div> + <a name="SERVER_IP"></a> +<div class="section" id="SERVER_IP"> +<h3><a name="SERVER_IP"></a>SERVER_IP</h3> + +<p>Server IP/Host name of hosted server + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>string</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>Set automatically by the mediation engine upon startup with IP address or + hostname of the ESB host + </dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>synapse</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="StringServerIp" expression="get-property('SERVER_IP')" scope="default" type="STRING"/></div> + </dd> + </dl> + </div> + + </div> + <a name="HTTP_Transport_Properties"></a> +<div class="section" id="HTTP_Transport_Properties"> +<h2><a name="HTTP_Transport_Properties"></a>HTTP Transport Properties</h2> + +<p>HTTP transport properties allow to control and configure how the HTTP transport processes the ongoing messages. + </p> + <a name="POST_TO_URI"></a> +<div class="section" id="POST_TO_URI"> +<h3><a name="POST_TO_URI"></a>POST_TO_URI</h3> + +<p>This property makes the outgoing URL of the ESB a complete URL. + This is important when we talk through a Proxy Server. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>"true", "false"</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>false</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>axis2</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="POST_TO_URI" scope="axis2" value="true"/></div> + </dd> + </dl> + </div> + <a name="FORCE_SC_ACCEPTED"></a> +<div class="section" id="FORCE_SC_ACCEPTED"> +<h3><a name="FORCE_SC_ACCEPTED"></a>FORCE_SC_ACCEPTED</h3> + +<p> + When set to true, this property forces a 202 HTTP response to the client so that it stops waiting + for a response. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>"true", "false"</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>false</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>axis2</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="FORCE_SC_ACCEPTED" scope="axis2" value="true"/></div> + </dd> + </dl> + </div> + <a name="DISABLE_CHUNKING"></a> +<div class="section" id="DISABLE_CHUNKING"> +<h3><a name="DISABLE_CHUNKING"></a>DISABLE_CHUNKING</h3> + +<p>Disables the HTTP chunking for outgoing messaging. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>"true", "false"</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>false</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>axis2</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="DISABLE_CHUNKING" scope="axis2" value="true"/></div> + </dd> + </dl> + </div> + <a name="NO_ENTITY_BODY"></a> +<div class="section" id="NO_ENTITY_BODY"> +<h3><a name="NO_ENTITY_BODY"></a>NO_ENTITY_BODY</h3> + +<p>This property should be removed if a user want to generate a + response from the ESB to a request without an entity body, for example, GET request. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>"true", "false"</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>false</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>axis2</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="NO_ENTITY_BODY" scope="axis2" value="true"/></div> + </dd> + </dl> + </div> + <a name="FORCE_HTTP_1.0"></a> +<div class="section" id="FORCE_HTTP_1.0"> +<h3><a name="FORCE_HTTP_1.0"></a>FORCE_HTTP_1.0</h3> + +<p> + Force HTTP 1.0 for outgoing HTTP messages. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>"true", "false"</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>false</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>axis2</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="FORCE_HTTP_1.0" scope="axis2" value="true"/></div> + </dd> + </dl> + </div> + <a name="HTTP_SC"></a> +<div class="section" id="HTTP_SC"> +<h3><a name="HTTP_SC"></a>HTTP_SC</h3> + +<p> + Set the HTTP status code. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>HTTP status code number</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>none</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>axis2</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="HTTP_SC" value="500" scope="axis2"/></div> + </dd> + </dl> + </div> + <a name="FAULTS_AS_HTTP_200"></a> +<div class="section" id="FAULTS_AS_HTTP_200"> +<h3><a name="FAULTS_AS_HTTP_200"></a>FAULTS_AS_HTTP_200</h3> + +<p>Set the HTTP status code. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>"true", "false"</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>false</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>axis2</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="FAULTS_AS_HTTP_200" value="true" scope="axis2"/></div> + </dd> + </dl> + </div> + <a name="NO_KEEPALIVE"></a> +<div class="section" id="NO_KEEPALIVE"> +<h3><a name="NO_KEEPALIVE"></a>NO_KEEPALIVE</h3> + +<p>Disables HTTP keep alive for corresponded connection flow. This Can be use in both inflow and outflow. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>"true", "false"</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>false</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>axis2</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="NO_KEEPALIVE" value="true" scope="axis2"/></div> + </dd> + </dl> + </div> + <a name="REST_URL_POSTFIX"></a> +<div class="section" id="REST_URL_POSTFIX"> +<h3><a name="REST_URL_POSTFIX"></a>REST_URL_POSTFIX</h3> + +<p>The value of this property will be appended to the target URL when sending messages + out in a RESTful manner through an address endpoint. This is useful when you need to + append a context to the target URL in case of RESTful invocations. If you are using an + HTTP endpoint instead of an address endpoint, specify variables in the format of "uri.var.*" + instead of using this property. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>A URL fragment starting with "/"</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>In the case of GET requests through an address endpoint, this contains the query string.</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>axis2</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="REST_URL_POSTFIX" value="/context" scope="axis2"/></div> + </dd> + </dl> + </div> + <a name="REQUEST_HOST_HEADER"></a> +<div class="section" id="REQUEST_HOST_HEADER"> +<h3><a name="REQUEST_HOST_HEADER"></a>REQUEST_HOST_HEADER</h3> + +<p> + The value of this property will be set as the HTTP host header of outgoing request. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>string</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>ESB will set hostname of target endpoint and port as the HTTP host header</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>axis2</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="REQUEST_HOST_HEADER" value="www.wso2.org" scope="axis2"/></div> + </dd> + </dl> + </div> + <a name="FORCE_HTTP_CONTENT_LENGTH"></a> +<div class="section" id="FORCE_HTTP_CONTENT_LENGTH"> +<h3><a name="FORCE_HTTP_CONTENT_LENGTH"></a>FORCE_HTTP_CONTENT_LENGTH</h3> + +<p> + This property allows the content length to be sent when the ESB sends a + request to a back end server. When HTTP 1.1 is used, this property disables + chunking and sends the content length. When HTTP 1.0 is used, the property + only sends the content length. This property should be set in scenarios where + the backend server is not able to accept chunked content. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>"true", "false"</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>false</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>axis2</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="FORCE_HTTP_CONTENT_LENGTH" scope="axis2" value="true"/></div> + </dd> + </dl> + </div> + <a name="COPY_CONTENT_LENGTH_FROM_INCOMING"></a> +<div class="section" id="COPY_CONTENT_LENGTH_FROM_INCOMING"> +<h3><a name="COPY_CONTENT_LENGTH_FROM_INCOMING"></a>COPY_CONTENT_LENGTH_FROM_INCOMING</h3> + +<p> + This property allows the HTTP content length to be copied from an incoming message. + It is only valid when the FORCE_HTTP_CONTENT_LENGTH property is used. + The COPY_CONTENT_LENGTH_FROM_INCOMING avoids buffering the message in memory for calculating + the content length, thus reducing the risk of performance degradation. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>"true", "false"</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>false</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>axis2</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="COPY_CONTENT_LENGTH_FROM_INCOMING" scope="axis2" value="true"/></div> + </dd> + </dl> + </div> + </div> + <a name="Synapse_Message_Context_Properties"></a> +<div class="section" id="Synapse_Message_Context_Properties"> +<h2><a name="Synapse_Message_Context_Properties"></a>Synapse Message Context Properties</h2> + +<p>Synapse Message Context Properties allow to retrieve the data related to synapse + mediation engine information for current message flow.</p> + <a name="SYSTEM_DATE"></a> +<div class="section" id="SYSTEM_DATE"> +<h3><a name="SYSTEM_DATE"></a>SYSTEM_DATE</h3> + +<p> + Returns the current date as a String. Optionally, a date format as per the standard + date format may be supplied. e.g. synapse:get-property("SYSTEM_DATE", "yyyy.MM.dd G 'at' HH:mm:ss + z") + or get-property('SYSTEM_DATE'). + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>string</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>none</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>synapse</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="StringDateVal" expression="get-property('SYSTEM_DATE')" scope="default" type="STRING"/></div> + </dd> + </dl> + </div> + <a name="SYSTEM_TIME"></a> +<div class="section" id="SYSTEM_TIME"> +<h3><a name="SYSTEM_TIME"></a>SYSTEM_TIME</h3> + +<p> + Returns the current time in milliseconds. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>string</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>none</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>synapse</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="StringTimeVal" expression="get-property('SYSTEM_TIME')" scope="default" type="STRING"/></div> + </dd> + </dl> + </div> + <a name="MESSAGE_FORMAT"></a> +<div class="section" id="MESSAGE_FORMAT"> +<h3><a name="MESSAGE_FORMAT"></a>MESSAGE_FORMAT</h3> + +<p>Returns pox, soap11, soap12 depending on the message. + If a message type is unknown this returns soap12. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>string</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>none</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>synapse</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="StringMessageFormat" expression="get-property('MESSAGE_FORMAT')" scope="default" type="STRING"/></div> + </dd> + </dl> + </div> + <a name="OperationName"></a> +<div class="section" id="OperationName"> +<h3><a name="OperationName"></a>OperationName</h3> + +<p> + Returns the operation name corresponding to the message. + </p> + +<dl> + +<dt> + <tt>Possible Values</tt> + </dt> + +<dd>string</dd> + +<dt> + <tt>Default Behavior</tt> + </dt> + +<dd>none</dd> + +<dt> + <tt>Scope</tt> + </dt> + +<dd>synapse</dd> + +<dt> + <tt>Example</tt> + </dt> + +<dd> + +<div class="xmlConf"><property name="StringOperationName" expression="get-property('OperationName')" scope="default" type="STRING"/></div> + </dd> + </dl> + </div> + </div> + + + </div> + </div> + </div> + <hr/> + <footer> + <div class="container-fluid"> + <div class="row-fluid"> + <p>Copyright ©2005–2023 +<a href="http://www.apache.org/">Apache Software Foundation</a>. +All rights reserved.</p> + </div> + </div> + </footer> + </body> +</html>
Added: synapse/site/3_0_2/userguide/quick_start.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/quick_start.html?rev=1909775&view=auto ============================================================================== --- synapse/site/3_0_2/userguide/quick_start.html (added) +++ synapse/site/3_0_2/userguide/quick_start.html Fri May 12 16:09:34 2023 @@ -0,0 +1,550 @@ +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2023-05-04 + | Rendered using Apache Maven Fluido Skin 1.6 +--> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <meta name="Date-Revision-yyyymmdd" content="20230504" /> + <meta http-equiv="Content-Language" content="en" /> + <title>Apache Synapse – Apache Synapse - Quick Start Guide</title> + <link rel="stylesheet" href="../css/apache-maven-fluido-1.6.min.css" /> + <link rel="stylesheet" href="../css/site.css" /> + <link rel="stylesheet" href="../css/print.css" media="print" /> + <script type="text/javascript" src="../js/apache-maven-fluido-1.6.min.js"></script> + </head> + <body class="topBarDisabled"> + <div class="container-fluid"> + <div id="banner"> + <div class="pull-left"><div id="bannerLeft"><h2>Apache Synapse</h2> +</div> +</div> + <div class="pull-right"></div> + <div class="clear"><hr/></div> + </div> + + <div id="breadcrumbs"> + <ul class="breadcrumb"> + <li id="publishDate">Last Published: 2023-05-04<span class="divider">|</span> +</li> + <li id="projectVersion">Version: 3.0.2</li> + </ul> + </div> + <div class="row-fluid"> + <div id="leftColumn" class="span2"> + <div class="well sidebar-nav"> +<ul class="nav nav-list"> + <li class="nav-header">Main Menu</li> + <li><a href="../index.html" title="Home"><span class="none"></span>Home</a> </li> + <li><a href="../download.html" title="Download"><span class="none"></span>Download</a> </li> + <li><a href="../history.html" title="History"><span class="none"></span>History</a> </li> + <li><a href="http://www.apache.org/licenses/LICENSE-2.0" class="externalLink" title="License"><span class="none"></span>License</a> </li> + <li><a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"><span class="none"></span>Thanks</a> </li> + <li><a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship"><span class="none"></span>Sponsorship</a> </li> + <li><a href="http://www.apache.org/security/" class="externalLink" title="Security"><span class="none"></span>Security</a> </li> + <li class="nav-header">Documentation</li> + <li><a href="../userguide/installation.html" title="Installation Guide"><span class="none"></span>Installation Guide</a> </li> + <li class="active"><a href="#"><span class="none"></span>Quick Start Guide</a> + </li> + <li><a href="../userguide/samples/setup/index.html" title="Samples Setup Guide"><span class="none"></span>Samples Setup Guide</a> </li> + <li><a href="../userguide/samples.html" title="Samples Catalog"><span class="none"></span>Samples Catalog</a> </li> + <li><a href="../userguide/config.html" title="Configuration Language"><span class="none"></span>Configuration Language</a> </li> + <li><a href="../userguide/mediators.html" title="Mediators Catalog"><span class="none"></span>Mediators Catalog</a> </li> + <li><a href="../userguide/transports.html" title="Transports Catalog"><span class="none"></span>Transports Catalog</a> </li> + <li><a href="../userguide/properties.html" title="Properties Catalog"><span class="none"></span>Properties Catalog</a> </li> + <li><a href="../userguide/xpath.html" title="XPath functions and Variables"><span class="none"></span>XPath functions and Variables</a> </li> + <li><a href="../userguide/extending.html" title="Extending Synapse"><span class="none"></span>Extending Synapse</a> </li> + <li><a href="../userguide/template_library.html" title="Synapse Template Libraries"><span class="none"></span>Synapse Template Libraries</a> </li> + <li><a href="../userguide/upgrading.html" title="Upgrading"><span class="none"></span>Upgrading</a> </li> + <li><a href="../userguide/deployment.html" title="Deployment"><span class="none"></span>Deployment</a> </li> + <li><a href="../apidocs/" title="Javadocs"><span class="none"></span>Javadocs</a> </li> + <li><a href="../userguide/faq.html" title="FAQ"><span class="none"></span>FAQ</a> </li> + <li class="nav-header">Developer Resources</li> + <li><a href="../dev/developer-guide.html" title="Developer Guide"><span class="none"></span>Developer Guide</a> </li> + <li><a href="../dev/best-practices.html" title="Development Best Practices"><span class="none"></span>Development Best Practices</a> </li> + <li><a href="../dev/release-process.html" title="Release Process"><span class="none"></span>Release Process</a> </li> + <li class="nav-header">Project Details</li> + <li><a href="../project-info.html" title="Overview"><span class="none"></span>Overview</a> </li> + <li><a href="../mail-lists.html" title="Mailing Lists"><span class="none"></span>Mailing Lists</a> </li> + <li><a href="../source-repository.html" title="Source Repository"><span class="none"></span>Source Repository</a> </li> + <li><a href="../issue-tracking.html" title="Issue Tracking"><span class="none"></span>Issue Tracking</a> </li> + <li><a href="../dependency-management.html" title="Dependencies"><span class="none"></span>Dependencies</a> </li> + <li><a href="../team-list.html" title="Project Team"><span class="none"></span>Project Team</a> </li> + </ul> + <hr /> + <div id="poweredBy"> + <div class="clear"></div> + <div class="clear"></div> + <div class="clear"></div> + <div class="clear"></div> + <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="../images/logos/maven-feather.png" /></a> + </div> + </div> + </div> + <div id="bodyColumn" class="span10" > + + + <div class="section"> +<h2><a name="Quick_Start_Guide"></a>Quick Start Guide</h2> + +<p> + Welcome to Apache Synapse quick start guide. This tutorial demonstrates two + sample applications covering the fundamental usage scenarios of Synapse, namely + message mediation and service mediation. It starts from the absolute beginning and + walks you through a series of steps while giving a firm grasp on the Synapse + messaging model. + </p> + </div> + + +<div class="section"> +<h2><a name="Pre-requisites"></a>Pre-requisites</h2> + +<p> + You should have following pre-requisites installed on your system to + follow this tutorial. + </p> + +<ul> + +<li> + A Java runtime - JDK or JRE of version 1.6.0_23 or higher + </li> + +<li> + Apache Ant <a class="externalLink" href="http://ant.apache.org">http://ant.apache.org</a> + </li> + </ul> + </div> + + +<div class="section"> +<h2><a name="Installing_Synapse"></a>Installing Synapse</h2> + +<p> + Let's start by downloading Apache Synapse. Launch a web browser and navigate to + the <a href="../download.html">Synapse Downloads</a> page. Download the binary distribution + of the latest release. Binary distributions are available in standard zip + format and Unix tar ball format. + </p> + +<p> + Once downloaded you can install Synapse by simply extracting the archive to + a suitable location on your local disk. When extracted, a directory named + synapse with the corresponding version number will be created. This directory + houses all the libraries, configuration files, scripts and other artifacts + used by the Synapse runtime. From now on we will refer to this directory as + {SYNAPSE_HOME}. So for an example {SYNAPSE_HOME}/bin refers to the subdirectory + named 'bin' which is generally available in the Synapse installation. + </p> + </div> + + +<div class="section"> +<h2><a name="Running_the_Axis2_Server"></a>Running the Axis2 Server</h2> + +<p> + Samples described in this tutorial involve routing messages to a Web Service + through the Synapse ESB. In real world applications, these Web Services could be + hosted in a web server in your organization, or practically anywhere in the + Internet. In this tutorial we will be using a sample Web Service that ships with + Synapse and we will deploy it in the sample Axis2 server that comes bundled with + Synapse. + </p> + +<p> + To deploy the sample service in the Axis2 server, go to + {SYNAPSE_HOME}/samples/axis2Server/src/SimpleStockQuoteService directory and run + 'ant'. You will see an output similar to the following as the service is built + and deployed to the sample Axis2 server. + </p> + +<div class="consoleOutput">user@domain:/opt/synapse-3.0.1/samples/axis2Server/src/SimpleStockQuoteService$ ant +Buildfile: build.xml + +clean: + +init: +[mkdir] Created dir: /opt/synapse-3.0.1/samples/axis2Server/src/SimpleStockQuoteService/temp +[mkdir] Created dir: /opt/synapse-3.0.1/samples/axis2Server/src/SimpleStockQuoteService/temp/classes +[mkdir] Created dir: /opt/synapse-3.0.1/samples/axis2Server/repository/services + +compile-all: +[javac] Compiling 9 source files to /opt/synapse-3.0.1/samples/axis2Server/src/SimpleStockQuoteService/temp/classes + +build-service: +[mkdir] Created dir: /opt/synapse-3.0.1/samples/axis2Server/src/SimpleStockQuoteService/temp/SimpleStockQuote +[mkdir] Created dir: /opt/synapse-3.0.1/samples/axis2Server/src/SimpleStockQuoteService/temp/SimpleStockQuote/META-INF +[copy] Copying 1 file to /opt/synapse-3.0.1/samples/axis2Server/src/SimpleStockQuoteService/temp/SimpleStockQuote/META-INF +[copy] Copying 9 files to /opt/synapse-3.0.1/samples/axis2Server/src/SimpleStockQuoteService/temp/SimpleStockQuote +[jar] Building jar: /opt/synapse-3.0.1/samples/axis2Server/repository/services/SimpleStockQuoteService.aar + +BUILD SUCCESSFUL +Total time: 1 second</div> + +<p> + Now go to {SYNAPSE_HOME}/samples/axis2Server directory and start the sample server + by executing the following command. + </p> + +<div class="command"> + Linux / Unix: . axis2server.sh<br /> + Windows: axis2server.bat + </div> + +<p> + This will start the Axis2 server on HTTP port 9000. You can see the WSDL of the + sample service by launching your web browser and navigating to the URL + http://localhost:9000/services/SimpleStockQuoteService?wsdl. + </p> + </div> + + +<div class="section"> +<h2><a name="Message_Mediation"></a>Message Mediation</h2> + +<p> + Now we are all set to try our first scenario with Synapse. We will be starting + Synapse using the sample configuration found in synapse_sample_0.xml file which + resides in {SYNAPSE_HOME}/repository/conf/sample directory. This configuration + enables Synapse to log all the messages passing through the service bus: + </p> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + <sequence name="main"> + <log level="full"/> + <send/> + </sequence> +</definitions></div> + +<p> + To start the ESB with the above configuration go the {SYNAPSE_HOME}/bin directory + and execute the following command. + </p> + +<div class="command"> + Linux / Unix: . synapse.sh -sample 0<br /> + Windows: synapse.bat -sample 0 + </div> + +<p> + Following messages will be displayed on the console as Synapse boots up with the + above configuration. + </p> + +<div class="consoleOutput">Starting Synapse/Java ... +Using SYNAPSE_HOME: /opt/synapse-3.0.1 +Using JAVA_HOME: /opt/jdk1.7.0_79 +Using SYNAPSE_XML: /opt/synapse-3.0.1/repository/conf/sample/synapse_sample_0.xml +2016-12-28 10:38:00,456 [-] [main] INFO SynapseServer Starting Apache Synapse... +2016-12-28 10:38:00,476 [-] [main] INFO SynapseControllerFactory Using Synapse home : /opt/synapse-3.0.1 +2016-12-28 10:38:00,476 [-] [main] INFO SynapseControllerFactory Using Axis2 repository : /opt/synapse-3.0.1/repository +2016-12-28 10:38:00,476 [-] [main] INFO SynapseControllerFactory Using axis2.xml location : /opt/synapse-3.0.1/repository/conf/axis2.xml +2016-12-28 10:38:00,476 [-] [main] INFO SynapseControllerFactory Using synapse.xml location : /opt/synapse-3.0.1/repository/conf/sample/synapse_sample_0.xml +2016-12-28 10:38:00,476 [-] [main] INFO SynapseControllerFactory Using server name : localhost +2016-12-28 10:38:00,493 [-] [main] INFO SynapseControllerFactory The timeout handler will run every : 15s +2016-12-28 10:38:00,566 [-] [main] INFO Axis2SynapseController Initializing Synapse at : Wed Dec 28 10:38:00 IST 2016 +2016-12-28 10:38:01,140 [-] [main] INFO PassThroughHttpSSLSender Loading Identity Keystore from : lib/identity.jks +2016-12-28 10:38:01,174 [-] [main] INFO PassThroughHttpSSLSender Loading Trust Keystore from : lib/trust.jks +2016-12-28 10:38:01,242 [-] [main] INFO PassThroughHttpSSLSender Pass-through HTTPS sender started... +2016-12-28 10:38:01,243 [-] [main] INFO PassThroughHttpSender Pass-through HTTP sender started... +2016-12-28 10:38:01,249 [-] [main] INFO JMSSender JMS Sender started +2016-12-28 10:38:01,250 [-] [main] INFO JMSSender JMS Transport Sender initialized... +2016-12-28 10:38:01,251 [-] [main] INFO VFSTransportSender VFS Sender started +2016-12-28 10:38:01,428 [-] [main] INFO PassThroughHttpSSLListener Loading Identity Keystore from : lib/identity.jks +2016-12-28 10:38:01,429 [-] [main] INFO PassThroughHttpSSLListener Loading Trust Keystore from : lib/trust.jks +2016-12-28 10:38:01,443 [-] [main] INFO Axis2SynapseController Loading mediator extensions... +2016-12-28 10:38:01,451 [-] [main] INFO XMLConfigurationBuilder Generating the Synapse configuration model by parsing the XML configuration +2016-12-28 10:38:01,506 [-] [main] INFO SynapseConfigurationBuilder Loaded Synapse configuration from : /opt/synapse-3.0.1/repository/conf/sample/synapse_sample_0.xml +2016-12-28 10:38:01,542 [-] [main] INFO Axis2SynapseController Deploying the Synapse service... +2016-12-28 10:38:01,563 [-] [main] INFO Axis2SynapseController Deploying Proxy services... +2016-12-28 10:38:01,563 [-] [main] INFO Axis2SynapseController Deploying EventSources... +2016-12-28 10:38:01,584 [-] [main] INFO PassThroughHttpSSLListener Starting pass-through HTTPS listener... +2016-12-28 10:38:01,601 [-] [main] INFO PassThroughHttpSSLListener Pass-through HTTPS listener started on port: 8243 +2016-12-28 10:38:01,601 [-] [main] INFO PassThroughHttpListener Starting pass-through HTTP listener... +2016-12-28 10:38:01,603 [-] [main] INFO PassThroughHttpListener Pass-through HTTP listener started on port: 8280 +2016-12-28 10:38:01,603 [-] [main] INFO Axis2SynapseController Management using JMX available via: service:jmx:rmi:///jndi/rmi://localhost:1099/synapse +2016-12-28 10:38:01,606 [-] [main] INFO TimeoutHandler This engine will expire all callbacks after : 180 seconds, irrespective of the timeout action, after the specified or optional timeout +2016-12-28 10:38:01,607 [-] [main] INFO ServerManager Server ready for processing... +2016-12-28 10:38:01,608 [-] [main] INFO SynapseServer Apache Synapse started successfully</div> + +<p> + Note that by default Synapse listens for HTTP requests on port 8280. + </p> + +<div class="section"> +<h3><a name="Executing_the_Sample_Client"></a>Executing the Sample Client</h3> + +<p> + Now we have a Web Service hosted in Axis2 and a Synapse ESB instance which + is configured to log and route messages. All that is left is to send some requests + to Synapse and see the magic happen. Synapse comes bundled with a sample + Web Service client that can be used to send different kinds of requests. Go to + {SYNAPSE_HOME}/samples/axis2Client directory and execute the following command + to send a request to Synapse. + </p> + +<div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280 -Dmode=quote -Dsymbol=IBM</div> + +<p> + You should get the following output on the conosle. + </p> + +<div class="consoleOutput">Buildfile: build.xml + +init: + [mkdir] Created dir: /opt/synapse-3.0.1/samples/axis2Client/target/classes + +compile: + [javac] Compiling 22 source files to /opt/synapse-3.0.1/samples/axis2Client/target/classes + [javac] Note: /opt/synapse-3.0.1/samples/axis2Client/src/samples/userguide/PWCallback.java uses or overrides a deprecated API. + [javac] Note: Recompile with -Xlint:deprecation for details. + [javac] Note: /opt/synapse-3.0.1/samples/axis2Client/src/samples/userguide/LoadbalanceFailoverClient.java uses unchecked or unsafe operations. + [javac] Note: Recompile with -Xlint:unchecked for details. + +stockquote: + [java] 2010-11-26 01:35:16,485 [-] [main] INFO MailTransportSender MAILTO Sender started + [java] 2010-11-26 01:35:16,496 [-] [main] INFO JMSSender JMS Sender started + [java] 2010-11-26 01:35:16,497 [-] [main] INFO JMSSender JMS Transport Sender initialized... + [java] Standard :: Stock price = $99.14593325984416 + +BUILD SUCCESSFUL +Total time: 5 seconds</div> + +<p> + This sends a stock quote request for the symbol 'IBM' with the transport URL set + to http://localhost:8280 (Synapse) and the WS-Addressing EPR set to + http://localhost:9000/services/SimpleStockQuoteService (Axis2). Synapse first + logs the message and then forwards it to the URL given in the WS-Addressing + headers. The actual message sent by the client is as follows. + </p> + +<div class="consoleOutput">POST / HTTP/1.1 +Content-Type: text/xml; charset=UTF-8 +SOAPAction: "urn:getQuote" +User-Agent: Axis2 +Host: 127.0.0.1 +Transfer-Encoding: chunked + +218 +<?xml version='1.0' encoding='UTF-8'?> + <soapenv:Envelope xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> + <soapenv:Header> + <wsa:To>http://localhost:9000/services/SimpleStockQuoteService</wsa:To> + <wsa:MessageID>urn:uuid:D538B21E30B32BB8291177589283717</wsa:MessageID> + <wsa:Action>urn:getQuote</wsa:Action> + </soapenv:Header> + <soapenv:Body> + <m0:getQuote xmlns:m0="http://services.samples"> + <m0:request> + <m0:symbol>IBM</m0:symbol> + </m0:request> + </m0:getQuote> + </soapenv:Body> + </soapenv:Envelope>0</div> + +<p> + Now take a look at the console running Synapse. You will see that all the + details of the mediation are logged along with all the SOAP messages + passed through Synapse. If you execute Synapse in debug mode by editing + the lib/log4j.properties file and setting "log4j.category.org.apache.synapse" + as "DEBUG" instead of INFO, you will see even more information as follows after + a restart and on replay of the above scenario. + </p> + +<div class="consoleOutput">2012-09-18 09:46:57,909 [-] [HttpServerWorker-2] DEBUG SynapseMessageReceiver Synapse received a new message for message mediation... +2012-09-18 09:46:57,909 [-] [HttpServerWorker-2] DEBUG SynapseMessageReceiver Received To: http://localhost:9000/services/SimpleStockQuoteService +2012-09-18 09:46:57,909 [-] [HttpServerWorker-2] DEBUG SynapseMessageReceiver SOAPAction: urn:getQuote +2012-09-18 09:46:57,909 [-] [HttpServerWorker-2] DEBUG SynapseMessageReceiver WSA-Action: urn:getQuote +2012-09-18 09:46:57,909 [-] [HttpServerWorker-2] DEBUG Axis2SynapseEnvironment Injecting MessageContext +2012-09-18 09:46:57,909 [-] [HttpServerWorker-2] DEBUG Axis2SynapseEnvironment Using Main Sequence for injected message +2012-09-18 09:46:57,909 [-] [HttpServerWorker-2] DEBUG SequenceMediator Start : Sequence <main> +2012-09-18 09:46:57,909 [-] [HttpServerWorker-2] DEBUG SequenceMediator Sequence <SequenceMediator> :: mediate() +2012-09-18 09:46:57,909 [-] [HttpServerWorker-2] DEBUG LogMediator Start : Log mediator +2012-09-18 09:46:57,910 [-] [HttpServerWorker-2] INFO LogMediator To: http://localhost:9000/services/SimpleStockQuoteService, WSAction: urn:getQuote, SOAPAction: urn:getQuote, ReplyTo: http://www.w3.org/2005/08/addressing/anonymous, MessageID: urn:uuid:754cc296-ff58-4875-a999-3a33ec94c8a1, Direction: request, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:To>http://localhost:9000/services/SimpleStockQuoteService</wsa:To><wsa:MessageID>urn:uuid:754cc296-ff58-4875-a999-3a33ec94c8a1</wsa:MessageID><wsa:Action>urn:getQuote</wsa:Action></soapenv:Header><soapenv:Body><m0:getQuote xmlns:m0="http://services.samples"><m0:request><m0:symbol>IBM</m0:symbol></m0:request></m0:getQuote></soapenv:Body></soapenv:En velope> +2012-09-18 09:46:57,910 [-] [HttpServerWorker-2] DEBUG LogMediator End : Log mediator +2012-09-18 09:46:57,910 [-] [HttpServerWorker-2] DEBUG SendMediator Start : Send mediator +2012-09-18 09:46:57,910 [-] [HttpServerWorker-2] DEBUG SendMediator Sending request message using implicit message properties.. +Sending To: http://localhost:9000/services/SimpleStockQuoteService +SOAPAction: urn:getQuote +2012-09-18 09:46:57,910 [-] [HttpServerWorker-2] DEBUG Axis2FlexibleMEPClient Sending [add = false] [sec = false] [rm = false] [to=Address: http://localhost:9000/services/SimpleStockQuoteService] +2012-09-18 09:46:57,910 [-] [HttpServerWorker-2] DEBUG Axis2FlexibleMEPClient Message [Original Request Message ID : urn:uuid:754cc296-ff58-4875-a999-3a33ec94c8a1] [New Cloned Request Message ID : urn:uuid:835c68a7-0645-496d-9acc-1d84a03ccb09] +2012-09-18 09:46:57,911 [-] [HttpServerWorker-2] DEBUG SynapseCallbackReceiver Callback added. Total callbacks waiting for : 1 +2012-09-18 09:46:57,912 [-] [HttpServerWorker-2] DEBUG SendMediator End : Send mediator +2012-09-18 09:46:57,912 [-] [HttpServerWorker-2] DEBUG SequenceMediator End : Sequence <main> +2012-09-18 09:46:58,035 [-] [HttpClientWorker-2] DEBUG SynapseCallbackReceiver Callback removed for request message id : urn:uuid:835c68a7-0645-496d-9acc-1d84a03ccb09. Pending callbacks count : 0 +2012-09-18 09:46:58,035 [-] [HttpClientWorker-2] DEBUG SynapseCallbackReceiver Synapse received an asynchronous response message +2012-09-18 09:46:58,035 [-] [HttpClientWorker-2] DEBUG SynapseCallbackReceiver Received To: null +2012-09-18 09:46:58,035 [-] [HttpClientWorker-2] DEBUG SynapseCallbackReceiver SOAPAction: +2012-09-18 09:46:58,035 [-] [HttpClientWorker-2] DEBUG SynapseCallbackReceiver WSA-Action: +2012-09-18 09:46:58,036 [-] [HttpClientWorker-2] DEBUG SynapseCallbackReceiver Body : +<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:getQuoteResponse xmlns:ns="http://services.samples"><ns:return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns:GetQuoteResponse"><ns:change>4.158253518011668</ns:change><ns:earnings>13.000214652478554</ns:earnings><ns:high>176.07121446241788</ns:high><ns:last>171.44223855674258</ns:last><ns:lastTradeTimestamp>Tue Sep 18 09:46:57 CEST 2012</ns:lastTradeTimestamp><ns:low>-169.3791832231285</ns:low><ns:marketCap>3.844340450887613E7</ns:marketCap><ns:name>IBM Company</ns:name><ns:open>-167.9098655007073</ns:open><ns:peRatio>-17.815829214870217</ns:peRatio><ns:percentageChange>-2.4400099237243</ns:percentageChange><ns:prevClose>-170.41 953303471544</ns:prevClose><ns:symbol>IBM</ns:symbol><ns:volume>16090</ns:volume></ns:return></ns:getQuoteResponse></soapenv:Body></soapenv:Envelope> +2012-09-18 09:46:58,036 [-] [HttpClientWorker-2] DEBUG Axis2SynapseEnvironment Injecting MessageContext +2012-09-18 09:46:58,036 [-] [HttpClientWorker-2] DEBUG Axis2SynapseEnvironment Using Main Sequence for injected message +2012-09-18 09:46:58,036 [-] [HttpClientWorker-2] DEBUG SequenceMediator Start : Sequence <main> +2012-09-18 09:46:58,036 [-] [HttpClientWorker-2] DEBUG SequenceMediator Sequence <SequenceMediator> :: mediate() +2012-09-18 09:46:58,036 [-] [HttpClientWorker-2] DEBUG LogMediator Start : Log mediator +2012-09-18 09:46:58,037 [-] [HttpClientWorker-2] INFO LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , ReplyTo: http://www.w3.org/2005/08/addressing/anonymous, MessageID: urn:uuid:835c68a7-0645-496d-9acc-1d84a03ccb09, Direction: response, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:getQuoteResponse xmlns:ns="http://services.samples"><ns:return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns:GetQuoteResponse"><ns:change>4.158253518011668</ns:change><ns:earnings>13.000214652478554</ns:earnings><ns:high>176.07121446241788</ns:high><ns:last>171.44223855674258</ns:last><ns:lastTradeTimestamp>Tue Sep 18 09:46:57 CEST 2012</ns:lastTradeTimestamp><ns:low>-169.3791832231285</ns:low><ns:marketC ap>3.844340450887613E7</ns:marketCap><ns:name>IBM Company</ns:name><ns:open>-167.9098655007073</ns:open><ns:peRatio>-17.815829214870217</ns:peRatio><ns:percentageChange>-2.4400099237243</ns:percentageChange><ns:prevClose>-170.41953303471544</ns:prevClose><ns:symbol>IBM</ns:symbol><ns:volume>16090</ns:volume></ns:return></ns:getQuoteResponse></soapenv:Body></soapenv:Envelope> +2012-09-18 09:46:58,037 [-] [HttpClientWorker-2] DEBUG LogMediator End : Log mediator +2012-09-18 09:46:58,037 [-] [HttpClientWorker-2] DEBUG SendMediator Start : Send mediator +2012-09-18 09:46:58,037 [-] [HttpClientWorker-2] DEBUG SendMediator Sending response message using implicit message properties.. +Sending To: http://www.w3.org/2005/08/addressing/anonymous +SOAPAction: +2012-09-18 09:46:58,038 [-] [HttpClientWorker-2] DEBUG SendMediator End : Send mediator +2012-09-18 09:46:58,038 [-] [HttpClientWorker-2] DEBUG SequenceMediator End : Sequence <main></div> + +<p> + And with that you have successfully completed the first part of this guide. Now let's + look at the next scenario, service mediation with proxy services. + </p> + </div> + </div> + +<div class="section"> +<h2><a name="Service_Mediation_Proxy_Services"></a>Service Mediation (Proxy Services)</h2> + +<p> + As the name implies, a proxy service acts as an intermediary service hosted in + Synapse, and typically fronts an existing service endpoint. A proxy service can be + created and exposed on a different transport, schema, WSDL, or QoS setup (such + as WS-Security, WS-Reliable Messaging) than the real service. Proxy services + are capable of mediating requests before they are delivered to the actual + endpoint. Similarly responses from the actual service can be mediated before + they are sent back to the client. + </p> + +<p> + Clients can send proxy service requests directly to Synapse. From the client's + perspective, proxy services are simply Web Services hosted on Synapse. They can + append the '?wsdl' suffix to the proxy service endpoints to get the WSDLs of these + virtual services. But in the Synapse configuration, service requests can be handled + in anyway you like. Most obvious thing would be to do some processing on the + message and send it to the actual service, which could be running on a different host. + But it is not necessary to always send the messages to an actual service. You may + list any combination of tasks to be performed on the messages received by + the proxy service and terminate the flow or send some response back to the + client even without sending it to any service. + </p> + +<p> + Let's explore a simple proxy services scenario step-by-step to get a better feeling. + As you have downloaded and installed Synapse in the previous section, now you + just run the scenario straightaway. This scenario also requires the same stock + quote service we used in the previous example. So have it deployed in Axis2 and make + sure Axis2 server is up and running. + </p> + +<p> + We are going to start Synapse with a configuration which contains a proxy service. + The configuration in synapse_sample_150.xml file in repository/conf/sample directory + matches well with the scope of this tutorial. + </p> + +<div class="xmlConf"><definitions xmlns="http://synapse.apache.org/ns/2010/04/configuraiton"> + <proxy name="StockQuoteProxy"> + <target> + <endpoint> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> + </endpoint> + <outSequence> + <send/> + </outSequence> + </target> + <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/> + </proxy> +</definitions></div> + +<p> + The above configuration exposes a proxy service named StockQuoteProxy + and specifies an endpoint + (http://localhost:9000/services/SimpleStockQuoteService) as the target for the + proxy service. Therefore, messages coming to the proxy service will be + directed to the address http://localhost:9000/services/SimpleStockQuoteService + specified in the endpoint. There is also an out sequence for the proxy + service, which will be executed for response messages. In the out sequence, + we just send the messages back to the client. The publishWSDL tag + specifies an WSDL to be published for this proxy service. Let's start + Synapse with this sample configuration by running the below command from + the {SYNAPSE_HOME}/bin directory. + </p> + +<div class="command"> + Linux / Unix: . synapse.sh -sample 150<br /> + Windows: synapse.bat -sample 150 + </div> + +<p> + Synapse will display a set of messages as it boots up just like in the previous + section describing the start-up procedure. Before running the client, it + is time to observe another feature of proxy services. That is displaying + the published WSDL. Just open a web browser and point it to the URL + http://localhost:8280/services/StockQuoteProxy?wsdl. You will see the + sample_proxy_1.wsdl specified in the configuration but containing the + correct EPRs for the service over HTTP/S. + </p> + +<div class="section"> +<h3><a name="Executing_the_Sample_Client"></a>Executing the Sample Client</h3> + +<p> + Now we can invoke the proxy service by sending a request from our sample Axis2 + client. Go to the {SYNAPSE_HOME}/samples/axis2Client directory and run the + following command. + </p> + +<div class="command">ant stockquote -Dtrpurl=http://localhost:8280/services/StockQuoteProxy -Dmode=quote -Dsymbol=IBM</div> + +<p> + The above command sends a stock quote request directly to the provided + transport endpoint at http://localhost:8280/services/StockQuoteProxy. The + proxy service will forward the message to the Axis2 server and route the + response from Axis2 back to the client. You will see the response from the + server displayed on the console as follows: + </p> + +<div class="consoleOutput">Standard :: Stock price = $165.32687331383468</div> + </div> + +<div class="section"> +<h3><a name="More_on_Proxy_Services"></a>More on Proxy Services</h3> + +<p> + Proxy services are among the most powerful functional components of Apache + Synapse. They can be used to perform transport switching, message format + switching and lot more. This quick start tutorial only covers the simple + usecases of proxy services. Please refer samples #150 and above in the + Synapse samples catalog, for in depth coverage on more advanced use cases. + </p> + </div> + </div> + +<div class="section"> +<h2><a name="Conclusion"></a>Conclusion</h2> + +<p> + This brings the Synapse quick start guide to an end. Now it is time to go + deeper and discover the advanced features of Synapse. You can browse through + the array of samples for your interested areas. If you have any issue regarding + Synapse as a user, feel free write to the Synapse user mailing list + (<a class="externalLink" href="http://synapse.apache.org/mail-lists.html">http://synapse.apache.org/mail-lists.html</a>). + </p> + </div> + + + </div> + </div> + </div> + <hr/> + <footer> + <div class="container-fluid"> + <div class="row-fluid"> + <p>Copyright ©2005–2023 +<a href="http://www.apache.org/">Apache Software Foundation</a>. +All rights reserved.</p> + </div> + </div> + </footer> + </body> +</html>
