Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/269.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Soap请求参数作为数组_Php_Xml_Soap - Fatal编程技术网

Php Soap请求参数作为数组

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

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">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);