The encoding is done by the URI Template library. There was a similar issue
fixed to decode ':' and '/' in HTTP Endpoint. I think the correct fix is to
use a decoding library that will handle all cases.
Some thing like:
URL url = new URL(URLDecoder.decode(template.expand(),
"UTF-8"));
evaluatedUri = url.toURI().toString();
I've added JIRA at [1] to track this issue.
[1] - https://wso2.org/jira/browse/ESBJAVA-2860
On Tue, Dec 31, 2013 at 9:01 AM, indika prasad <[email protected]> wrote:
> (Reposting)
> Hi,
>
> I am using the following Synapse template to query the LinkedIn APIs
> connections endpoint:
>
> <template name="getConnections" xmlns="http://ws.apache.org/ns/synapse">
> <parameter name="accessToken"
> description="contains the security information for a login
> session and identifies the user, the users groups, and the users
> privileges"
> />
> <parameter name="fields"
> description="fields of the connections that are required to
> be returned" />
>
>
> <sequence>
> <property name="uri.var.fields" expression="$func:fields"
> />
> <property name="uri.var.accessToken"
> expression="$func:accessToken" />
> <call>
> <endpoint>
>
> <http method="get"
> uri-template="
> https://api.linkedin.com/v1/people/~/connections:({uri.var.fields})?oauth2_access_token={uri.var.accessToken}&format=json
> "
> />
> </endpoint>
> </call>
>
> </sequence>
> </template>
>
> Here, the uri.var.fields parameter is supposed to be sent as a comma
> separated list such as first-name,last-name,header.
>
> However, when it is sent as a comma-separated list, the comma seems to get
> URL-encoded, causing the service call to fail.
>
> Wire output when sending the fields first-name,last-name:
>
> DEBUG - wire << "GET
>
> /v1/people/~/connections:(first-name%2Clast-name)?oauth2_access_token=AQWE6N2hAjyHx9LIS6UU_0AktUN9aNN0ZFyIkUNYpSe10Vj559ppL4wur2QBOdCSOLBI3P2MEjHjV-Pz93xrZte3e2XfgrzkB30N5-twK9exifpuucMA5ZgvL7n2bpOx7dFxHfGM2eRfaoao0hKdSW1hnjL7i3GbrCeyrKhUZGECbv7agC4&format=json
> HTTP/1.1[\r][\n]"
>
>
> Is there any way to prevent the comma from getting URL encoded?
>
> Thanks.
>
>
>
> --
> View this message in context:
> http://wso2-oxygen-tank.10903.n7.nabble.com/Property-mediator-being-URL-encoded-on-ESB-tp90214.html
> Sent from the WSO2 Development mailing list archive at Nabble.com.
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
--
*Ravi Undupitiya*
Software Engineer; WSO2 Inc.; http://wso2.com
*E-mail: [email protected] <http://wso2.com>**M: **+94 772 930 712*
Lean . Enterprise . Middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev