Passing parameters to SOAP client

I’m very new to PHP, SOAP, and development in general, but I’m building a small piece of software out of necessity that can query several SOAP servers. I think I generally understand the concepts (broadly speaking) of making SOAP requests, creating SoapClient objects, etc. However, I’m having trouble conceptually with passing parameters to the function identified in the WSDL file. I’ve seen several examples that use associative arrays, but I don’t know how to apply this to the structure of MY WSDL file.

Here’s a “template” WSDL file that I’ve been using. It’s not actually a SOAP server and so doesn’t have an endpoint specified.

http://www.niso.org/schemas/sushi/counter_sushi3_0.wsdl

I need to use the GetReport function. I’ve used the getTypes function to return an array of what I’m assuming are the parameters that I can use, however, this is as far as I can get. I have a working SOAP sever (tested with soapUI), so I know that’s not the problem.

Basically, I can’t figure out how to make the XML say what I want it to say–which seems like a pretty basic thing to not understand. However, I can’t seem to find any documentation explaining this seemingly basic concept, php.net included.

thanks,
JACK

Perhaps some specifics would help:

Using the __getTypes function, I printed out the parameter types that I can (presumably) alter/send, an example:

[php]21 => struct Requestor { string ID; string Name; string Email; }
22 => struct ReportDefinition { Filters Filters; string Name; string Release; }
23 => struct Filters { Range UsageDateRange; }
24 => struct Range { date Begin; date End; }
25 => struct CustomerReference { string ID; string Name; }[/php]

Am I to assume that these can be passed to the soap client function (GetReport()) as an array? e.g. for requestor:

[php]$requestor = array (‘Requestor’ => array (‘ID’ => ‘myID’, ‘Name’ => ‘myName’, ‘Email’ => ‘myEmail’));
$client = SoapClient(‘WSDL’);
$response = $client->GetReport($requestor);
[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service