Thursday, July 24, 2008
Home | Benchmarks | Documentation | Samples | FAQ | Links | Download
search php-soap for  


Samples

3. Objects

 

Description:

 
  This example shows how to make an Object be used as a SoapObject.

 
 

Client:  object-client.php

 
 

<?
$myObject
= new SoapObject("http://www.yourserver.com/object.php", "urn:Object");
echo
$myObject->getData();
?>
1


 
 

Server:  object-server.php

 
 

<?
$server
= new SoapServer("urn:Object");
$server->setClass('myObject');
$server->handle();

class
myObject
{
    function
myObject()
    {
        
$this->data = "hello from myObject";
    }
    
    function
getData()
    {
        return
$this->data;
    }
}
?>
1


 
blue | green | yellow | grey
SourceForge Logo
Go to the main PHP site