| 1 | package W3C::SOAP::WSDL::Document::Message; | ||||||||||
| 2 | |||||||||||
| 3 | # Created on: 2012-05-27 19:25:15 | ||||||||||
| 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 xml_error cmp_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 element => ( | |||||||||
| 24 | is => 'rw', | ||||||||||
| 25 | isa => 'Maybe[W3C::SOAP::XSD::Document::Element]', | ||||||||||
| 26 | builder => '_element', | ||||||||||
| 27 | lazy => 1, | ||||||||||
| 28 | ); | ||||||||||
| 29 | 5 | has type => ( | |||||||||
| 30 | is => 'rw', | ||||||||||
| 31 | isa => 'Maybe[Str]', | ||||||||||
| 32 | builder => '_type', | ||||||||||
| 33 | lazy => 1, | ||||||||||
| 34 | ); | ||||||||||
| 35 | |||||||||||
| 36 | sub _element { | ||||||||||
| 37 | 14 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
_element: called CC=7 SCAR=19.7
| |||||||||||
| 38 | 14 | my ($part) = $self->document->xpc->findnodes("wsdl:part", $self->node); | |||||||||
| 39 | 14 | ▶ | return unless $part; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | 14 | my $element = $part->getAttribute('element'); | |||||||||
| 41 | 14 | ▶ | return unless $element; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 42 | |||||||||||
| 43 | 14 | my ($ns, $el_name) = split_ns($element); | |||||||||
| 44 | 14 | my $nsuri = $self->document->get_nsuri($ns); | |||||||||
| 45 | 14 | my @schemas = @{ $self->document->schemas }; | |||||||||
| 46 | |||||||||||
| 47 | 14 | for my $schema (@schemas) { | |||||||||
| 48 | 18 | push @schemas, @{ $schema->imports }; | |||||||||
| 49 | 18 | push @schemas, @{ $schema->includes }; | |||||||||
| 50 | |||||||||||
| 51 | 18 | ▶ | if ( cmp_ns($schema->target_namespace, $nsuri) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 52 | 18 | for my $element (@{ $schema->elements }) { | |||||||||
| 53 | 48 | ▶ | return $element if $element->name eq $el_name; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 54 | } | ||||||||||
| 55 | } | ||||||||||
| 56 | } | ||||||||||
| 57 | |||||||||||
| 58 | 0 | return; | |||||||||
| 59 | } | ||||||||||
| 60 | |||||||||||
| 61 | sub _type { | ||||||||||
| 62 | 0 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
_type: not called CC=3 SCAR=24.8
| |||||||||||
| 63 | 0 | my ($part) = $self->document->xpc->findnodes("wsdl:part", $self->node); | |||||||||
| 64 | 0 | ▶ | return unless $part; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 65 | 0 | my $type = $part->getAttribute('type'); | |||||||||
| 66 | 0 | ▶ | return unless $type; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 67 | |||||||||||
| 68 | 0 | return $type; | |||||||||
| 69 | } | ||||||||||
| 70 | |||||||||||
| 71 | 5 | 1; | |||||||||
| 72 | |||||||||||
| 73 | __END__ | ||||||||||
| 74 | |||||||||||
| 75 | =head1 NAME | ||||||||||
| 76 | |||||||||||
| 77 | W3C::SOAP::WSDL::Document::Message - Representation of SOAP messages in a WSDL document | ||||||||||
| 78 | |||||||||||
| 79 | =head1 VERSION | ||||||||||
| 80 | |||||||||||
| 81 | This documentation refers to W3C::SOAP::WSDL::Document::Message version 0.13. | ||||||||||
| 82 | |||||||||||
| 83 | |||||||||||
| 84 | =head1 SYNOPSIS | ||||||||||
| 85 | |||||||||||
| 86 | use W3C::SOAP::WSDL::Document::Message; | ||||||||||
| 87 | |||||||||||
| 88 | # Brief but working code example(s) here showing the most common usage(s) | ||||||||||
| 89 | # This section will be as far as many users bother reading, so make it as | ||||||||||
| 90 | # educational and exemplary as possible. | ||||||||||
| 91 | |||||||||||
| 92 | |||||||||||
| 93 | =head1 DESCRIPTION | ||||||||||
| 94 | |||||||||||
| 95 | A C<W3C::SOAP::WSDL::Document::Message> object represents the messages tags | ||||||||||
| 96 | in a WSDL document. | ||||||||||
| 97 | |||||||||||
| 98 | =head1 SUBROUTINES/METHODS | ||||||||||
| 99 | |||||||||||
| 100 | =over 4 | ||||||||||
| 101 | |||||||||||
| 102 | =back | ||||||||||
| 103 | |||||||||||
| 104 | =head1 DIAGNOSTICS | ||||||||||
| 105 | |||||||||||
| 106 | =head1 CONFIGURATION AND ENVIRONMENT | ||||||||||
| 107 | |||||||||||
| 108 | =head1 DEPENDENCIES | ||||||||||
| 109 | |||||||||||
| 110 | =head1 INCOMPATIBILITIES | ||||||||||
| 111 | |||||||||||
| 112 | =head1 BUGS AND LIMITATIONS | ||||||||||
| 113 | |||||||||||
| 114 | There are no known bugs in this module. | ||||||||||
| 115 | |||||||||||
| 116 | Please report problems to Ivan Wills (ivan.wills@gmail.com). | ||||||||||
| 117 | |||||||||||
| 118 | Patches are welcome. | ||||||||||
| 119 | |||||||||||
| 120 | =head1 AUTHOR | ||||||||||
| 121 | |||||||||||
| 122 | Ivan Wills - (ivan.wills@gmail.com) | ||||||||||
| 123 | |||||||||||
| 124 | =head1 LICENSE AND COPYRIGHT | ||||||||||
| 125 | |||||||||||
| 126 | Copyright (c) 2012 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077). | ||||||||||
| 127 | All rights reserved. | ||||||||||
| 128 | |||||||||||
| 129 | This module is free software; you can redistribute it and/or modify it under | ||||||||||
| 130 | the same terms as Perl itself. See L<perlartistic>. This program is | ||||||||||
| 131 | distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||||||||||
| 132 | without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||||||||||
| 133 | PARTICULAR PURPOSE. | ||||||||||
| 134 | |||||||||||
| 135 | =cut | ||||||||||