开发者

SOAPClient throws fault when passing too much data

I've got a simple class which returns results from select classes. The db user only has select privileges.

The class is made available through SOAP so 3rd parties can query the database to create reporting tools.

The problem 开发者_如何学Pythonis the PHP SoapClient throws a SoapFault exception when I try to select too many rows. On a table with about 10 collumn with small pieces of data I can only select about 80 rows.

The return Soap response has a total size of 134KB, which is obviously not very much...

I've tried setting ini parameters as max_input_time, memory_limit and max_execution_time, but nothing hapened...

Why does the SoapClient fail?

Error thrown: (Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document


The SoapClient class has an error. I did not manage to fix it. I set the default_socket_timeout they wrote about in manual, but the only effect was, that the SoapFault disappeared.

I solved the problem with curl, and handmade xml with these settings:

ini_set('default_socket_timeout',120); //2 minutes for downloading the data
ini_set('memory_limit','256M'); //increase memory limit
ignore_user_abort(true); //abort user ignore
set_time_limit(0); //set execution time infinite
curl_setopt($connection,CURLOPT_TIMEOUT,120); //2 minutes timeout

The SoapClient and SoapServer classes have lot of bugs (timeout failure, no xsd validation, etc...), so if you can, then choose another alternative.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜