I'm using a python script from with in php to call some xml date from a c# server. When I pass it through simplexml_load_string
to parse my data. The python script is called for a few different things, but for one of the calls it gives me
Warning: simplexml_load_string(): Entity: line 1: parser error : StartTag: invalid element name
My PHP is:
$output = exec("python Auth.py -M authenticate -p 17df30b0-37c1-4ebf-b45e-39353bd971a9 -P 5b9abe609e1ab31555562dd959fc050d");
$xml = simplexml_load_string($output, "SimpleXMLElement", LIBXML_NOCDATA);
$json = json_encode($xml);
$array = json_decode($json,TRUE);
My Python is:
params = urllib.urlencode(data);
conn = httplib.HTTPConnection("localhost", 8003);
conn.request("POST", path, params)
response = conn.getresponse()
print response.read();
And my XML is:
<?xml version="1.0"?>
<ServerResponse>
<Result>Success</Result>
<Token>25027fc3-e3c9-46a8-a1b7-5d217fecfe2c</Token>
</ServerResponse>
I can run my Python script from my Ubuntu command line just fine and I wrote the output into a PHP file as XML data and it worked fine on parsing it.
So I don't know what's wrong. Can anybody help?