Hi,
I am trying to setup a SOAP server with Zend\Soap\Server and want to
test it with Zend\Soap\Client.
Here is my server class:
----------------------------------------------------------------
namespace Pizza\Soap;
class Server
{
protected $pizzaList = array(
'1' => 'Pizza Salami',
'2' => 'Pizza Hawaii',
'3' => 'Pizza Melone',
);
public function showPizzas()
{
return $this->pizzaList;
}
}
----------------------------------------------------------------
Here is the script that handles the server part:
----------------------------------------------------------------
use Zend\Http\PhpEnvironment\Request;
use Zend\Soap\AutoDiscover;
use Zend\Soap\Server;
$url = $this->serverUrl() . '/listing/listing1403';
$request = new Request();
if ($request->getQuery('wdsl') == 'show') {
$autodiscover = new AutoDiscover();
$autodiscover->setUri($url);
$autodiscover->setClass('Pizza\Soap\Server');
echo $autodiscover->toXml();
} else {
$server = new Server();
$server->setUri($url);
$server->setClass('Pizza\Soap\Server');
echo $server->handle($request);
}
----------------------------------------------------------------
And here is the script that handles the client part:
----------------------------------------------------------------
use Zend\Debug\Debug;
use Zend\Soap\Client;
$url = $this->serverUrl() . '/listing/listing1403?wdsl=show';
$client = new Client($url);
$result = $client->showPizzas();
Debug::dump($result);
Debug::dump($client->getFunctions());
Debug::dump($client->getOptions());
Debug::dump($client->getLastMethod());
----------------------------------------------------------------
The first dump returns NULL while the other three calls return the
expected data. So the server seems to be running. But something is wrong
with the method calls.
Has anyone any idea?
Thanks and best regards,
Ralf
--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]