bug: url parsing

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

bug: url parsing

Fabian Panthen
Hello everybody,

we are using wsf/php together with zend which has thrown up the following issue:

zend uses the following url pattern to parametrize front controller requests:


our services are integrated within a controller method which gives a a wsdl url of


but passing that wsdl url to ws2o results in it changing the path to

www.mydomain.tld/path/index.php?wsdl as shown in the logs and a subsequent error.

looks like the parser somehow takes the url apart and then reassembles it with a path whose end is determined by file ending and the query string. is there  a reason the path in that way or could this be considered a bug? 
Bearing in mind the ietf spec (http://www.ietf.org/rfc/rfc1808.txt) does not consider dots in url path definitions and the wide spread adoption of zend framework maybe?

NOTE: we are using 2.0.0 so maybe this behaviour has been already changed in the head revision?

Kind regards,

fabian


_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
Reply | Threaded
Open this post in threaded view
|

Re: bug: url parsing

Dolf Starreveld
Having completed a Zend based project myself I'll tell you this:
1) Zend, as you discovered, modifies some of the PHP global variables, causing WSF/PHP not to see the trailing path component
2) Going through Zend dispatching to reach a web service is a bad idea. The overhead is very large. I've measured it to be at least 100ms larger than without it.

I solved this by not going through index.php for web services. It starts with a tiny modification to a typical .htaccess file (see first line below):
RewriteRule service(/.*) service.php$1 [L]

# Redirect all others to index.php for regular bootstrap
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php


The above now means all web service urls have to start with /service. You can still have some more path components afterwards. Where index.php contains your Zend/PHP bootstrap code, service.php contains something dedicated to Web services only. Typically much, much simpler although you might still be setting up the Zend auto loader etc.
It has some code to expect, after the "/service" component, the name of the service requested, possibly followed by the action. So a full service URL might be something like /service/myservice/myaction. At the end, it invokes the WSF/PHP based web service by calling the service class "run" method.

Just as stated in your mail, WSF/PHP will see /service.php/myservice/myaction. Note that the original trailing part of the path is not "lost", and now WSF/PHP works as you wish.


On May 28, 2010, at 12:25 PM, Fabian Panthen wrote:

Hello everybody,

we are using wsf/php together with zend which has thrown up the following issue:

zend uses the following url pattern to parametrize front controller requests:


our services are integrated within a controller method which gives a a wsdl url of


but passing that wsdl url to ws2o results in it changing the path to

www.mydomain.tld/path/index.php?wsdl as shown in the logs and a subsequent error.

looks like the parser somehow takes the url apart and then reassembles it with a path whose end is determined by file ending and the query string. is there  a reason the path in that way or could this be considered a bug? 
Bearing in mind the ietf spec (http://www.ietf.org/rfc/rfc1808.txt) does not consider dots in url path definitions and the wide spread adoption of zend framework maybe?

NOTE: we are using 2.0.0 so maybe this behaviour has been already changed in the head revision?

Kind regards,

fabian

_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user

Dolf Starreveld                         Starfield Consulting
Principal                               190 Thompson Sq
                                        Mountain View, CA 94043
Alpha paging: [hidden email]    Mobile: (415) 613-7229
[hidden email]         Fax:    (650) 967-2863
http://www.starreveld.com               Office: (650) 966-1404 (9-6 PST only)




_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user