Step.1 - First Download nusoap.zip then file paste inside the xmpp->htdoc->project folder.

Step.2 - Create a file soap_page.php.







require_once('lib/nusoap.php'); $server = new nusoap_server; //$server ->configureWSDL('server', 'urn:server'); //$server ->wsdl->schemaTargetNamespace = 'urn:server'; //$server ->register('pollServer', array('value' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:server', 'urn:server#pollServer'); //register a function that works on server $server->register('getInfo'); // create age calculation function function find_age($birthday) { list($byear, $bmonth, $bday) = explode('-', $birthday); list($cyear, $cmonth, $cday) = explode('-', date('Y-m-d')); $cday -= $bday; $cmonth -= $bmonth; $cyear -= $byear; if($cday < 0) $cmonth--; if($cmonth < 0) $cyear--; return $cyear; } // create the function function getInfo($name, $birthday) { $result['status'] = true; if(!$name){ return new soap_fault('Client','','softwarequery!'); } // Return if you would like to check server response else delete this line. return $result = array('name'=> $name,'age'=> find_age($birthday) ); $conn = mysql_connect('localhost','root',''); mysql_select_db('webservice', $conn); $sql = "SELECT * FROM books"; $q = mysql_query($sql); $result = array(); while($row = mysql_fetch_array($q)) { $result[] = array( 'cd'=>$row['cd'], 'title'=>$row['title'], 'author'=>$row['author'], 'publisher'=>$row['publisher'] ); } return $result; } $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : ''; $server ->service($HTTP_RAW_POST_DATA); exit();