Re: SOAP method - structured parameters problem
| From: | Yannick Warnier | Date: | Tue, 07 Dec 2004 12:41:33 +0000 |
| Subject: | Re: SOAP method - structured parameters problem | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-16083@lists.php.net to get a copy of this message | ||
Hi,
This is an answer to my previous post. Sorry if I broke the thread but
it seems I have a problem registering to the list.
Anyway, as I was mentionning before without really knowing what it was
all about (now I got into the code four three hours so I know better), I
had a problem with parameters sent via the
$soap_client->mymethod($params) call.
My soap_client object was generated by a getProxy call on a WSDL object.
Now I don't know exactly why, but when the getProxy generates the class
for my method (being CreateParticipant, defined in the WSDL file), it
gives this:
$CreateParticipant =&
new SOAP_Value('{http://questionmark.com/QMWISe/}CreateParticipant',
false,$v=array('parameters'=>$parameters);
$result = $this->call("CreateParticipant",
$v = array('CreateParticipant'=>$CreateParticipant),
array('namespace'=>'http://questionmark.com/QMWISe/',
'soapaction'=>'http://questionmark.com/QMWISe/CreateParticipant',
'style'=>'document',
'use'=>'literal' ));
But I really don't want this "parameters" key added. I just want my
$parameters array, and that's all!!!
So what I did now is replace every call in my code like this:
$this->CreateParticipant($parameters);
By this:
$CreateParticipant =& new
SOAP_Value('{http://questionmark.com/QMWISe/}CreateParticipant',false,$v=$parameters);
$result = $this->call("CreateParticipant",
$v = array('CreateParticipant'=>$CreateParticipant),
array('namespace'=>'http://questionmark.com/QMWISe/',
'soapaction'=>'http://questionmark.com/QMWISe/CreateParticipant',
'style'=>'document',
'use'=>'literal' ));
So what is changing is mainly that I replace the
$v=array('parameters'=>$parameters) by $v=$parameters to remove the
unnecessary (and error-giving) 'parameters' key.
Now in order to do this, I am forced not to rely on the soap_object
given by $wsdl_object->getProxy();
And so I need to type a bit more, but in the end it's working!
Thanks for reading until here. I hope it helps someone in the future.
Yannick Warnier