I'll start out by saying I have no idea what so ever about what I am trying to do. My PHP skills is -beginner- and my experience with webservices is NULL.
I have a WSDL URL http://example.com/ws/3.1/NNE?WSDL. I would like to call the searchTargetGroup method from a PHP script, so I can loop through the answer and save the data to my database.
Anywho, I have no idea how to create the call from PHP. :-(
I've looked at NuSOAP for PHP and also the built in SoapClient, but without luck. I think the problem is that I'm trying to call a complex method without fully understanding what the frog I'm messing around with.
So I used SoapUI to retrieve the definition file and creating a request, which works perfectly and I'm getting all the info I want. Problem is, I have no clue how I should make a PHP file creating exact same request as SoapUI (and thereby getting the correct answer).
The XML request SoapUI generates for me looks like this:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:nne="http://example.com/ws/NNE">
<QuestionTargetGroup_1 xsi:type="nne:QuestionTargetGroup" xmlns:nne="http://example.com/ws/NNE">
First of all I am a beginner here myself, so I cannot guarantee a fully correct answer but I can give you at least some hints.
Use SoapClient instead of NuSoap. SoapClient is written in C, NuSoap in PHP, so SoapClient is faster.
If your WSDL file is fine, then all that you have to do should be:
$client = new SoapClient("[URL to wsdl]");
After that SoapClient will take care of the rest and makes all procedures defined in the WSDL directly available.
$result = $client->name_of_procedure($arg1, $arg2, ...);
The result will be of type stdClass or an array with elements of type stdClass.
Without a WSDL you would have to specify all the details yourself, type of parameters, namespaces, ... and to invoke via __soapCall() directly.
Either way you can inspect the structure of $result with var_dump() & Co.