Hi,

I'm trying to append a set of query parameters to an endpoint. For this I'm
using the REST_URL_POSTFIX property and setting a value to it.  The value
is successfully appended to the endpoint address when the HTTP method is
GET, however, for POST this does not work. Have I missed any detail?

(Using the ESB sample 1 Synapse config)

Synapse Config
=============
<sequence xmlns="http://ws.apache.org/ns/synapse"; name="main">
   <in>
      <property name="HTTP_METHOD" value="POST" scope="axis2"
type="STRING"></property>
*      <property name="REST_URL_POSTFIX" value="/chamila" scope="axis2"
type="STRING"></property>*
      <filter xmlns:ns="http://org.apache.synapse/xsd";
source="get-property('To')" regex=".*/StockQuote.*">
         <then>
            <send>
               <endpoint>
                  <address uri="
http://localhost:9000/services/SimpleStockQuoteService";></address>
               </endpoint>
            </send>
         </then>
         <else></else>
      </filter>
   </in>
   <out>
      <send></send>
   </out>
</sequence>


Wirelog when HTTP method is *GET*
=============================
[2015-06-08 14:15:54,118] DEBUG - wire >> "POST /services/StockQuote
HTTP/1.1[\r][\n]"
[2015-06-08 14:15:54,119] DEBUG - wire >> "Content-Type: text/xml;
charset=UTF-8[\r][\n]"
[2015-06-08 14:15:54,119] DEBUG - wire >> "SOAPAction:
"urn:getQuote"[\r][\n]"
[2015-06-08 14:15:54,120] DEBUG - wire >> "User-Agent: Axis2[\r][\n]"
[2015-06-08 14:15:54,120] DEBUG - wire >> "Host: localhost:8280[\r][\n]"
[2015-06-08 14:15:54,120] DEBUG - wire >> "Transfer-Encoding:
chunked[\r][\n]"
[2015-06-08 14:15:54,120] DEBUG - wire >> "[\r][\n]"
[2015-06-08 14:15:54,121] DEBUG - wire >> "1d6[\r][\n]"
[2015-06-08 14:15:54,122] DEBUG - wire >> "<?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:MessageID>urn:uuid:5060be98-5fbf-4985-a05b-1e1dd3727d91</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>[\r][\n]"
[2015-06-08 14:15:54,122] DEBUG - wire >> "0[\r][\n]"
[2015-06-08 14:15:54,122] DEBUG - wire >> "[\r][\n]"
*[2015-06-08 14:15:54,129] DEBUG - wire << "GET
/services/SimpleStockQuoteService/chamila HTTP/1.1[\r][\n]"*
[2015-06-08 14:15:54,132] DEBUG - wire << "Content-Type: text/xml;
charset=UTF-8[\r][\n]"
[2015-06-08 14:15:54,132] DEBUG - wire << "SOAPAction:
"urn:getQuote"[\r][\n]"
[2015-06-08 14:15:54,132] DEBUG - wire << "Host: localhost:9000[\r][\n]"
[2015-06-08 14:15:54,133] DEBUG - wire << "Connection: Keep-Alive[\r][\n]"
[2015-06-08 14:15:54,133] DEBUG - wire << "User-Agent:
Synapse-HttpComponents-NIO[\r][\n]"
[2015-06-08 14:15:54,133] DEBUG - wire << "[\r][\n]"




Wirelog when HTTP method is *POST*
==============================
[2015-06-08 14:14:52,682] DEBUG - wire >> "POST /services/StockQuote
HTTP/1.1[\r][\n]"
[2015-06-08 14:14:52,683] DEBUG - wire >> "Content-Type: text/xml;
charset=UTF-8[\r][\n]"
[2015-06-08 14:14:52,683] DEBUG - wire >> "SOAPAction:
"urn:getQuote"[\r][\n]"
[2015-06-08 14:14:52,683] DEBUG - wire >> "User-Agent: Axis2[\r][\n]"
[2015-06-08 14:14:52,683] DEBUG - wire >> "Host: localhost:8280[\r][\n]"
[2015-06-08 14:14:52,683] DEBUG - wire >> "Transfer-Encoding:
chunked[\r][\n]"
[2015-06-08 14:14:52,683] DEBUG - wire >> "[\r][\n]"
[2015-06-08 14:14:52,684] DEBUG - wire >> "1d6[\r][\n]"
[2015-06-08 14:14:52,684] DEBUG - wire >> "<?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:MessageID>urn:uuid:b11ddaf0-12a4-4e0a-bcc0-63ca2db55eec</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>[\r][\n]"
[2015-06-08 14:14:52,684] DEBUG - wire >> "0[\r][\n]"
[2015-06-08 14:14:52,685] DEBUG - wire >> "[\r][\n]"
*[2015-06-08 14:14:52,692] DEBUG - wire << "POST
/services/SimpleStockQuoteService HTTP/1.1[\r][\n]"*
[2015-06-08 14:14:52,695] DEBUG - wire << "Content-Type: text/xml;
charset=UTF-8[\r][\n]"
[2015-06-08 14:14:52,696] DEBUG - wire << "SOAPAction:
"urn:getQuote"[\r][\n]"
[2015-06-08 14:14:52,696] DEBUG - wire << "Transfer-Encoding:
chunked[\r][\n]"
[2015-06-08 14:14:52,696] DEBUG - wire << "Host: localhost:9000[\r][\n]"
[2015-06-08 14:14:52,696] DEBUG - wire << "Connection: Keep-Alive[\r][\n]"
[2015-06-08 14:14:52,697] DEBUG - wire << "User-Agent:
Synapse-HttpComponents-NIO[\r][\n]"
[2015-06-08 14:14:52,697] DEBUG - wire << "[\r][\n]"
[2015-06-08 14:14:52,698] DEBUG - wire << "165[\r][\n]"
[2015-06-08 14:14:52,698] DEBUG - wire << "<?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";></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>[\r][\n]"
[2015-06-08 14:14:52,698] DEBUG - wire << "0[\r][\n]"
[2015-06-08 14:14:52,698] DEBUG - wire << "[\r][\n]"





Regards,
Chamila de Alwis
Committer and PMC Member - Apache Stratos
Software Engineer | WSO2 | +94772207163
Blog: code.chamiladealwis.com
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to