Created
March 17, 2009 16:11
-
-
Save johannilsson/80612 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once "Zend/Loader.php"; | |
Zend_Loader::registerAutoload(); | |
class MyClass { | |
/** | |
* This method takes ... | |
* | |
* @param integer $inputParam | |
* @return string | |
*/ | |
public function method1($inputParam) { | |
return rand(1,10); | |
} | |
} | |
if(isset($_GET['wsdl'])) { | |
$autodiscover = new Zend_Soap_AutoDiscover(); | |
$autodiscover->setBindingStyle( | |
array('style' => 'document', | |
'transport' => 'http://schemas.xmlsoap.org/soap/http') | |
); | |
$autodiscover->setOperationBodyStyle( | |
array('use' => 'literal') | |
); | |
$autodiscover->setClass('MyClass'); | |
$autodiscover->handle(); | |
} else if (isset($_GET['client'])) { | |
$client = new Zend_Soap_Client("http://localhost/soap/?wsdl"); | |
echo $client->method1(10); | |
} else { | |
$soap = new Zend_Soap_Server("http://localhost/soap/?wsdl"); | |
$soap->setClass('MyClass'); | |
$soap->handle(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment