Note: This article was originally written on reich-consulting.net. Reich Web Consulting has narrowed its focus to the web and no longer offers tech support services, so we’ve moved all of our tech support content off-site. We hope you find this article useful. It is provided as-is, and we will no longer provide support on this topic.
While running my unit tests for an application I’m developing, I noticed that certain web service components were intermittently failing. The failure was caused by irregularly formed XML responses from Amazon’s Web Services. The failures occured as Exceptions from within the Zend_Service_Amazon component, but upon further inspection I was able to discover that the HTTP Adapter being used from within Zend_Service_Amazon, which is by default Zend_Http_Client_Adapter_Socket, was not returning the entire stream from Amazon. After I switched adapters to Zend_Http_Client_Adapter_Curl, my unit tests began running without fail.
I was not able to find any information about the problem from the Zend Framework Issue Tracker, so I have no way of knowing at the moment if there is a bug within the Socket adapter, or something with my computer or my Internet connection.