Yii Framework Forum: Yii Webservice Array Define - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii Webservice Array Define passing array or object in yii web service Rate Topic: -----

#1 User is offline   CPzee 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 59
  • Joined: 11-November 11
  • Location:Sri Lanka

Posted 29 January 2013 - 04:47 AM

Hi,

In a webservice i need to use an array as a input and define the keys of array.I saw from a forum that creating a class for the array elements can do this thing.Like
class WebServiceData
{
	/**
	 * @var string	username of customer
	 * @soap
	 */
	public $username;

	/**
	 * @var integer
	 * @soap
	 */
	public $age;


}

and my server function I defined this as,
/**
 * Add member in to SugarCRM table
 * @param WebServiceData
 * @return object
 * @soap
 */

this works correctly.But my problem is do I need to create each one class, to define many arrays
Also need to know how to define maxOccurs, minOccurs
Found anything useful???? Pls click +
Ubuntu 12.04--PHP 5.3.10(Yii v1.1.13)
0

#2 User is offline   CPzee 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 59
  • Joined: 11-November 11
  • Location:Sri Lanka

Posted 29 January 2013 - 07:02 AM

View PostCPzee, on 29 January 2013 - 04:47 AM, said:

Also need to know how to define maxOccurs, minOccurs


Found ansr for this: Actualy I tried this
class WebServiceData
{
	/**
	 * @var string {minOccurs=0, maxOccurs = 1}
	 * @soap
	 */
	public $username;

	/**
	 * @var string
	 * @soap
	 */
	public $age;

}

This ({minOccurs=0, maxOccurs = 1}) won't work in Yii-1.1.12. It added in Yii-1.1.13. Or if you still need to use Yii-1.1.12 then you can follow this.
Found anything useful???? Pls click +
Ubuntu 12.04--PHP 5.3.10(Yii v1.1.13)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users