PHP - 从Soap响应中获取数据

时间:2017-04-25 03:20:01

标签: php soap

使用SOAP UI我的肥皂响应

    <S:Body>
          <ns2:listIpMemberResponse xmlns:ns2="http://whoisservice.*.com/">
             <listResult>
                <memberInfo>
                   <issuedDate>29/11/2010</issuedDate>
                   <memberName>Ngân hàng Thương mại Cổ phần An Bình</memberName>
                   <netName>ABBANK-VN</netName>
                   <order>1</order>
                </memberInfo>
                <memberInfo>
                   <issuedDate>07/10/2010</issuedDate>
                   <memberName>Ngân hàng thương mại Cổ phần Á Châu</memberName>
                   <netName>ACB-VN</netName>
                   <order>2</order>
                </memberInfo>
                <memberInfo>
                   <issuedDate>11/05/2012</issuedDate>
                   <memberName>Công ty TNHH Chứng khoán ACB</memberName>
                   <netName>ACBS-VN</netName>
                   <order>3</order>
                </memberInfo>
             </listResult>
         </ns2:listIpMemberResponse>
   </S:Body>

我试图通过使用以下来获取listResult

    $context = stream_context_create();
    $whoisService_wsdl = 'https://url?wsdl';
    $whoisService_client = new SoapClient($whoisService_wsdl, array('cache_wsdl' => WSDL_CACHE_NONE, 'stream_context' => $context));
    $result = $whoisService_client->listIpMember();
    $list = $result->listResult;

但是当我print_r $ list时,结果是stdClass Object ( ) 1。 如何将listResult放入数组?

0 个答案:

没有答案