[prev in list] [next in list] [prev in thread] [next in thread] 

List:       esb-java-dev
Subject:    Re: [Dev] [DSS] How to configure resource path with query-params when exposing data services as REST
From:       Madhawa Perera <madhawap () wso2 ! com>
Date:       2016-08-31 9:58:12
Message-ID: CAKVTUt=3ozUkTCzvgPf1s=fQU5U25FXDsZwWM8gYzkYohkZ4sw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Minuri,

Thank you for the explanation. It works fine with DSS-3.5.1 beta.

I think it is better to add this in DSS documentation as well. (May be
under subtopic "Sample data service configuration"[1] or under "Exposing
Data as REST-Style Resources"[2] or wherever it suits in docs)

Currently, the documentation explains only about path-params. I think it is
better if there's at least one endpoint with query-params as well. (I
suppose this can be included in a sample data service which is already
there in DSS, like "ResourcesSample").

[1] https://docs.wso2.com/display/DSS350/Data+Services+and+Resources#
DataServicesandResources-Sampledataserviceconfiguration
[2] https://docs.wso2.com/display/DSS350/Exposing+Data+
as+REST-Style+Resources

Thank you
Best Regards,
Madhawa

On Wed, Aug 31, 2016 at 12:21 PM, Manuri Amaya Perera <manurip@wso2.com>
wrote:

> Hi Madhawa,
>
> You should be able to do this in latest DSS snapshot or you can you
> DSS-3.5.1-beta. You need to have the resource config as below.
>
> <resource method="GET" path="product">
>   <call-query href="getProductByCodeQuery">
>      <with-param name="productCode" query-param="productCode"/>
>   </call-query>
> </resource>
>
> Thanks,
> Manuri
>
> On Tue, Aug 30, 2016 at 2:11 PM, Madhawa Perera <madhawap@wso2.com> wrote:
>
>> Hi DSS team,
>>
>> When exposing data service as a set of REST style resources (in addition
>> to the SOAP services) how do we define the resource path with query params?
>>
>> Example given below
>>
>> *Required style*: http://{ip address:port}/services/samples
>> /ResourcesSample.HTTPEndpoint/product
>> *?productCode=S10_4757&productStatus=new*
>>
>> Documentation explains how to do the configuration to set path params,
>> but what is the procedure when defining a query param as shown in the above
>> example.
>>
>> As per docs, to configure a resource path like;
>>
>> "http://{ip address:port}/services/samples/ResourcesSample.HTTPEndpoint/
>> product/S10_4757"
>>
>> following data service configuration can be used.
>>
>> *Data service configuration*
>>
>> <resource method="GET" path="product/{productCode}">
>>   <call-query href="getProductByCodeQuery">
>>      <with-param name="productCode" query-param="productCode"/>
>>   </call-query>
>> </resource>
>>
>> Can we change the attribute "path", to accept query-params in resource
>> path?
>>
>> Thank you
>> Best Regards,
>> Madhawa
>>
>>
>> --
>> Madhawa Perera
>> *Software Engineer*
>> Mobile : +94 (0) 773655496
>> <%2B94%20%280%29%20773%20451194>
>> madhawap@wso2.com
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "WSO2 Engineering Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to engineering-group+unsubscribe@wso2.com.
>> For more options, visit https://groups.google.com/a/wso2.com/d/optout.
>>
>
>
>
> --
>
> *Manuri Amaya Perera*
>
> *Software Engineer*
>
> *WSO2 Inc.*
>
> *Blog: http://manuriamayaperera.blogspot.com
> <http://manuriamayaperera.blogspot.com>*
>
>
>


-- 
Madhawa Perera
*Software Engineer*
Mobile : +94 (0) 773655496
<%2B94%20%280%29%20773%20451194>
madhawap@wso2.com

[Attachment #5 (text/html)]

<div dir="ltr">Hi Minuri,<div><br></div><div>Thank you for the explanation. It works \
fine with DSS-3.5.1 beta.  </div><div><br></div><div>I think it is better to add this \
in DSS documentation as well. (May be under subtopic &quot;Sample data service \
configuration&quot;[1] or under &quot;Exposing Data as REST-Style Resources&quot;[2] \
or wherever it suits in docs)</div><div><br></div><div>Currently, the documentation \
explains only about path-params. I think it is better if there&#39;s at least one \
endpoint with query-params as well. (I suppose this can be included in a sample data \
service which is already there in DSS, like  \
&quot;ResourcesSample&quot;).</div><div><br></div><div>[1]  <a \
href="https://docs.wso2.com/display/DSS350/Data+Services+and+Resources#DataServicesandResources-Sampledataserviceconfiguration" \
target="_blank">https://docs.wso2.com/<wbr>display/DSS350/Data+Services+<wbr>and+Resou \
rces#<wbr>DataServicesandResources-<wbr>Sampledataserviceconfiguration</a></div><div>[2] \
<a href="https://docs.wso2.com/display/DSS350/Exposing+Data+as+REST-Style+Resources" \
target="_blank">https://docs.wso2.com/<wbr>display/DSS350/Exposing+Data+<wbr>as+REST-Style+Resources</a></div><div><br></div><div>Thank \
you</div><div>Best Regards,<br>Madhawa</div></div><div class="gmail_extra"><br><div \
class="gmail_quote">On Wed, Aug 31, 2016 at 12:21 PM, Manuri Amaya Perera <span \
dir="ltr">&lt;<a href="mailto:manurip@wso2.com" \
target="_blank">manurip@wso2.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">Hi Madhawa,</div><div \
class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div \
class="gmail_default" style="font-family:arial,helvetica,sans-serif">You should be \
able to do this in latest DSS snapshot or you can you DSS-3.5.1-beta. You need to \
have the resource config as below.</div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif"><span class=""><div \
style="font-family:arial,sans-serif;font-size:12.8px">&lt;<span>resource</span>  \
method=&quot;GET&quot;  \
<span>path</span>=&quot;<wbr>product&quot;&gt;</div></span><span class=""><div \
style="font-family:arial,sans-serif;font-size:12.8px">   &lt;call-<span>query</span>  \
href=&quot;<wbr>getProductByCodeQuery&quot;&gt;</div><div \
style="font-family:arial,sans-serif;font-size:12.8px">        &lt;with-param \
name=&quot;productCode&quot;  \
<span>query</span>-<wbr>param=&quot;productCode&quot;/&gt;</div><div \
style="font-family:arial,sans-serif;font-size:12.8px">   \
&lt;/call-<span>query</span>&gt;</div><div \
style="font-family:arial,sans-serif;font-size:12.8px">&lt;/<span>resource</span>&gt;</div><div \
style="font-family:arial,sans-serif;font-size:12.8px"><br></div></span><div \
style="font-family:arial,sans-serif;font-size:12.8px">Thanks,</div><div \
style="font-family:arial,sans-serif;font-size:12.8px">Manuri</div></div><div \
class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Aug 30, \
2016 at 2:11 PM, Madhawa Perera <span dir="ltr">&lt;<a \
href="mailto:madhawap@wso2.com" target="_blank">madhawap@wso2.com</a>&gt;</span> \
wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div \
class="h5"><div dir="ltr">Hi DSS team,<div><br></div><div>When exposing data service \
as a set of REST style resources (in addition to the SOAP services) how do we define \
the resource path with query params?</div><div><br></div><div>Example given \
below</div><div><br></div><div><u>Required style</u>: http://{ip \
address:port}/services/samples<wbr>/ResourcesSample.HTTPEndpoint/<wbr>product<b>?produ \
ctCode=S10_4757&amp;p<wbr>roductStatus=new</b><br></div><div><br></div><div>Documentation \
explains how to do the configuration to set path params, but what is the procedure \
when defining a query param as shown in the above example.  \
</div><div><br></div><div>As per docs, to configure a resource path \
like;<br></div><div><br></div><div>&quot;http://{ip \
address:port}/services/samples<wbr>/ResourcesSample.HTTPEndpoint/<wbr>product/S10_4757&quot;<br></div><div><br></div><div>following \
data service configuration can be used.  </div><div><br></div><div><u>Data service \
configuration</u><br></div><div><u><br></u></div><div><div>&lt;resource \
method=&quot;GET&quot; path=&quot;product/{productCode}&quot;&gt;</div><div>   \
&lt;call-query href=&quot;getProductByCodeQuery&quot;&gt;</div><div>        \
&lt;with-param name=&quot;productCode&quot; \
query-param=&quot;productCode&quot;/&gt;</div><div>   \
&lt;/call-query&gt;</div><div>&lt;/resource&gt;</div></div><div><br></div><div>Can we \
change the attribute &quot;path&quot;, to accept query-params in resource path?  \
</div><div><br></div><div>Thank you  </div><div>Best \
Regards,</div><div>Madhawa</div><span><font color="#888888"><div><br \
clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div \
dir="ltr"><span></span>Madhawa Perera<br><span><font color="#888888"><div><div \
dir="ltr"><span><font color="#888888"></font></span><div><span><font \
color="#888888"><div><b \
style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif">Software \
Engineer</b><br></div><div>Mobile : <a href="tel:%2B94%20%280%29%20773655496" \
value="+94773655496" target="_blank">+94 (0) 773655496</a><a \
href="tel:%2B94%20%280%29%20773%20451194" value="+94773451194" \
target="_blank"><br></a></div><div><span><a href="mailto:madhawap@wso2.com" \
target="_blank">madhawap@wso2.com</a><br></span></div><div><br></div><div><img \
src="http://c.content.wso2.com/signatures/wso2-signature-general.png"><br></div></font></span></div></div></div></font></span></div></div></div></div>
 </div></font></span></div></div></div><span><font color="#888888">

<p></p>

-- <br><span class="">
You received this message because you are subscribed to the Google Groups &quot;WSO2 \
Engineering Group&quot; group.<br> To unsubscribe from this group and stop receiving \
emails from it, send an email to <a \
href="mailto:engineering-group+unsubscribe@wso2.com" \
target="_blank">engineering-group+unsubscribe@<wbr>wso2.com</a>.<br> For more \
options, visit <a href="https://groups.google.com/a/wso2.com/d/optout" \
target="_blank">https://groups.google.com/a/ws<wbr>o2.com/d/optout</a>.<br> \
</span></font></span></blockquote></div><span class="HOEnZb"><font \
color="#888888"><br><br clear="all"><div><br></div>-- <br><div><div \
dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div \
dir="ltr"><div><div dir="ltr"><div><div><i><font color="#6fa8dc">Manuri Amaya \
Perera<br></font></i></div><i><font color="#6fa8dc">Software \
Engineer<br></font></i></div><i><font color="#6fa8dc">WSO2 \
Inc.</font><br></i></div></div><div dir="ltr"><br></div><div><font \
color="#6fa8dc"><i>Blog:  <a href="http://manuriamayaperera.blogspot.com" \
target="_blank">http://<wbr>manuriamayaperera.blogspot.com</a></i></font></div><div><font \
color="#6fa8dc"><br></font></div><div><font color="#6fa8dc"><img \
src="http://c.content.wso2.com/signatures/wso2-signature-general.png"><br></font></div></div></div></div></div></div></div></div></div></div>
 </font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div \
class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div \
dir="ltr"><span></span>Madhawa Perera<br><span><font color="#888888"><div><div \
dir="ltr"><span><font color="#888888"></font></span><div><span><font \
color="#888888"><div><b \
style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif">Software \
Engineer</b><br></div><div>Mobile : +94 (0) 773655496<a \
href="tel:%2B94%20%280%29%20773%20451194" value="+94773451194" \
target="_blank"><br></a></div><div><span><a href="mailto:madhawap@wso2.com" \
target="_blank">madhawap@wso2.com</a><br></span></div><div><br></div><div><img \
src="http://c.content.wso2.com/signatures/wso2-signature-general.png"><br></div></font></span></div></div></div></font></span></div></div></div></div>
 </div>



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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic