PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Web Services » SOAP » Bug #4118

Configurable HTTP Status for Faults

Details

Request #4118Configurable HTTP Status for Faults
Submitted2005-04-11 16:49 UTC
Frompear at chrisdolan dot net
Assignedyunosh
StatusClosed
PackageSOAP
PHP Version4.3.7
OSlinux
Roadmaps(Not assigned)

Comments

[2005-04-11 16:49 UTC] pear at chrisdolan dot net

Description:
------------
A small feature request: configurable HTTP return codes

Under SOAP_Server, SOAP faults are sent back to the client as "HTTP Status: 500 SOAP Fault". Some clients (namely Macromedia Flash) don't have access to HTTP message body when the status is something other than 200, so it's not possible to retrieve the FaultString, etc.

This is a client limitation, but a server workaround of a configurable HTTP Status code would be very helpful. Something like the (untested but simple) patch referenced below would be ideal.

Patch against PEAR-SOAP v0.81: 26 lines, 1047 bytes
http://www.chrisdolan.net/pear-soap-fault-httpcode.patch

Perl SOAP::Lite has a feature like this, which can be activated like so in server code:
$SOAP::Constants::HTTP_ON_FAULT_CODE = 200;