view raw
shredding shredding - 11 months ago 53
PHP Question

What's the syntax for oop nusoap_client call?

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:


require_once "lib/nusoap.php";
require_once 'SampleData.php';

class SoapServer {

protected $server;

public function __construct() {

$this->server = new soap_server();


How do I call this from my SoapClient?

$result = $this->client->call("SampleData.getSampleData", array("category" => "sample"));

Seems not to work.

Ing Ing

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:

$server = new soap_server();

Client call should be like this:

$client = new soapclient('URL');
$result = $client->call("SampleData.getSampleData", array("category" => "sample"));