Php Soap请求参数作为数组
XML请求:Php Soap请求参数作为数组,php,xml,soap,Php,Xml,Soap,XML请求: <ID xsi:type="xs:string">9832457</ID> <BookingDetails xsi:type="soapenc:Array" soapenc:arrayType="ns1:TBookingDetail[2]"> <item xsi:type="ns1:TBookingDetail"> <Question xsi:type="xs:string"&g
<ID xsi:type="xs:string">9832457</ID>
<BookingDetails xsi:type="soapenc:Array" soapenc:arrayType="ns1:TBookingDetail[2]">
<item xsi:type="ns1:TBookingDetail">
<Question xsi:type="xs:string">COMMENTS</Question>
<Answer xsi:type="xs:string">This is where the appointment notes go</Answer>
<ErrorCode xsi:type="xs:int">0</ErrorCode>
<ErrorDesc xsi:type="xs:string"></ErrorDesc>
<RequestID xsi:type="xs:string"></RequestID>
</item>
</BookingDetails>
我有一个方法要调用,soap请求中的MakeRegistration(),第二个参数是数组。上面的XML请求是我在SoapUi中的XML请求,那么我应该如何传递下面的请求
$newresult = $client->MakeRegistration($id,$arr);
这是我的解决方案,对我很有用,也许对某人有帮助
$arr = array(
0 => array(
"Question" => "COMMENTS",
"Answer" => $comment,
"ErrorCode" => 0,
"ErrorDesc" => "",
"RequestID" => ""
));
$result = $client->MakeRegistration($id,$arr);
$arr = array(
0 => array(
"Question" => "COMMENTS",
"Answer" => $comment,
"ErrorCode" => 0,
"ErrorDesc" => "",
"RequestID" => ""
));
$result = $client->MakeRegistration($id,$arr);