1

My problem: my received string size is ca. 4 MB

and this string doesn't not load in simplexml_load_string (return bool(false)).

The data is received with SoapClient.

How can I load this string in xml?

Code:

$client = new SoapClient('mydomain.com',array("trace"=> 1,"exceptions" => 0,'features' => SOAP_SINGLE_ELEMENT_ARRAYS));
$result=$client->GetArlistaAuth(array('pid'=>$pid,'partnerkod'=>$partnerkod, 'authcode'=>$authcode));
$xml = simplexml_load_string($result, 'SimpleXMLElement', LIBXML_COMPACT | LIBXML_PARSEHUGE);
5
  • I guess a part fall off your question, what is the content of the data you received ($result)? Aug 9, 2014 at 9:31
  • print your ($result) first Aug 9, 2014 at 9:33
  • echo $result is noting, but var_dump($result) is: [code]<valasz xmlns="" verzio="1.0"><arak><ar><cikkid>902</cikkid><cikkszam>GD45015</cikkszam><listaar>3700,0000000</listaar><ar>3700,0000000</ar>[/code] and this more....
    – LSG
    Aug 9, 2014 at 9:39
  • try DOMDocument maybe (php.net/manual/en/domdocument.loadxml.php)
    – birdspider
    Aug 9, 2014 at 10:46
  • my new code is: $reader = new XMLReader(); $reader->xml($f); $i = 0; foreach($reader->read() as $item){ $i++; echo($reader->readString()."<br>"); } echo $i." rows"; this code not really working, because rows is: only third rows is good. and end of loop not write $i why?
    – LSG
    Aug 10, 2014 at 22:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.