| 1 | package SOAP::WSDL::SOAP::Typelib::Fault11; | ||||||||||||||||||||||||||||
| 2 | { | ||||||||||||||||||||||||||||
| 3 | 8 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 8 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 8 | ▶ | use Class::Std::Fast::Storable constructor => 'none'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 8 | our $VERSION = 3.004; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 8 | ▶ | use Scalar::Util qw(blessed); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 8 | ▶ | use SOAP::WSDL::XSD::Typelib::ComplexType; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 8 | ▶ | use SOAP::WSDL::XSD::Typelib::Element; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 8 | ▶ | use base qw( | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | SOAP::WSDL::SOAP::Typelib::Fault | ||||||||||||||||||||||||||||
| 16 | SOAP::WSDL::XSD::Typelib::Element | ||||||||||||||||||||||||||||
| 17 | SOAP::WSDL::XSD::Typelib::ComplexType | ||||||||||||||||||||||||||||
| 18 | 8 | ); | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 8 | my %faultcode_of : ATTR(:get<faultcode>); | |||||||||||||||||||||||||||
| 21 | 8 | my %faultstring_of : ATTR(:get<faultstring>); | |||||||||||||||||||||||||||
| 22 | 8 | my %faultactor_of : ATTR(:get<faultactor>); | |||||||||||||||||||||||||||
| 23 | 8 | my %detail_of : ATTR(:get<detail>); | |||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 8 | __PACKAGE__->_factory( | |||||||||||||||||||||||||||
| 26 | [qw(faultcode faultstring faultactor detail)], | ||||||||||||||||||||||||||||
| 27 | { | ||||||||||||||||||||||||||||
| 28 | faultcode => \%faultcode_of, | ||||||||||||||||||||||||||||
| 29 | faultstring => \%faultstring_of, | ||||||||||||||||||||||||||||
| 30 | faultactor => \%faultactor_of, | ||||||||||||||||||||||||||||
| 31 | detail => \%detail_of, | ||||||||||||||||||||||||||||
| 32 | }, | ||||||||||||||||||||||||||||
| 33 | { | ||||||||||||||||||||||||||||
| 34 | faultcode => 'SOAP::WSDL::XSD::Typelib::Builtin::QName', | ||||||||||||||||||||||||||||
| 35 | faultstring => 'SOAP::WSDL::XSD::Typelib::Builtin::string', | ||||||||||||||||||||||||||||
| 36 | faultactor => 'SOAP::WSDL::XSD::Typelib::Builtin::anyURI', | ||||||||||||||||||||||||||||
| 37 | detail => 'SOAP::WSDL::SOAP::Typelib::Fault11Detail', | ||||||||||||||||||||||||||||
| 38 | } ); | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 5 | ▶ | sub get_xmlns { return 'http://schemas.xmlsoap.org/soap/envelope/' } | ||||||||||||||||||||||||||
|
Subroutine
get_xmlns: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 8 | __PACKAGE__->__set_name('Fault'); | |||||||||||||||||||||||||||
| 43 | 8 | __PACKAGE__->__set_nillable(0); | |||||||||||||||||||||||||||
| 44 | 8 | __PACKAGE__->__set_minOccurs(); | |||||||||||||||||||||||||||
| 45 | 8 | __PACKAGE__->__set_maxOccurs(); | |||||||||||||||||||||||||||
| 46 | 8 | __PACKAGE__->__set_ref(''); | |||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | # always return false in boolean context - a fault is never true... | ||||||||||||||||||||||||||||
| 49 | 2 | ▶ | sub as_bool : BOOLIFY { | ||||||||||||||||||||||||||
|
Subroutine
as_bool: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 50 | 2 | return; | |||||||||||||||||||||||||||
| 51 | 8 | ▶ | } | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | # override set_detail to allow "auto-vivification" of a details object | ||||||||||||||||||||||||||||
| 54 | # must be implemented via symbol table operation - _factory adds | ||||||||||||||||||||||||||||
| 55 | # methods via symbol table, too. | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | # BLOCK to scope warnings | ||||||||||||||||||||||||||||
| 58 | { | ||||||||||||||||||||||||||||
| 59 | 8 | ▶ | no warnings qw(redefine); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 60 | 8 | my $set_detail_sub = \&set_detail; | |||||||||||||||||||||||||||
| 61 | 0 | ▶ | *set_detail = sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 62 | 0 | my ( $self, $detail ) = @_; | |||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | # create SOAP::WSDL::SOAP::Typelib::Fault11Detail wrapper if there | ||||||||||||||||||||||||||||
| 65 | # is none | ||||||||||||||||||||||||||||
| 66 | 0 | ▶ | if ( not blessed $detail | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
builtin::blessed($detail) and $detail->isa("SOAP::WSDL::SOAP::Typelib::Fault11Detail")
MC/DC0%0/2
builtin::blessed($detail) and $detail->isa("SOAP::WSDL::SOAP::Typelib::Fault11Detail")
builtin::blessed($detail)
$detail->isa("SOAP::WSDL::SOAP::Typelib::Fault11Detail")
Truth table0%0/3
A and B
A= builtin::blessed($detail)B= $detail->isa("SOAP::WSDL::SOAP::Typelib::Fault11Detail")
| |||||||||||||||||||||||||||||
| 67 | or | ||||||||||||||||||||||||||||
| 68 | not $detail->isa('SOAP::WSDL::SOAP::Typelib::Fault11Detail') ) | ||||||||||||||||||||||||||||
| 69 | { | ||||||||||||||||||||||||||||
| 70 | 0 | $detail = SOAP::WSDL::SOAP::Typelib::Fault11Detail->new( | |||||||||||||||||||||||||||
| 71 | {value => $detail} ); | ||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | # call original method | ||||||||||||||||||||||||||||
| 75 | 0 | $set_detail_sub->( $self, $detail ); | |||||||||||||||||||||||||||
| 76 | 8 | }; | |||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||
| 78 | 8 | Class::Std::initialize(); | |||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||
| 81 | package SOAP::WSDL::SOAP::Typelib::Fault11Detail; | ||||||||||||||||||||||||||||
| 82 | { | ||||||||||||||||||||||||||||
| 83 | 8 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 84 | 8 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 85 | 8 | ▶ | use Class::Std::Fast::Storable constructor => 'none'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 86 | 8 | ▶ | use base qw( | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 87 | SOAP::WSDL::XSD::Typelib::Element | ||||||||||||||||||||||||||||
| 88 | SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType | ||||||||||||||||||||||||||||
| 89 | 8 | ); | |||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||
| 91 | 0 | ▶ | sub get_xmlns { return 'http://schemas.xmlsoap.org/soap/envelope/' } | ||||||||||||||||||||||||||
|
Subroutine
get_xmlns: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||
| 93 | 8 | __PACKAGE__->__set_name('Fault'); | |||||||||||||||||||||||||||
| 94 | 8 | __PACKAGE__->__set_nillable(0); | |||||||||||||||||||||||||||
| 95 | 8 | __PACKAGE__->__set_minOccurs(); | |||||||||||||||||||||||||||
| 96 | 8 | __PACKAGE__->__set_maxOccurs(); | |||||||||||||||||||||||||||
| 97 | 8 | Class::Std::initialize(); | |||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||
| 100 | 8 | 1; | |||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||
| 102 | =pod | ||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||
| 104 | =head1 NAME | ||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||
| 106 | SOAP::WSDL::SOAP::Typelib::Fault11 - SOAP 1.1 Fault class | ||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||
| 108 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||
| 110 | Models a SOAP 1.1 Fault. | ||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | SOAP::WSDL::SOAP::Typelib::Fault11 objects are false in boolean context | ||||||||||||||||||||||||||||
| 113 | and serialize to XML on stringification. | ||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||
| 115 | This means you can do something like: | ||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||
| 117 | my $soap = SOAP::WSDL::Client->new(); | ||||||||||||||||||||||||||||
| 118 | # ... | ||||||||||||||||||||||||||||
| 119 | my $result = $soap->call($method, $data); | ||||||||||||||||||||||||||||
| 120 | if (not $result) { | ||||||||||||||||||||||||||||
| 121 | die "Error calling SOAP method: ", $result->get_faultstring(); | ||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||
| 124 | =head1 METHODS | ||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||
| 126 | =head2 get_faultcode / set_faultcode | ||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||
| 128 | Getter/setter for object's faultcode property. | ||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||
| 130 | =head2 get_faultstring / set_faultstring | ||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||
| 132 | Getter/setter for object's faultstring property. | ||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||
| 134 | =head2 get_faultactor / set_faultactor | ||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||
| 136 | Getter/setter for object's faultactor property. | ||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||
| 138 | =head2 get_detail / set_detail | ||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||
| 140 | Getter/setter for detail object's detail property. | ||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||
| 142 | The detail element is a SOAP::WSDL::SOAP::Typelib::Fault11Detail object. | ||||||||||||||||||||||||||||
| 143 | This class is automatically loaded when using | ||||||||||||||||||||||||||||
| 144 | SOAP::WSDL::SOAP::Typelib::Fault11, so you can't B<use> it separately. | ||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||
| 146 | Any string or object not of this class will be automatically wrapped into | ||||||||||||||||||||||||||||
| 147 | a detail object. | ||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||
| 149 | Note that passing a list of detail object is currently not supported (though | ||||||||||||||||||||||||||||
| 150 | the SOAP1.1 note allows this). | ||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||
| 152 | =head1 LICENSE AND COPYRIGHT | ||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||
| 154 | Copyright 2007 Martin Kutter. All rights reserved. | ||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||
| 156 | This file is part of SOAP-WSDL. You may distribute/modify it under | ||||||||||||||||||||||||||||
| 157 | the same terms as perl itself | ||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||
| 159 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||
| 161 | Martin Kutter E<lt>martin.kutter fen-net.deE<gt> | ||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||
| 163 | =head1 REPOSITORY INFORMATION | ||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | $Rev: 851 $ | ||||||||||||||||||||||||||||
| 166 | $LastChangedBy: kutterma $ | ||||||||||||||||||||||||||||
| 167 | $Id: Fault11.pm 851 2009-05-15 22:45:18Z kutterma $ | ||||||||||||||||||||||||||||
| 168 | $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm $ | ||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||
| 170 | =cut | ||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||