WebService method saves model twice

I have created a function to be called via SOAP, but for some reason it is saving the model twice, even though I’m only saving it once:

The function:





	

	/**

	 * Create a new model via Web Service

	 *

	 * @param string $click_through_url The URL for the Ad Jump

	 * @param string $file_name The name of the Creative file

	 * @param string $size The dimensions of the Creative file

	 * @param string $api_namespace The API namespace for the Ad Jump

	 * @return int ID of the new Ad Jump

	 * @soap

	 */

	public function createJump($click_through_url, $file_name, $size, $api_namespace)

	{

		$model = new Jump;

		

		$model->ad_id = $this->getNextAdId();

		$model->click_through_url = $click_through_url;

		$model->file_name = $file_name;

		$model->size = $size;

		$model->api_namespace = $api_namespace;

		$model->status = 1;

		

		if ($model->save())

		{

			Yii::trace($model->ad_id);

			return $model->ad_id;

		}

		else

			Yii::trace(print_r($model->getErrors(),1));

			return 0;

	}



The call:




$client = new SoapClient('http://www.asdf.com/api');

echo $client->createJump(

	'http://www.someurl.com',

	'my-creative.jpg',

	'300x250',

	'myapikey'

);



It’s all working exactly as expected, except for the model being saved twice (because i get two new records in the DB)… Tearing my hair out!

Thanks for any help…

I have discovered that this is only happening in Google Chrome!

I’ve created a view that calls the web service, and also an external test script. In both cases, if I view the page in Chrome it adds 2 records.

In Firefox or Safari it only adds 1 record…

Looks to me like createJump() is only indeed saving the record once. So I would suspect that createJump() is being called twice. Have you got some trace statements in the methods that call createJump()?