Yii Framework Forum: WebServices - returning array - Yii Framework Forum

Jump to content

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

WebServices - returning array Rate Topic: -----

#1 User is offline   jprakash 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 04-May 10

Posted 09 May 2010 - 11:41 PM

Hi All,

I am new to YII framework, have to develop some webservice calls for my latest work.

I have to query a database and return few rows of data by webservice call. I am able to return array as object but I wish to send all the contents of array as <name>value</name>.

Any suggestions or clues of how to develop it is much appreciated.

Here is my soap-server:
/**
* @return array of stock and prices
* @soap
*/
public function getPrices( )
{
$prices=array('IBM'=>100, 'GOOGLE'=>350);
return ($prices);
}

Here is my soap-client, where i consume the webservice:

$client=new SoapClient('http://10.3.0.175/stock/quote');
$rows = $client->getPrices();
foreach($rows as $key_name=>$key_value) {
echo " $key_name is $key_value "."</br>";
}


Thanks,
Jai


0

#2 User is offline   jprakash 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 04-May 10

Posted 11 May 2010 - 07:31 PM

Hi All,

My question above is an Invalid one. Please execuse and some one can you remove this from this post.

Thanks,
Jai
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