XML-RPC: xmlrpc_server::service: http headers already sent before response is fully generated
I am using a web service to dispatch a zip to from one server to another server. I have been using a web service code its working fine but, sometimes web service getting error like this
XML-RPC: xmlrpc_server::service: http headers already sent before response is fully generated
and more file requested file does not dispatching. I tried to solve this problem, but I couldn't solve it. How could achieve this? Here is my code:
$arg = array(
new xmlrpcval($resu开发者_运维问答lt->Customer, "string"),
new xmlrpcval($result->JID, "string"),
new xmlrpcval($result->AID,"string"),
new xmlrpcval($fileSize,"string")
);
$server = new xmlrpc_client($fileName, $ip, $port);
$message = new xmlrpcmsg('sendArticleDetails', $arg);
$res = $server->send($message);
I assume that you are using xmlrpc from http://sourceforge.net/projects/phpxmlrpc/
When the above message is thrown there could be two reasons :
a) any output has been made before the code you posted above. This can be a echo or print() message (might be inside an if statement) or an error message. (Check the display_errors settings in the php.ini )
b) an explicit call to header() in the code before
Assuming a)
Thorsten
精彩评论