I don’t find the syntax for an object oriented nusoap_client call:
What’s the correct syntax if I registered a class method to the server. I know the code for the server but fail to implement the correct client.
I have this server:
<?php
require_once "lib/nusoap.php";
require_once 'SampleData.php';
class SoapServer {
protected $server;
public function __construct() {
$this->server = new soap_server();
$server->register("SampleData.getSampleData");
$server->service($HTTP_RAW_POST_DATA);
}
}
?>
How do I call this from my SoapClient?
$result = $this->client->call("SampleData.getSampleData", array("category" => "sample"));
Seems not to work.
I would avoid using SoapServer as a class name, may conflict with the standard extension (PHP Manual SoapServer).
Why are you wrapping soap_server with SoapServer anyway? Instead try:
Client call should be like this: