Webservice, Url Rewrite Problem


i’ve successfully implemented simple webservice, based on this link:


It works fine!

However, i use config/main.php in order to have nice urls:




                        //    'urlSuffix'=>'.html',






And the problem is, that after this “url configuration” my webservice stops working :(

When i use client, like this:

 $client  = new SoapClient('path/contoler/quote', array('trace' => 1));

 echo $client->getPrice('GOOGLE');

it doesn’t work. i’ve got Maximum execution time error.

I’ tried use ‘serviceUrl’=>‘myurl’, but a few possibilities doesn’t make it works.

Can anybody help me a little bit?

Thanks in advance…

Does it work using just path format, but without any of the rules?

it does work with this url: /index.php?r=wstest1/quote

but in other application, when i use url rewriting - it does not - wsdl is ok, but invoking method - not…

Does it work using path format though? In your case, that would be /wstest1/quote

If not, then it would suggest a problem with your .htaccess file, assuming you’re using apache.

Yes, i’m using Apache, and my htaacess:

Options +FollowSymLinks

IndexIgnore */*

RewriteEngine on

# if a directory or a file exists, use it directly

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php

RewriteRule . index.php

I belive that is the case with this line of wsdl:

<soap:address location="server/path/wstest1/quote?ws=1"/>

but what… i dont’t know yet

hi here is my code tested it 100% working with exactly same environment as your’s


Just make sure you have mod_rewrite enabled.


i’ll test your code.

Could You please paste your /config/main.php file (mainly url rewrite part).


// uncomment the following to define a path alias

// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable

// CWebApplication properties can be configured here.

return array(


	'name'=>'My Web Application',

	// preloading 'log' component


	// autoloading model and component classes






		// uncomment the following to enable the Gii tool




			// If removed, Gii defaults to localhost only. Edit carefully to taste.




	// application components



			// enable cookie-based authentication



		// uncomment the following to enable URLs in path-format













			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',


		// uncomment the following to use a MySQL database



			'connectionString' => 'mysql:host=localhost;dbname=test',

			'emulatePrepare' => true,

			'username' => 'root',

			'password' => 'root',

			'charset' => 'utf8',




			// use 'site/error' action to display errors








					'levels'=>'error, warning',


				// uncomment the following to show log messages on web pages









	// application-level parameters that can be accessed

	// using Yii::app()->params['paramName']


		// this is used in contact page