Creating a SOAP Client to access our Server with is just as simple as creating the Server was. Understand though that the Client does not necessarily need to be a PHP Client. The SOAP Server we just created can be connected to by any type of Client, whether that be Java, C#, C++, etc.
To create the SOAP Client, all we need to do are three things.
First, include the NuSOAP library. This is done just as it was for the Server.
Secondly, we need to instantiate the soapclient class. We pass in the URL of the SOAP Server we are dealing with.
$c = new soapclient('http://localhost/stockserver.php');
Last make a call to the Web Service. The one caveat is that the parameters to the Web Service must be encapsulated in an array in which the keys are the names defined for the service. You will see that I have an array key named 'symbol' because that is the name of the input parameter of my function. If you remember how we specified the input parameters when we registered the function with the server, you will see that this is very similar.