File Coverage

blib/lib/W3C/SOAP/WSDL/Document/Binding.pm
Criterion Covered Total %
statement 27 43 62.7
branch 0 4 0.0
condition n/a
subroutine 9 12 75.0
pod n/a
total 36 59 61.0


line stmt bran cond sub pod time code
1             package W3C::SOAP::WSDL::Document::Binding;
2              
3             # Created on: 2012-05-27 19:25:33
4             # Create by: Ivan Wills
5             # $Id$
6             # $Revision$, $HeadURL$, $Date$
7             # $Revision$, $Source$, $Date$
8              
9 1     1   1271 use Moose;
  1         1  
  1         8  
10 1     1   3381 use warnings;
  1         2  
  1         23  
11 1     1   4 use version;
  1         1  
  1         6  
12 1     1   57 use Carp;
  1         2  
  1         71  
13 1     1   7 use Scalar::Util;
  1         4  
  1         56  
14 1     1   7 use List::Util;
  1         2  
  1         78  
15             #use List::MoreUtils;
16 1     1   6 use Data::Dumper qw/Dumper/;
  1         1  
  1         42  
17 1     1   5 use English qw/ -no_match_vars /;
  1         1  
  1         7  
18 1     1   354 use W3C::SOAP::WSDL::Document::Operation;
  1         2  
  1         287  
19              
20             extends 'W3C::SOAP::Document::Node';
21              
22             our $VERSION = version->new('0.11');
23              
24             has style => (
25             is => 'rw',
26             isa => 'Str',
27             builder => '_style',
28             lazy => 1,
29             );
30             has transport => (
31             is => 'rw',
32             isa => 'Str',
33             builder => '_transport',
34             lazy => 1,
35             );
36             has operations => (
37             is => 'rw',
38             isa => 'ArrayRef[W3C::SOAP::WSDL::Document::Operation]',
39             builder => '_operations',
40             lazy => 1,
41             );
42              
43             sub _style {
44 0     0     my ($self) = @_;
45 0           my $style = $self->node->getAttribute('style');
46 0 0         return $style if $style;
47 0           my ($child) = $self->document->xpc->findnode('soap:binding'. $self->node);
48 0           return $child->getAttribute('style');
49             }
50              
51             sub _transport {
52 0     0     my ($self) = @_;
53 0           my $transport = $self->node->getAttribute('transport');
54 0 0         return $transport if $transport;
55 0           my ($child) = $self->document->xpc->findnode('soap:binding'. $self->node);
56 0           return $child->getAttribute('transport');
57             }
58              
59             sub _operations {
60 0     0     my ($self) = @_;
61 0           my @operations;
62 0           my @nodes = $self->document->xpc->findnodes('wsdl:operation', $self->node);
63              
64 0           for my $node (@nodes) {
65 0           push @operations, W3C::SOAP::WSDL::Document::Operation->new(
66             parent_node => $self,
67             node => $node,
68             );
69             }
70              
71 0           return \@operations;
72             }
73              
74             1;
75              
76             __END__
77              
78             =head1 NAME
79              
80             W3C::SOAP::WSDL::Document::Binding - Bindings for WSDL documents
81              
82             =head1 VERSION
83              
84             This documentation refers to W3C::SOAP::WSDL::Document::Binding version 0.11.
85              
86             =head1 SYNOPSIS
87              
88             use W3C::SOAP::WSDL::Document::Binding;
89              
90             # Brief but working code example(s) here showing the most common usage(s)
91             # This section will be as far as many users bother reading, so make it as
92             # educational and exemplary as possible.
93              
94              
95             =head1 DESCRIPTION
96              
97             A C<W3C::SOAP::WSDL::Document::Binding> represents the bindings tags in a WSDL
98             document.
99              
100             =head1 SUBROUTINES/METHODS
101              
102             =over 4
103              
104             =back
105              
106             =head1 DIAGNOSTICS
107              
108             =head1 CONFIGURATION AND ENVIRONMENT
109              
110             =head1 DEPENDENCIES
111              
112             =head1 INCOMPATIBILITIES
113              
114             =head1 BUGS AND LIMITATIONS
115              
116             There are no known bugs in this module.
117              
118             Please report problems to Ivan Wills (ivan.wills@gmail.com).
119              
120             Patches are welcome.
121              
122             =head1 AUTHOR
123              
124             Ivan Wills - (ivan.wills@gmail.com)
125              
126             =head1 LICENSE AND COPYRIGHT
127              
128             Copyright (c) 2012 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077).
129             All rights reserved.
130              
131             This module is free software; you can redistribute it and/or modify it under
132             the same terms as Perl itself. See L<perlartistic>. This program is
133             distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
134             without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
135             PARTICULAR PURPOSE.
136              
137             =cut