Unable to parse response body into XML: String could not be parsed as XML

936 views
Skip to first unread message

Jason Wise

unread,
May 20, 2016, 10:11:50 AM5/20/16
to PHRETS
I am very new to phrets so I apologize up front. I was working trying to set up MLS feed...and on test server am able to pull from MLS into database...but in trying to move out to client server, I get the following error:

Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /home/trbrealtor/public_html/phrets/vendor/guzzlehttp/guzzle/src/Message/Response.php:168 Stack trace: #0 /home/trbrealtor/public_html/phrets/vendor/guzzlehttp/guzzle/src/Message/Response.php(168): SimpleXMLElement->__construct('<?xml version="...', 2048, false, '', false) #1 /home/trbrealtor/public_html/phrets/vendor/troydavisson/phrets/src/Session.php(96): GuzzleHttp\Message\Response->xml() #2 /home/trbrealtor/public_html/phrets/cron_job.php(19): PHRETS\Session->Login() #3 {main} Next exception 'GuzzleHttp\Exception\XmlParseException' with message 'Unable to parse response body into XML: String could not be parsed as XML' in /home/trbrealtor/public_html/phrets/vendor/guzzlehttp/guzzle/src/Message/Response.php:174 Stack trace: #0 /home/trbrealtor/public_html/phrets/vendor/troydavisson/phrets/src/Session.php(96): GuzzleHttp\Message\Response->xml() #1 /home/trbrealtor/public_html/phrets/cron_job.php(19): PHRETS\Session->Login() in /home/trbrealtor/public_html/phrets/vendor/guzzlehttp/guzzle/src/Message/Response.php on line 174

So, my guess is since it works on one and not the other there must be an account setting or something I am missing...any ideas from anyone?

Also...in doing a search...is there a way to limit the data listings based on creating a string of cities the client covers (if the MLS covers a wide range and you want to narrow)?

And one other final newbie question...can the data search include multiple property types? Or do you set up like multiple daily updates for each singe type? Example:

A – Residential
B – Multi-Family
C – Land/Lots
D – Farm
E – Commercial
F – Rental/Lease

Gregg Moore

unread,
May 20, 2016, 11:03:51 AM5/20/16
to phr...@googlegroups.com
Jason,

I’m not sure if your client server and the test server reside with the same host.

It doesn’t sound like it. So, my guess is the client server is blocking a port, most likely port 6103.

Gregg Moore
Application Programmer/Web Developer
AT&T/iPhone :: 910.685.5055

Facebook :: facebook/GreggMoore23
Twitter :: MadRhino23

"Never trust a computer you can’t throw out a window."
Steve Wozniak

--
You received this message because you are subscribed to the Google Groups "PHRETS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+un...@googlegroups.com.
To post to this group, send email to phr...@googlegroups.com.
Visit this group at https://groups.google.com/group/phrets.
For more options, visit https://groups.google.com/d/optout.

Paul Simmons

unread,
Nov 29, 2017, 9:46:37 AM11/29/17
to PHRETS
So, I had the exact same error output as you did. I'm not sure if you got up and running.

What I found was actually pretty much what the error specified. The response from the RET server after logging in was a listing of capabilities that was not provided in XML format. This caused the issue in Response.php line168 which is within an xml parsing function. I added an echo statement of $this->getbody() and verified that what was being sent was not xml.

From here I went to Session.php line 96 and that is the Login function being initially called. I ended up commenting out the attempt to grab the response and sending it to be parsed to xml. I then manually had to add the available capabilities (rather than read them from the xml as a loop as intended).

Wish me luck...

Paul Simmons

unread,
Nov 29, 2017, 9:46:37 AM11/29/17
to PHRETS
Did you find any joy to your error?
I've got exactly the same issue and output.
In order to get RETSMD I did have to get an outbound port opened however incoming no.

Thanks
Paul



On Friday, May 20, 2016 at 10:11:50 AM UTC-4, Jason Wise wrote:

Fede Isas

unread,
Mar 8, 2018, 8:47:45 PM3/8/18
to PHRETS
I've found that some RETS servers when you get an error they send an invalid XML response, and the PHP XML parser fails and throws an Exception. Sometimes is enough to just trim() the response body before the new \SimpleXMLElement call.
Reply all
Reply to author
Forward
0 new messages