There are few HTTP transport-specific
properties in ESB.
Properties use in ESB access various
types of information regarding a message that passes through the ESB.
Also properties can be used to control the behavior of the ESB on a
given message.
WSO2 ESB support transfer-encoding –
chunked by default. To make it disabled, there is a property that
would help to perform it.
<property name="DISABLE_CHUNKING" value="true" scope="axis2"/>
Transfer-encoding - chunked is a feature came along with HTTP 1.1. Therefore no matter what HTTP 1.0 will support only content type. Therefore if the message is forced to send as HTTP1.0 you will be able to see only the content type. Refer the previous blog post for more reference. Outgoing message can be seen in here.
By the following steps I will be
explaining how to test this behavior if WSO2 ESB.
Download WSO2 ESB,
http://wso2.com/products/enterprise-service-bus
To Setup :
----------------
- Go to <ESB_Home>/samples/axis2Server/src/SimpleStockQuoteService and build it, ant
- Start the Go to <ESB_Home>/samples/axis2Server and start the axis2Server by the following command, sh axis2server.sh.
- Start the ESB Server, <ESB_Home>/bin by providing, sh wso2server.sh.
- Run a tcpMon to view the outgoing messages.
- Start the tcpmon in the <ESB_Home>/bin - sh tcpmon.shCreate 2 listeners as below.1. Listen Port 8281, Target host – localhost, Target port – 8280 – Before hits the ESB2. Listen Port 9001, Target host – localhost, target port – 9000 – After passing through ESB and Before hits the backend
- Log in to the ESB and provide the following synapse configuration.
<?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://ws.apache.org/ns/synapse"> <sequence name="fault"> <log level="full"> <property name="MESSAGE" value="Executing default "fault" sequence"/> <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/> <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/> </log> <drop/> </sequence> <sequence name="main"> <header name="Action" value="urn:getQuote"/> <filter source="get-property('To')" regex=".*/StockQuote.*"> <property name="DISABLE_CHUNKING" value="true" scope="axis2"/> <send> <endpoint> <address uri="http://localhost:9001/services/SimpleStockQuoteService" format="soap11"/> </endpoint> </send> <drop/> </filter> <send/> </sequence> </definitions>
To Send the Rest request :
---------------------------------------------
- Go to axis2Client, <ESB_Home>/samples/axis2Client and send the following REST request.
ant stockquote -Dtrpurl=http://localhost:8281/services/StockQuote -Drest=true
No comments:
Post a Comment