note 107430 modified in soapserver.fault by danbrown

From: Date: Thu, 10 May 2012 21:16:24 +0000
Subject: note 107430 modified in soapserver.fault by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-187865@lists.php.net to get a copy of this message
This function also sends a 500 response code back to the client with the request.&#13;&#10;This was causing issues with an Apache Axis 1.2 client I had so I instead implemented by own fault handling:&#13;&#10;&#13;&#10;&#60;?php&#13;&#10;header(&#34;Content-Type: text/xml&#34;);&#13;&#10;header(&#34;Status: 200&#34;);&#13;&#10;die(&#34;&#60;SOAP-ENV:Envelope xmlns:SOAP-ENV=\\&#34;http://schemas.xmlsoap.org/soap/envelope/\\&#34;&#62;&#13;&#10; &#60;SOAP-ENV:Body&#62;&#13;&#10; &#60;SOAP-ENV:Fault&#62;&#13;&#10; &#60;faultcode&#62;500&#60;/faultcode&#62;&#13;&#10; &#60;faultstring&#62;&#34;.$ex-&#62;getMessage()).&#34;&#60;/faultstring&#62;&#13;&#10; &#60;/SOAP-ENV:Fault&#62;&#13;&#10; &#60;/SOAP-ENV:Body&#62;&#13;&#10;&#60;/SOAP-ENV:Envelope&#62;&#34;);&#13;&#10;?&#62; --was-- This function also sends a 500 response code back to the client with the request. This was causing issues with an Apache Axis 1.2 client I had so I instead implemented by own fault handling: header("Content-Type: text/xml"); header("Status: 200"); die("<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>500</faultcode> <faultstring>".$ex->getMessage())."</faultstring> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope>"); http://php.net/manual/en/soapserver.fault.php

« previous php.notes (#187865) next »