SOAP method - structured parameters problem
| From: | Yannick Warnier | Date: | Mon, 06 Dec 2004 22:56:08 +0000 |
| Subject: | SOAP method - structured parameters problem | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-16064@lists.php.net to get a copy of this message | ||
Hi there,
I've been using the PEAR::SOAP extension for a week now and have found
some problems sending structured parameters. I have been trying to get
in touch with the developers privately but got no result.
As I'm not sure I'm asking at the right place, could you tell me if
someone here is managing (or at least supporting) the SOAP extension and
if my question is of general interest here or needs to be taken on
another list?
To be sure I'm not doing a useless step, here's my problem in more
details...
I'm using the SOAP_WSDL class and issuing queries with a simple list of
parameters without any problem (I get accurate results and all).
When I try to send a structure like this as parameter:
<Participant>
<Participant_Name>4</Participant_Name>
<Date_Registration>2004-11-03</Date_Registration>
<...other optional parameters here...>
</Participant>
a dump of my request before it is sent seems to give me a SOAP envelope
like this:
<SOAP-ENV:Body>
<ns4:CreateParticipant>
<ns4:parameters>
<ns4:Participant>
<ns4:Participant_Name>5</ns4:Participant_Name>
<ns4:Date_Registration>2004-12-01</ns4:Date_Registration>
</ns4:Participant>
</ns4:parameters>
</ns4:CreateParticipant>
</SOAP-ENV:Body>
As my request is apparently not correctly formatted (I get an error from
the SOAP server on the other side), I am wondering why this
<ns4:parameters> appears.
The thing is: it only appears when I'm formatting my parameters into an
array. I cannot find a way to do otherwise because I need the
"Participant" element, so what I am issuing the call to the SOAP method
like this:
$result = $soap_client->CreateParticipant(
array("Participant"=>
array(
"Participant_Name"=>$id,
"Date_Registration"=>"25/11/2004"
)
)
);
Does somebody know of a solution for this?
Thanks a lot in advance, I am completely blocked by this problem so
far...
Yannick