Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am getting error like

simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found
Error: Value cannot be null. Parameter name: s

What I have tried:

$iResponse = $client->GetInstalmentDetails(array("PID" => $proId));
$GetData = simplexml_load_string($iResponse->GetResult);
Posted
Updated 15-Sep-17 0:23am

1 solution

See PHP: simplexml_load_string - Manual[^]
Quote:
Takes a well-formed XML string and returns it as an object.
The error messages indicates that the argument is not a well-formed XML string or even NULL.

Further help would require to know what types are returned by $client->GetInstalmentDetails() and $iResponse->GetResult, and how the value of the last looks like (the XML string).

I would expect that GetResult is a function and not a value (using parentheses). You should also add error checks where necessary and possible:
PHP
$iResponse = $client->GetInstalmentDetails(array("PID" => $proId));
// Should check $iResponse for failure here

// Using function call here: $iResponse->GetResult()
$XmlString = $iResponse->GetResult();
// Should check for NULL string here
$GetData = simplexml_load_string($XmlString);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900