Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johannilsson/80612 to your computer and use it in GitHub Desktop.
Save johannilsson/80612 to your computer and use it in GitHub Desktop.
<?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