Re: [Dev] [DEV] How to get a query parameter in a REst request?

2017-02-19 Thread Ishara Cooray
Thanks Abimaran and Shani.

I got this working by using a resource template as Abimaran said and .
expression="$url:clientId"

Thanks & Regards,
Ishara Cooray
Senior Software Engineer
Mobile : +9477 262 9512
WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware

On Thu, Feb 16, 2017 at 6:12 PM, Shani Ranasinghe  wrote:

> Hi Ishara,
>
> I was able to get it  working as follows.
>
> 
> http://ws.apache.org/ns/synapse; name="admin--WB:v1--In">
>
>   
>  
>
> 
>
> On Thu, Feb 16, 2017 at 5:42 PM, Abimaran Kugathasan 
> wrote:
>
>> Hi Ishara,
>>
>> Have you tried using get-property('query.param.clientId')?
>>
>> You need to define Endpoint like
>>
>> https://localhost:9444//wb/1/countries/us?clientId={query.param.clientId}
>>
>> On Thu, Feb 16, 2017 at 5:19 PM, Ishara Cooray  wrote:
>>
>>> In APIM 2.1.0 i am trying to read a request query parameter .
>>>
>>> i have this request "GET /wb/1/countries/us?clientId=isharac
>>>
>>> in an In sequence i read query parameter as below.
>>> 
>>>
>>> But when i log it 'cid' is null
>>> am i doing anything wrong here?
>>> how can i read the query param in a seq?
>>>
>>> This is the sequence i used.
>>>
>>> 
>>> http://ws.apache.org/ns/synapse;
>>> name="admin--WB:v1--In">
>>>
>>>   
>>>  
>>>
>>> 
>>>
>>>
>>> I also tried, get-property('$uri:clientId') and get-property('$url')
>>> and they are also null.
>>>
>>> When i debug, i couldn't find these properties in message context.
>>>
>>> Alternatively,
>>> following property is there in the message context. So what is the best
>>> way to get clientId from this property? If so is it a good approach?
>>>
>>> REST_FULL_REQUEST_PATH=/ta/1/menu?clientId=isharaccc
>>>
>>>
>>> Thanks & Regards,
>>> Ishara Cooray
>>> Senior Software Engineer
>>> Mobile : +9477 262 9512 <+94%2077%20262%209512>
>>> WSO2, Inc. | http://wso2.com/
>>> Lean . Enterprise . Middleware
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Thanks
>> Abimaran Kugathasan
>> Senior Software Engineer - API Technologies
>>
>> Email : abima...@wso2.com
>> Mobile : +94 773922820 <+94%2077%20392%202820>
>>
>> 
>> 
>>   
>> 
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Thanks and Regards
> *,Shani Ranasinghe*
> Senior Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> mobile: +94 77 2273555 <+94%2077%20227%203555>
> Blog: http://waysandmeans.blogspot.com/
> linked in: lk.linkedin.com/pub/shani-ranasinghe/34/111/ab
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [DEV] How to get a query parameter in a REst request?

2017-02-16 Thread Shani Ranasinghe
Hi Ishara,

I was able to get it  working as follows.


http://ws.apache.org/ns/synapse; name="admin--WB:v1--In">
   
  
 
   


On Thu, Feb 16, 2017 at 5:42 PM, Abimaran Kugathasan 
wrote:

> Hi Ishara,
>
> Have you tried using get-property('query.param.clientId')?
>
> You need to define Endpoint like
>
> https://localhost:9444//wb/1/countries/us?clientId={query.param.clientId}
>
> On Thu, Feb 16, 2017 at 5:19 PM, Ishara Cooray  wrote:
>
>> In APIM 2.1.0 i am trying to read a request query parameter .
>>
>> i have this request "GET /wb/1/countries/us?clientId=isharac
>>
>> in an In sequence i read query parameter as below.
>> 
>>
>> But when i log it 'cid' is null
>> am i doing anything wrong here?
>> how can i read the query param in a seq?
>>
>> This is the sequence i used.
>>
>> 
>> http://ws.apache.org/ns/synapse;
>> name="admin--WB:v1--In">
>>
>>   
>>  
>>
>> 
>>
>>
>> I also tried, get-property('$uri:clientId') and get-property('$url') and
>> they are also null.
>>
>> When i debug, i couldn't find these properties in message context.
>>
>> Alternatively,
>> following property is there in the message context. So what is the best
>> way to get clientId from this property? If so is it a good approach?
>>
>> REST_FULL_REQUEST_PATH=/ta/1/menu?clientId=isharaccc
>>
>>
>> Thanks & Regards,
>> Ishara Cooray
>> Senior Software Engineer
>> Mobile : +9477 262 9512 <+94%2077%20262%209512>
>> WSO2, Inc. | http://wso2.com/
>> Lean . Enterprise . Middleware
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Thanks
> Abimaran Kugathasan
> Senior Software Engineer - API Technologies
>
> Email : abima...@wso2.com
> Mobile : +94 773922820 <+94%2077%20392%202820>
>
> 
> 
>   
> 
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Thanks and Regards
*,Shani Ranasinghe*
Senior Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: +94 77 2273555
Blog: http://waysandmeans.blogspot.com/
linked in: lk.linkedin.com/pub/shani-ranasinghe/34/111/ab
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [DEV] How to get a query parameter in a REst request?

2017-02-16 Thread Abimaran Kugathasan
Hi Ishara,

Have you tried using get-property('query.param.clientId')?

You need to define Endpoint like

https://localhost:9444//wb/1/countries/us?clientId={query.param.clientId}

On Thu, Feb 16, 2017 at 5:19 PM, Ishara Cooray  wrote:

> In APIM 2.1.0 i am trying to read a request query parameter .
>
> i have this request "GET /wb/1/countries/us?clientId=isharac
>
> in an In sequence i read query parameter as below.
> 
>
> But when i log it 'cid' is null
> am i doing anything wrong here?
> how can i read the query param in a seq?
>
> This is the sequence i used.
>
> 
> http://ws.apache.org/ns/synapse; name="admin--WB:v1--In">
>
>   
>  
>
> 
>
>
> I also tried, get-property('$uri:clientId') and get-property('$url') and
> they are also null.
>
> When i debug, i couldn't find these properties in message context.
>
> Alternatively,
> following property is there in the message context. So what is the best
> way to get clientId from this property? If so is it a good approach?
>
> REST_FULL_REQUEST_PATH=/ta/1/menu?clientId=isharaccc
>
>
> Thanks & Regards,
> Ishara Cooray
> Senior Software Engineer
> Mobile : +9477 262 9512 <+94%2077%20262%209512>
> WSO2, Inc. | http://wso2.com/
> Lean . Enterprise . Middleware
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Thanks
Abimaran Kugathasan
Senior Software Engineer - API Technologies

Email : abima...@wso2.com
Mobile : +94 773922820


  
  
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [DEV] How to get a query parameter in a REst request?

2017-02-16 Thread Ishara Cooray
In APIM 2.1.0 i am trying to read a request query parameter .

i have this request "GET /wb/1/countries/us?clientId=isharac

in an In sequence i read query parameter as below.


But when i log it 'cid' is null
am i doing anything wrong here?
how can i read the query param in a seq?

This is the sequence i used.


http://ws.apache.org/ns/synapse; name="admin--WB:v1--In">
   
  
 
   



I also tried, get-property('$uri:clientId') and get-property('$url') and
they are also null.

When i debug, i couldn't find these properties in message context.

Alternatively,
following property is there in the message context. So what is the best way
to get clientId from this property? If so is it a good approach?

REST_FULL_REQUEST_PATH=/ta/1/menu?clientId=isharaccc


Thanks & Regards,
Ishara Cooray
Senior Software Engineer
Mobile : +9477 262 9512
WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev