Can you try adding following to the endpoint and check
format=rest
eg:-
<send>
<endpoint>
<address uri="
http://localhost:9000/services/SimpleStockQuoteService" format=rest></
address>
</endpoint>
</send>
On Thu, Jun 11, 2015 at 1:18 AM, Chamila De Alwis <[email protected]> wrote:
> Ping! :)
>
>
> Regards,
> Chamila de Alwis
> Committer and PMC Member - Apache Stratos
> Software Engineer | WSO2 | +94772207163
> Blog: code.chamiladealwis.com
>
>
>
> On Mon, Jun 8, 2015 at 4:14 PM, Chamila De Alwis <[email protected]>
> wrote:
>
>> Update:
>>
>> I created a simple API and used the Call mediator to call the endpoint
>> and appending was successful for both POST and GET. The issue is when this
>> is used in a Proxy definition.
>>
>> API
>> ====
>> <api xmlns="http://ws.apache.org/ns/synapse" name="Test01"
>> context="/test">
>> <resource methods="POST GET" outSequence="main" faultSequence="fault">
>> <inSequence>
>> <property name="REST_URL_POSTFIX" value="chamila" scope="axis2"
>> type="STRING"></property>
>> <log level="full"></log>
>> <call>
>> <endpoint>
>> <address uri="
>> http://localhost:9000/services/SimpleStockQuoteService"></address>
>> </endpoint>
>> </call>
>> </inSequence>
>> </resource>
>> </api>
>>
>>
>>
>> Regards,
>> Chamila de Alwis
>> Committer and PMC Member - Apache Stratos
>> Software Engineer | WSO2 | +94772207163
>> Blog: code.chamiladealwis.com
>>
>>
>>
>> On Mon, Jun 8, 2015 at 2:19 PM, Chamila De Alwis <[email protected]>
>> wrote:
>>
>>> 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
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
--
Best Regards,
Malaka Silva
Senior Tech Lead
M: +94 777 219 791
Tel : 94 11 214 5345
Fax :94 11 2145300
Skype : malaka.sampath.silva
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
Blog : http://mrmalakasilva.blogspot.com/
WSO2, Inc.
lean . enterprise . middleware
http://www.wso2.com/
http://www.wso2.com/about/team/malaka-silva/
<http://wso2.com/about/team/malaka-silva/>
Save a tree -Conserve nature & Save the world for your future. Print this
email only if it is absolutely necessary.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev