[wsf-c-dev] [wsf-php] How to handle a rest get with a php service

Sanjiva Weerawarana sanjiva at wso2.com
Sat Mar 3 17:49:53 PST 2007


I think its critical to support service/method?arguments. Otherwise the 
API is not RESTful because the URI base is not identifying the actual 
operation to execute.

Nandika, can you explain why its a problem to support this in PHP? If the 
PHP file is the service then all that's needed is for that php file to do 
the next step dispatching itself AFAICT.

Sanjiva.

Nabeel Yoosuf wrote:
> I am not an expert in REST, but I want to point out an example. Using 
> Yahoo API, we can make a REST search for the word "permission" as 
> follows (Reference [1]).
> 
> http://api.search.yahoo.com/WebSearchService/V1/webSearch?appid=YahooDemo&query=persimmon&results=10 
> <http://api.search.yahoo.com/WebSearchService/V1/webSearch?appid=YahooDemo&query=persimmon&results=10>
> 
> (their convension is serviceName/version/methodname?arguments)
> 
> I think Yahoo API's are based on PHP. We may be able to support the same 
> convention in Axis2 (similar to what Yahoo uses): 
> serviceName/methodName?arguments.
> 
> Nabeel.
> [1] http://developer.yahoo.com/php/
> 
> 
> On 3/2/07, *Eran Chinthaka* < chinthaka at wso2.com 
> <mailto:chinthaka at wso2.com>> wrote:
> 
>     -----BEGIN PGP SIGNED MESSAGE-----
>     Hash: SHA1
> 
>     Hi Nandika,
> 
>     Operation name being a part of the path name is Axis2/Java convention
>     only. There is no requirement for you to follow the same thing. I think
>     the best option is to append the operationName also in to the query
>     part, but it should be automatic. Meaning, user should not be worried
>     about appending that part.
>     And in the server side you can rip it accordingly.
> 
>     - -- Chinthaka
> 
>     nandika wrote:
>      > Hi all,
>      >
>      > Currently Axis2c handles rest style invocations with GET as follows.
>      >
>      > The request URL for the REST GET would be as
>      > " http://host:port/axis2/services/service_name/operation name ?
>     arguments"
>      >
>      > But in case of  a php service , the .php file will be the service and
>      > after that we will have the "?"
>      > So we need to come up with a convention on how to pass the operation
>      > name along with parameters after "?".
>      >
>      > Any Ideas will be greatly appreciated.
>      >
>      > --Nandika
>      >
>      >
>      > _______________________________________________
>      > Wsf-c-dev mailing list
>      > Wsf-c-dev at wso2.org <mailto:Wsf-c-dev at wso2.org>
>      > http://wso2.org/cgi-bin/mailman/listinfo/wsf-c-dev
>      >
> 
>     -----BEGIN PGP SIGNATURE-----
>     Version: GnuPG v1.4.3 (GNU/Linux)
>     Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>     <http://enigmail.mozdev.org>
> 
>     iD8DBQFF6N6GjON2uBzUhh8RAncoAKCpPssS4aBnt7ytmuFYtfIMeODFjQCgrXRN
>     h62OiqFqOX+d1GbSfuBiMvM=
>     =+esA
>     -----END PGP SIGNATURE-----
> 
>     _______________________________________________
>     Wsf-c-dev mailing list
>     Wsf-c-dev at wso2.org <mailto:Wsf-c-dev at wso2.org>
>     http://wso2.org/cgi-bin/mailman/listinfo/wsf-c-dev
> 
> 
> 
> 
> -- 
> http://www.cs.purdue.edu
> http://mohamednabeel.blogspot.com
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Wsf-c-dev mailing list
> Wsf-c-dev at wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/wsf-c-dev

-- 
Sanjiva Weerawarana, Ph.D.
Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
email: sanjiva at wso2.com; cell: +94 77 787 6880; fax: +1 509 691 2000

"Oxygenating the Web Service Platform."




More information about the Wsf-c-dev mailing list