.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "SOAP::Fault 3"
.TH SOAP::Fault 3 "2018-05-14" "perl v5.26.3" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
SOAP::Fault \- encapsulates SOAP faults prior to their serialization or after their deserialization
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
This class encapsulates \s-1SOAP\s0 faults prior to their serialization or after their deserialization. The methods available are a constructor and four accessors. Each accessor creates an object on demand, just as the other classes do, when called as a static method. Like other accessors in the SOAP::Lite package, they return the object itself when setting the attribute.
.SH "GENERATING A SOAP FAULT"
.IX Header "GENERATING A SOAP FAULT"
To generate a \s-1SOAP\s0 Fault simply issue a Perl die command on the server side as you might normally. The \s-1SOAP\s0 processor will intercept the die command and return a \s-1SOAP\s0 Fault, using the string passed to the die command as the faultstring, to the client making the call. If you require having more control over the \s-1SOAP\s0 Fault returned to the client, then simply pass a SOAP::Fault object to the die command and the \s-1SOAP\s0 processor will behave accordingly. For example:
.PP
.Vb 4
\& die SOAP::Fault\->faultcode(\*(AqServer.Custom\*(Aq) # will be qualified
\& \->faultstring(\*(AqDied in server method\*(Aq)
\& \->faultdetail(bless {code => 1} => \*(AqBadError\*(Aq)
\& \->faultactor(\*(Aqhttp://www.soaplite.com/custom\*(Aq);
.Ve
.SH "METHODS"
.IX Header "METHODS"
.IP "new(optional data)" 4
.IX Item "new(optional data)"
.Vb 1
\& $fault = SOAP::Fault\->new(faultcode => \*(AqServer\*(Aq);
.Ve
.Sp
Explicitly creates a new SOAP::Fault object. Any of the four attributes represented next by accessor methods may be passed in the argument list with values immediately following their attribute name.
.IP "faultcode(optional value)" 4
.IX Item "faultcode(optional value)"
.Vb 1
\& $fault\->faultcode(\*(AqMethodUnknown\*(Aq);
.Ve
.Sp
Returns the current fault code or sets it if a value is given.
.IP "faultstring(optional value)" 4
.IX Item "faultstring(optional value)"
.Vb 1
\& $fault\->faultstring("There is no $method here");
.Ve
.Sp
Returns or sets the fault string.
.IP "faultactor(optional value)" 4
.IX Item "faultactor(optional value)"
.Vb 1
\& $fault\->faultcode($header\->actor);
.Ve
.Sp
Returns or sets the fault-actor element. Note that the actor isn't always required in a \s-1SOAP\s0 fault.
.IP "faultdetail(optional value)" 4
.IX Item "faultdetail(optional value)"
.Vb 1
\& $fault\->faultcode(bless { proxy => $ip }, \*(AqErr\*(Aq);
.Ve
.Sp
Returns or sets the fault's detail element. Like the actor, this isn't always a required element. Note that fault detail content in a message is represented as tag blocks. Thus, the values passed to this accessor when setting the value are either SOAP::Data objects, or more general blessed hash references.
.PP
In addition to these methods, the SOAP::Fault package also provides detail as an alias for faultdetail. The former is the actual name of the element with \s-1SOAP\s0 faults, but the latter name is less ambiguous when regarded with the rest of the SOAP::Lite package. Objects of this class also have a special stringification enabled. If an object is printed or otherwise stringified, the value produced is faultcode: faultstring, with the attribute values of the object.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
SOAP::Data, SOAP::Header, \s-1SOAP::SOM\s0
.SH "ACKNOWLEDGEMENTS"
.IX Header "ACKNOWLEDGEMENTS"
Special thanks to O'Reilly publishing which has graciously allowed SOAP::Lite to republish and redistribute large excerpts from \fIProgramming Web Services with Perl\fR, mainly the SOAP::Lite reference found in Appendix B.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (C) 2000\-2004 Paul Kulchenko. All rights reserved.
.PP
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
.SH "AUTHORS"
.IX Header "AUTHORS"
Paul Kulchenko (paulclinger@yahoo.com)
.PP
Randy J. Ray (rjray@blackperl.com)
.PP
Byrne Reese (byrne@majordojo.com)