Hi
 Can you try following  then use call mediator as above, no need to use
javascript for encoding purpose.
 <property name="apiUrl" expression="fn:base64Encode($func:publicUrl)" />
 <property name="uri.var.publicUrl" expression="$ctx:apiUrl:" />



On Thu, Feb 13, 2014 at 6:34 PM, Jay <[email protected]> wrote:

> Hi,
>
> I need to pass an Url encoded value
> (Ex:http://www.linkedin.com/pub/XXXX-XXXX/87/998/935) to an endpoint as a
> part of the Url.
>
> I am using following synapse template;
>
> <template name="getProfile" xmlns="http://ws.apache.org/ns/synapse";>
>          <property name="uri.var.accessToken"
> expression="$func:accessToken"
> />
>          <property name="uri.var.apiUrl" expression="$func:apiUrl" />
>         <parameter name="publicUrl" description="public url of the
> requested
> profile" />
>
>         <sequence>
>
>                 <property name="uri.var.publicUrl"
> expression="$func:publicUrl" />
>
>
>                                                         <call>
>                                                                 <endpoint>
>
> <http method="get"
>
>
> uri-template="{uri.var.apiUrl}/v1/people/url={uri.var.publicUrl}?oauth2_access_token={uri.var.accessToken}&amp;format=json"
> />
>
> </endpoint>
>                                                         </call>
>
>
>         </sequence>
> </template>
>
> encoded url should be assigned to "uri.var.publicUrl".
>
> My problem is after encoding Url using script mediator, in call mediator
> Url
> is encoding again.
>
> Following is my script mediator;
>
>
> This is the result after calling script mediator:
> "http%3a%2f%2fwww.linkedin.com%2fpub%2fXXXX-XXXX%2f87%2f998%2f935"
> When calling End point "%" characters in above url is encode again and
> result is
> "http%253a%252f%252fwww.linkedin.com
> %252fpub%252fXXXX-XXXX%252f87%252f998%252f935%253"
>
>
> Is there any way to prevent encode url in end point? Or any way to encode
> url in call mediator itself?
>
>
> Thanks.
>
>
>
> --
> View this message in context:
> http://wso2-oxygen-tank.10903.n7.nabble.com/Encode-Url-in-ESB-tp92179.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
>



-- 
Dushan Abeyruwan | Associate Tech Lead
Integration Technologies Team
PMC Member Apache Synpase
WSO2 Inc. http://wso2.com/
Blog:http://dushansview.blogspot.com/
Mobile:(0094)713942042
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to