Joomla-Call Webservice

Hello Friends,

Here is one simple example of how we can use our Joomla application to provide WebService call made by other iPhone application.

Upon accessing the above URL, it will call the method name getLatestNews() from controller file news.php located at path /www/components/com_iphone/controllers/

function getLatestNews()
global $mainframe;

$db = jFactory::getDBO();

$qry=”SELECT * FROM #__news ORDER BY date DESC”;
$db->setQuery( $qry );
$aData = $db->loadObjectList();



$str = “<?xml version=\”1.0\” encoding=\”UTF-8\”?>”;

$str .= “<xml><news>”;

for ($i=0, $n=count( $aData ); $i < $n; $i++)
$row = &$aData[$i];

$str .= “<feed>”;

$str .= “<headline>”.$row->title.”</headline>”;

$str .= “<date>”.$date.”</date>”;

$str .= “<description>”.$row->details.”</description>”;

$str .= “</feed>”;

$str .= “</news></xml>”;

header(“Content-Type: text/xml”);

echo $str;


Look at this URL:

There is complete documentation and ready made code and database structure through which we can send notification on any registered iPhone mobiles using apple’s push notification service called APNS.

The code is available in PHP technology. To setup it we just need to install few tables in Joomla database and based on sample php files they’ve already provided we can create interface in our application from where Admin/User can send any kind of text message/notification to any iPhone users worldwide!


  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: