unexpected behavior for soap server


When implementing a SOAP server, I encountered several weird things. I'm not sure if these are expected/intentional behavior or not.

Relevant portions of the Controller code:

	public function actions()


		return array(

			'ws'=>	array(

				'class'=>		'CWebServiceAction',

				'classMap'=>	array(




				'wsdlUrl'=>		$this->createAbsoluteUrl('wsdl'),




	public function actionWsdl()


		$this->renderFile($this->viewPath . '/FrontEndService.wsdl');


	public function setLocation($positions)


		Yii::log(print_r($positions, true));


		$response->completed = false;


		return $response;


Location code:

	protected function afterConstruct()



		Yii::log('Location constructed');


The request is handled fine, and Location/Point objects get marshaled fine as well. However, two things with this code are behaving differently than I'd expected:

  1. Calling controller/ws returns WSDL generated by reflection. Since I've supplied a WSDL myself through wsdlUrl, I'd expect it to return that WSDL.

  2. The 'afterConstruct' method in Location is not called. This seems to be caused by CActiveRecord being constructed without arguments by the soap server, so the code at line 376 (if($attributes===null) return;) causes it not to execute the rest of the constructor.

I could of course call 'afterConstruct' manually in setLocation for each position, but I was expecting this to happen automatically.

Could you please explain if these two are intentional behavior, bug, or something that's just better done in a different fashion?

Noticed later on that the Location/Point objects created automatically by soapserver failed to save properly. Seems this is a side effect of exiting the CActiveRecord constructor early: "$this->setIsNewRecord(true);" isn't executed either, so at "save()" will try to update instead of insert.