After going through the source code, I found this comment in the
Axis2FlexibleMEPClient.Java file.

            // HTTP Endpoint : use the specified HTTP method and remove
REST_URL_POSTFIX, it's not supported in HTTP Endpoint
            if (endpoint.isHTTPEndpoint()) {

axisOutMsgCtx.setProperty(Constants.Configuration.HTTP_METHOD,
synapseOutMessageContext.getProperty(Constants.Configuration.HTTP_METHOD));

axisOutMsgCtx.removeProperty(NhttpConstants.REST_URL_POSTFIX);
            }

Which means we are not supporting REST_URL_POSTFIX for http-endpoints.


Is there any workaround that we can achieve this?


On Fri, Jan 17, 2014 at 2:15 PM, Chanaka Fernando <[email protected]> wrote:

> Hi,
>
> I am trying to send some query parameters with http endpoint which is
> defined as below.
>
> <api xmlns="http://ws.apache.org/ns/synapse"; name="SampleAPI"
> context="/sample">
>    <resource methods="GET">
>       <inSequence>
>          <property name="uri.var.version"
> expression="get-property('transport','Version')" scope="default"
> type="STRING"></property>
>          <send>
>             <endpoint>
>                <http method="get" uri-template="
> http://localhost:8280/TestAPI/{uri.var.version}";></http>
>             </endpoint>
>          </send>
>       </inSequence>
>    </resource>
> </api>
>
>
> In the above REST API, I am getting the "version" information from the
> header and recreate the URL with uri-template and send the request to the
> appropriate URL. When I am calling this endpoint, I need to send some query
> parameters to the actual REST endpoint. I am calling this REST API as below.
>
> Ex: http://localhost:8280/sample?a=2&b=3
>
> I need this should be translated in to the below URL from my REST API.
>
> http://localhost:8280/TestAPI/2.0.0?a=2&b=3
>
>
> But the issue is, the query parameters are not getting passed in to the
> backend REST endpoint.
>
> Is this a limitation in the uri-template support in the WSO2 ESB or how
> can I achieve this?
>
>
> Thanks,
> Chanaka
>
> --
> --
> Chanaka Fernando
> Technical Lead
> WSO2, Inc.; http://wso2.com
> lean.enterprise.middleware
>
> mobile: +94 773337238
> Blog : http://soatutorials.blogspot.com
> LinkedIn:http://www.linkedin.com/pub/chanaka-fernando/19/a20/5b0
> Twitter:https://twitter.com/chanakaudaya
> Wordpress:http://chanakaudaya.wordpress.com
>
>
>
>


-- 
--
Chanaka Fernando
Technical Lead
WSO2, Inc.; http://wso2.com
lean.enterprise.middleware

mobile: +94 773337238
Blog : http://soatutorials.blogspot.com
LinkedIn:http://www.linkedin.com/pub/chanaka-fernando/19/a20/5b0
Twitter:https://twitter.com/chanakaudaya
Wordpress:http://chanakaudaya.wordpress.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to