note 101418 added to soapfault.soapfault

From: Date: Wed, 15 Dec 2010 14:46:20 +0000
Subject: note 101418 added to soapfault.soapfault
Groups: php.notes 
Request: Send a blank email to php-notes+get-174946@lists.php.net to get a copy of this message
In case you need to return SOAP Fault for SOAP Client based on Adobe Flash/Flex/AIR and stuck with Flash's inability to process SOAP messages with HTTP code 500 (that's what SOAP Fault returns; read more on this error here: http://bugs.php.net/bug.php?id=43507) then try this dirty hack: <?php $server = new SoapServer ( "SomeWSDL.wsdl" ); $server->setClass ( "SOAP_Class" ); /** * Catching SOAP Server response and overriding HTTP Status code. */ ob_start(); $server->handle (); $soapResponse = ob_get_contents(); ob_end_clean(); header('HTTP/1.0 200 OK'); echo $soapResponse; ?> Keep in mind that from PHP 5.2.6 SOAP Fault has an HTTP Status Code = 200 if User-agent is "Shockwave Flash", but when Flash object is integrated into HTML page SOAP Server receives User-agent = Broswer-agent and NOT "Shockwave Flash". Also it'll be a good idea to return HTTP 200 Code only if 500 Error is caused by known service faults. ---- Server IP: 69.147.83.197 Probable Submitter: 195.128.95.36 ---- Manual Page -- http://www.php.net/manual/en/soapfault.soapfault.php Edit -- https://master.php.net/note/edit/101418 Del: integrated -- https://master.php.net/note/delete/101418/integrated Del: useless -- https://master.php.net/note/delete/101418/useless Del: bad code -- https://master.php.net/note/delete/101418/bad+code Del: spam -- https://master.php.net/note/delete/101418/spam Del: non-english -- https://master.php.net/note/delete/101418/non-english Del: in docs -- https://master.php.net/note/delete/101418/in+docs Del: other reasons-- https://master.php.net/note/delete/101418 Reject -- https://master.php.net/note/reject/101418 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#174946) next »