blib/lib/W3C/SOAP/Parser.pm

filter: Statementstmt 100% 35 / 35 Branchbran 66.6% 4 / 6 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 92.5% 50 / 54 CC 6 SCAR 12.2
CC
6
Cov
93%
__ANON__
6.2
BEGIN
1.0
BEGIN
1.0
CRAP 3.4
« blib/lib/W3C/SOAP/XSD/Document/SimpleType.pm ↑ Summary blib/lib/W3C/SOAP/XSD/Document/ComplexType.pm »
1 package W3C::SOAP::Parser;
2  
3 # Created on: 2012-05-27 18:58:29
4 # Create by: Ivan Wills
5 # $Id$
6 # $Revision$, $HeadURL$, $Date$
7 # $Revision$, $Source$, $Date$
8  
9 7 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 7 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 7 ▶use Scalar::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 7 ▶use List::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 #use List::MoreUtils;
15 7 ▶use Data::Dumper qw/Dumper/;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 7 ▶use English qw/ -no_match_vars /;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 7 our $VERSION = 0.13;
19  
20 7 has document => (
21 is => 'rw',
22 isa => 'W3C::SOAP::Document',
23 );
24 7 has template => (
25 is => 'rw',
26 isa => 'Template',
27 predicate => 'has_template',
28 );
29 7 has lib => (
30 is => 'rw',
31 isa => 'Str',
32 predicate => 'has_lib',
33 );
34  
35 around BUILDARGS => sub {
36 10 ▶ my ($orig, $class, @args) = @_;
Subroutine __ANON__: called CC=6 SCAR=18.2
37 10 ▶ my $args
Branch: 2 branches
BranchTrueFalseTotal
!@args ? : 0 10 10
@args == 1 ? : 0 10 10
38 = !@args ? {}
39 : @args == 1 ? $args[0]
40 : {@args};
41  
42 10 my $type = $class;
43 10 $type =~ s/Parser/Document/;
44  
45 10 for my $arg ( keys %$args ) {
46 46 ▶ if ( $arg eq 'location' || $arg eq 'string' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($arg eq "location" or $arg eq "string") 6 40 46
Condition66%2/3
$arg eq "location" or $arg eq "string"
l!l&&r!l&&!r
6040
MC/DC50%1/2
$arg eq "location" or $arg eq "string"
$arg eq "location" $arg eq "string"
Truth table66%2/3
A or B
A= $arg eq "location"B= $arg eq "string"
ABresult
1X1
011
000
47 6 $args->{document} = $type->new($args);
48 }
49 }
50  
51 10 return $class->$orig($args);
52 7 };
53  
54 7 1;
55  
56 __END__
57  
58 =head1 NAME
59  
60 W3C::SOAP::Parser - Base module for creating Moose objects from XML documents
61  
62 =head1 VERSION
63  
64 This documentation refers to W3C::SOAP::Parser version 0.13.
65  
66 =head1 SYNOPSIS
67  
68 # only used as a base
69 extends 'W3C::SOAP::Parser';
70  
71 =head1 DESCRIPTION
72  
73 This module parses a WSDL file so that it can produce a client to talk to the
74 SOAP service.
75  
76 =head1 SUBROUTINES/METHODS
77  
78 =head2 EXPORTED SUBROUTINES
79  
80 =over 4
81  
82 =item C<load_wsdl ($location)>
83  
84 Helper method that takes the supplied location and creates the dynamic WSDL
85 client object.
86  
87 =back
88  
89 =head2 CLASS METHODS
90  
91 =over 4
92  
93 =item C<new (%args)>
94  
95 Create the new object C<new> accepts the following arguments:
96  
97 =over 4
98  
99 =item location
100  
101 This is the location of the WSDL file, it may be a local file or a URL
102  
103 =item module
104  
105 This is the name of the module to be generated, it is required when writing
106 the SOAP client to disk, the dynamic client generator creates a semi random
107 namespace.
108  
109 =item lib
110  
111 The library directory where modules should be stored. only required when
112 calling C<write_modules>
113  
114 =item template
115  
116 The Template Toolkit object used for the generation of on disk modules
117  
118 =item ns_module_map
119  
120 The mapping of XSD namespaces to perl Modules.
121  
122 =back
123  
124 =back
125  
126 =head2 OBJECT METHODS
127  
128 =over 4
129  
130 =item C<<$wsdl->write_modules ()>>
131  
132 Writes out a module that is a SOAP Client to interface with the contained
133 WSDL document, also writes any referenced XSDs.
134  
135 =item C<<$wsdl->dynamic_classes ()>>
136  
137 Creates a dynamic SOAP client object to talk to the WSDL this object was
138 created for
139  
140 =item C<<$wsdl->get_xsd ()>>
141  
142 Creates the L<W3C::SOAP::XSD::Parser> object that represents the XSDs that
143 are used by the specified WSDL file.
144  
145 =back
146  
147 =head1 DIAGNOSTICS
148  
149 =head1 CONFIGURATION AND ENVIRONMENT
150  
151 =head1 DEPENDENCIES
152  
153 =head1 INCOMPATIBILITIES
154  
155 =head1 BUGS AND LIMITATIONS
156  
157 There are no known bugs in this module.
158  
159 Please report problems to Ivan Wills (ivan.wills@gmail.com).
160  
161 Patches are welcome.
162  
163 =head1 AUTHOR
164  
165 Ivan Wills - (ivan.wills@gmail.com)
166  
167 =head1 LICENSE AND COPYRIGHT
168  
169 Copyright (c) 2012 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077).
170 All rights reserved.
171  
172 This module is free software; you can redistribute it and/or modify it under
173 the same terms as Perl itself. See L<perlartistic>. This program is
174 distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
175 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
176 PARTICULAR PURPOSE.
177  
178 =cut
« blib/lib/W3C/SOAP/XSD/Document/SimpleType.pm ↑ Summary blib/lib/W3C/SOAP/XSD/Document/ComplexType.pm »