blib/lib/W3C/SOAP/WSDL/Document/Port.pm

filter: Statementstmt 95.0% 38 / 40 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod n/a totaltotal 92.5% 50 / 54 CC 4 SCAR 5.1
CC
4
Cov
91%
_binding
3.1
_address
2.1
BEGIN
1.0
CRAP 1.7
« blib/lib/W3C/SOAP/Utils.pm ↑ Summary blib/lib/W3C/SOAP/XSD/Document/Type.pm »
1 package W3C::SOAP::WSDL::Document::Port;
2  
3 # Created on: 2012-05-27 19:52:35
4 # Create by: Ivan Wills
5 # $Id$
6 # $Revision$, $HeadURL$, $Date$
7 # $Revision$, $Source$, $Date$
8  
9 5 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 5 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 5 ▶use Scalar::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 5 ▶use List::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 #use List::MoreUtils;
15 5 ▶use Data::Dumper qw/Dumper/;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 5 ▶use English qw/ -no_match_vars /;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 5 ▶use W3C::SOAP::Utils qw/split_ns/;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 5 extends 'W3C::SOAP::Document::Node';
20  
21 5 our $VERSION = 0.13;
22  
23 5 has binding => (
24 is => 'rw',
25 isa => 'W3C::SOAP::WSDL::Document::Binding',
26 builder => '_binding',
27 weak_ref => 1,
28 lazy => 1,
29 );
30 5 has address => (
31 is => 'rw',
32 isa => 'Str',
33 builder => '_address',
34 lazy => 1,
35 );
36  
37 sub _binding {
38 4 ▶ my ($self) = @_;
Subroutine _binding: called CC=3 SCAR=11.4
39 4 my ($ns, $name) = split_ns($self->node->getAttribute('binding'));
40  
41 4 for my $binding (@{ $self->document->bindings }) {
42 4 ▶ return $binding if $binding->name eq $name;
Branch: 1 branch
BranchTrueFalseTotal
if $binding->name eq $name 4 0 4
43 }
44  
45 0 return;
46 }
47  
48 sub _address {
49 4 ▶ my ($self) = @_;
Subroutine _address: called CC=2 SCAR=7.4
50 4 my ($address) = $self->document->xpc->findnodes('soap:address | soap12:address', $self->node);
51 4 ▶ if (!$address) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($address) 0 4 4
52 0 confess "Can't find address in:\n" . $self->node->toString . "\n";
53 }
54  
55 4 return $address->getAttribute('location');
56 }
57  
58 5 1;
59  
60 __END__
61  
62 =head1 NAME
63  
64 W3C::SOAP::WSDL::Document::Port - Represents the ports in a WSDL document
65  
66 =head1 VERSION
67  
68 This documentation refers to W3C::SOAP::WSDL::Document::Port version 0.13.
69  
70  
71 =head1 SYNOPSIS
72  
73 use W3C::SOAP::WSDL::Document::Port;
74  
75 # Brief but working code example(s) here showing the most common usage(s)
76 # This section will be as far as many users bother reading, so make it as
77 # educational and exemplary as possible.
78  
79  
80 =head1 DESCRIPTION
81  
82 A C<W3C::SOAP::WSDL::Document::Port> object represents the port tags
83 in a WSDL document.
84  
85 =head1 SUBROUTINES/METHODS
86  
87 =over 4
88  
89 =back
90  
91 =head1 DIAGNOSTICS
92  
93 =head1 CONFIGURATION AND ENVIRONMENT
94  
95 =head1 DEPENDENCIES
96  
97 =head1 INCOMPATIBILITIES
98  
99 =head1 BUGS AND LIMITATIONS
100  
101 There are no known bugs in this module.
102  
103 Please report problems to Ivan Wills (ivan.wills@gmail.com).
104  
105 Patches are welcome.
106  
107 =head1 AUTHOR
108  
109 Ivan Wills - (ivan.wills@gmail.com)
110  
111 =head1 LICENSE AND COPYRIGHT
112  
113 Copyright (c) 2012 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077).
114 All rights reserved.
115  
116 This module is free software; you can redistribute it and/or modify it under
117 the same terms as Perl itself. See L<perlartistic>. This program is
118 distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
119 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
120 PARTICULAR PURPOSE.
121  
122 =cut
« blib/lib/W3C/SOAP/Utils.pm ↑ Summary blib/lib/W3C/SOAP/XSD/Document/Type.pm »