note 102041 added to class.soapclient
| From: | jeffmixpute at osu1 dot php dot net | Date: | Mon, 24 Jan 2011 23:15:43 +0000 |
| Subject: | note 102041 added to class.soapclient | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-176265@lists.php.net to get a copy of this message | ||
Simple php client and server:
Client:
<?php
// bind SOAP/Client.php -> path of the php file
require_once "SOAP/Client.php";
// URI delivered to web service
$sc = new SOAP_Client("http://localhost/SOAP/Server.php");
// start call function to use the function of the Web Service
$parameter = array();
$result = $sc->call ("now", &$parameter, "urn:TimeSerivce");
// print result
print $result."\n";
?>
Server:
<?php
// bind PEAR::SOAP
require_once "SOAP/Server.php";
$skiptrace =& PEAR::getStaticProperty('PEAR_Error', 'skiptrace');
$skiptrace = true;
// program service class
class TimeSerivce {
public function now () {
date_default_timezone_set("Europe/Berlin");
return (date ("H:i"));
}
}
// web service classs develop
$service = new TimeSerivce();
// server develop
$ss = new SOAP_SERVER();
// assing the name to the service
$ss->addObjectMap($service, "urn:TimeSerivce");
// Einstellung, dass POST-Daten an den Service weiter gegeben werden
// preferene to forword POST data to the service
$ss->service ($HTTP_RAW_POST_DATA);
?>
----
Server IP: 217.160.235.204
Probable Submitter: 217.88.90.14
----
Manual Page -- http://www.php.net/manual/en/class.soapclient.php
Edit -- https://master.php.net/note/edit/102041
Del: integrated -- https://master.php.net/note/delete/102041/integrated
Del: useless -- https://master.php.net/note/delete/102041/useless
Del: bad code -- https://master.php.net/note/delete/102041/bad+code
Del: spam -- https://master.php.net/note/delete/102041/spam
Del: non-english -- https://master.php.net/note/delete/102041/non-english
Del: in docs -- https://master.php.net/note/delete/102041/in+docs
Del: other reasons-- https://master.php.net/note/delete/102041
Reject -- https://master.php.net/note/reject/102041
Search -- https://master.php.net/manage/user-notes.php