{
    "mode": "perldoc",
    "parameter": "SOAP::Fault",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/SOAP%3A%3AFault/json",
    "generated": "2026-06-09T12:02:51Z",
    "sections": {
        "NAME": {
            "content": "SOAP::Fault - encapsulates SOAP faults prior to their serialization or after their\ndeserialization\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This class encapsulates SOAP faults prior to their serialization or after their deserialization.\nThe methods available are a constructor and four accessors. Each accessor creates an object on\ndemand, just as the other classes do, when called as a static method. Like other accessors in\nthe SOAP::Lite package, they return the object itself when setting the attribute.\n",
            "subsections": []
        },
        "GENERATING A SOAP FAULT": {
            "content": "To generate a SOAP Fault simply issue a Perl die command on the server side as you might\nnormally. The SOAP processor will intercept the die command and return a SOAP Fault, using the\nstring passed to the die command as the faultstring, to the client making the call. If you\nrequire having more control over the SOAP Fault returned to the client, then simply pass a\nSOAP::Fault object to the die command and the SOAP processor will behave accordingly. For\nexample:\n\ndie SOAP::Fault->faultcode('Server.Custom') # will be qualified\n->faultstring('Died in server method')\n->faultdetail(bless {code => 1} => 'BadError')\n->faultactor('http://www.soaplite.com/custom');\n",
            "subsections": []
        },
        "METHODS": {
            "content": "",
            "subsections": [
                {
                    "name": "new",
                    "content": "$fault = SOAP::Fault->new(faultcode => 'Server');\n\nExplicitly creates a new SOAP::Fault object. Any of the four attributes represented next by\naccessor methods may be passed in the argument list with values immediately following their\nattribute name.\n"
                },
                {
                    "name": "faultcode",
                    "content": "$fault->faultcode('MethodUnknown');\n\nReturns the current fault code or sets it if a value is given.\n"
                },
                {
                    "name": "faultstring",
                    "content": "$fault->faultstring(\"There is no $method here\");\n\nReturns or sets the fault string.\n"
                },
                {
                    "name": "faultactor",
                    "content": "$fault->faultcode($header->actor);\n\nReturns or sets the fault-actor element. Note that the actor isn't always required in a SOAP\nfault.\n"
                },
                {
                    "name": "faultdetail",
                    "content": "$fault->faultcode(bless { proxy => $ip }, 'Err');\n\nReturns or sets the fault's detail element. Like the actor, this isn't always a required\nelement. Note that fault detail content in a message is represented as tag blocks. Thus, the\nvalues passed to this accessor when setting the value are either SOAP::Data objects, or more\ngeneral blessed hash references.\n\nIn addition to these methods, the SOAP::Fault package also provides detail as an alias for\nfaultdetail. The former is the actual name of the element with SOAP faults, but the latter name\nis less ambiguous when regarded with the rest of the SOAP::Lite package. Objects of this class\nalso have a special stringification enabled. If an object is printed or otherwise stringified,\nthe value produced is faultcode: faultstring, with the attribute values of the object.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "SOAP::Data, SOAP::Header, SOAP::SOM\n",
            "subsections": []
        },
        "ACKNOWLEDGEMENTS": {
            "content": "Special thanks to O'Reilly publishing which has graciously allowed SOAP::Lite to republish and\nredistribute large excerpts from *Programming Web Services with Perl*, mainly the SOAP::Lite\nreference found in Appendix B.\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright (C) 2000-2004 Paul Kulchenko. All rights reserved.\n\nThis library is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Paul Kulchenko (paulclinger@yahoo.com)\n\nRandy J. Ray (rjray@blackperl.com)\n\nByrne Reese (byrne@majordojo.com)\n",
            "subsections": []
        }
    },
    "summary": "SOAP::Fault - encapsulates SOAP faults prior to their serialization or after their deserialization",
    "flags": [],
    "examples": [],
    "see_also": []
}