0

I have returning data from webservice with soap like this :

<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
   <soap-env:Header/>
   <soap-env:Body>
      <n0:ZFIFM_VIRTUAL_ACCOUNTResponse xmlns:n0="urn:sap-com:document:sap:rfc:functions">
         <BILLDETAILS>
            <item>
               <BILLCODE>?</BILLCODE>
               <BILLNAME>?</BILLNAME>
               <BILLSHORTNAME>?</BILLSHORTNAME>
               <BILLAMOUNT>?</BILLAMOUNT>
            </item>
            <item>
               <BILLCODE>01</BILLCODE>
               <BILLNAME>BIL</BILLNAME>
               <BILLSHORTNAME>Billing</BILLSHORTNAME>
               <BILLAMOUNT>114509000</BILLAMOUNT>
            </item>
            <item>
               <BILLCODE>02</BILLCODE>
               <BILLNAME>TAX</BILLNAME>
               <BILLSHORTNAME>PPN 10%</BILLSHORTNAME>
               <BILLAMOUNT>11450900</BILLAMOUNT>
            </item>
            <item>
               <BILLCODE>03</BILLCODE>
               <BILLNAME>TAX</BILLNAME>
               <BILLSHORTNAME>PPL WAPU</BILLSHORTNAME>
               <BILLAMOUNT>11450900</BILLAMOUNT>
            </item>
            <item>
               <BILLCODE>04</BILLCODE>
               <BILLNAME>TAX</BILLNAME>
               <BILLSHORTNAME>PPK 4.2</BILLSHORTNAME>
               <BILLAMOUNT>6758400</BILLAMOUNT>
            </item>
            <item>
               <BILLCODE>05</BILLCODE>
               <BILLNAME>TAX</BILLNAME>
               <BILLSHORTNAME>PPJ 23 - 2%</BILLSHORTNAME>
               <BILLAMOUNT>193500</BILLAMOUNT>
            </item>
            <item>
               <BILLCODE>06</BILLCODE>
               <BILLNAME>TAX</BILLNAME>
               <BILLSHORTNAME>PPO 23 - 15%</BILLSHORTNAME>
               <BILLAMOUNT>5587500</BILLAMOUNT>
            </item>
         </BILLDETAILS>
         <BILLINFO1>1000000014</BILLINFO1>
         <BILLINFO2>YOU MEAN IT</BILLINFO2>
         <BILLINFO3>1140000000</BILLINFO3>
         <BILLINFO4>JOJO Heart</BILLINFO4>
         <CURRENCY>360</CURRENCY>
         <STATUS>
            <item>
               <ISERROR>?</ISERROR>
               <ERRORCODE>?</ERRORCODE>
               <STATUSDESCRIPTION>?</STATUSDESCRIPTION>
            </item>
            <item>
               <ISERROR>false</ISERROR>
               <ERRORCODE>00</ERRORCODE>
               <STATUSDESCRIPTION>Success</STATUSDESCRIPTION>
            </item>
         </STATUS>
      </n0:ZFIFM_VIRTUAL_ACCOUNTResponse>
   </soap-env:Body>
</soap-env:Envelope>

the problem is how can I get array of BILLDETAILS while I'm using this method to call soapCLient :

$x = $client->ZFIFM_VIRTUAL_ACCOUNT(array("BILLKEY1"=>"8871711140100014"));

I already try with count($x->BILlDETAILS) but it's only return 1 values, and when I echo with : echo $x->BILLDETAILS[0]; it print blank..

please i need an advice.. thanks..

Dileep Kumar
  • 1,077
  • 9
  • 14
Tejo
  • 1

1 Answers1

0

Try it like this:

foreach ($x->BILLDETAILS->item as $key => $item) {
    var_dump($item);
}
buildok
  • 785
  • 6
  • 7