| 1 | package SOAP::WSDL::Generator::Iterator::WSDL11; | ||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use strict; use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use Class::Std::Fast; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 1 | our $VERSION = 3.004; | |||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 1 | my %definitions_of :ATTR(:name<definitions> :default<[]>); | |||||||||||||||||||||||||||
| 8 | 1 | my %nodes_of :ATTR(:name<nodes> :default<[]>); | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | # memoization attributes | ||||||||||||||||||||||||||||
| 11 | 1 | my %portType_of :ATTR(); | |||||||||||||||||||||||||||
| 12 | 1 | my %types_of :ATTR(); | |||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | my %METHOD_OF = ( | ||||||||||||||||||||||||||||
| 15 | 'SOAP::WSDL::Definitions' => 'get_service', | ||||||||||||||||||||||||||||
| 16 | 'SOAP::WSDL::Service' => 'get_port', | ||||||||||||||||||||||||||||
| 17 | 0 | ▶ | 'SOAP::WSDL::Port' => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||
| 18 | 0 | my ($self, $node) = @_; | |||||||||||||||||||||||||||
| 19 | 0 | ▶ | return if ! $node->first_address() | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$node->first_address and $node->first_address->isa("SOAP::WSDL::SOAP::Address")
MC/DC0%0/2
$node->first_address and $node->first_address->isa("SOAP::WSDL::SOAP::Address")
$node->first_address
$node->first_address->isa("SOAP::WSDL::SOAP::Address")
Truth table0%0/3
A and B
A= $node->first_addressB= $node->first_address->isa("SOAP::WSDL::SOAP::Address")
| |||||||||||||||||||||||||||||
| 20 | or ! $node->first_address()->isa('SOAP::WSDL::SOAP::Address'); | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 0 | ▶ | return [ $self->get_definitions() | ||||||||||||||||||||||||||
|
Condition0%0/3
$self->get_definitions->find_binding($node->expand($node->get_binding)) || ()
MC/DC0%0/2
$self->get_definitions->find_binding($node->expand($node->get_binding)) || ()
$self->get_definitions->find_binding($node->expand($node->get_binding))
()
Truth table0%0/3
A || B
A= $self->get_definitions->find_binding($node->expand($node->get_binding))B= ()
| |||||||||||||||||||||||||||||
| 23 | ->find_binding( $node->expand( $node->get_binding() ) ) || () ]; | ||||||||||||||||||||||||||||
| 24 | }, | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 0 | ▶ | 'SOAP::WSDL::Binding' => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||
| 27 | 0 | my ($self, $node) = @_; | |||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | # remember referenced portType | ||||||||||||||||||||||||||||
| 30 | 0 | ▶ | $portType_of{ ident $self } = $self->get_definitions() | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 31 | ->find_portType( $node->expand( $node->get_type ) ) | ||||||||||||||||||||||||||||
| 32 | or return []; | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 0 | return $node->get_operation(); | |||||||||||||||||||||||||||
| 35 | }, | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 0 | ▶ | 'SOAP::WSDL::Operation' => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||
| 38 | 0 | my ($self, $node) = @_; | |||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 0 | my $name = $node->get_name(); | |||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | # get the equally named operation from the portType | ||||||||||||||||||||||||||||
| 43 | 0 | my ($op) = grep { $_->get_name() eq $name } | |||||||||||||||||||||||||||
| 44 | 0 | ▶ | @{ $portType_of{ ident $self }->get_operation() } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 45 | or return []; | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 0 | return [ @{ $op->get_input }, @{ $op->get_output }, @{ $op->get_fault } ] | |||||||||||||||||||||||||||
| 48 | }, | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 0 | ▶ | 'SOAP::WSDL::OpMessage' => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 51 | 0 | my ($self, $node) = @_; | |||||||||||||||||||||||||||
| 52 | 0 | ▶ | return if ( ref $node->get_parent() eq 'SOAP::WSDL::Binding' ); # we're in binding | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | # TODO maybe allow more messages && overloading by specifying name | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 0 | ▶ | return [ $self->get_definitions()->find_message( | ||||||||||||||||||||||||||
|
Condition0%0/3
$self->get_definitions->find_message($node->expand($node->get_message)) || ()
MC/DC0%0/2
$self->get_definitions->find_message($node->expand($node->get_message)) || ()
$self->get_definitions->find_message($node->expand($node->get_message))
()
Truth table0%0/3
A || B
A= $self->get_definitions->find_message($node->expand($node->get_message))B= ()
| |||||||||||||||||||||||||||||
| 57 | $node->expand( $node->get_message() ) | ||||||||||||||||||||||||||||
| 58 | ) || () ]; | ||||||||||||||||||||||||||||
| 59 | }, | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | 'SOAP::WSDL::Message' => 'get_part', | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | 0 | ▶ | 'SOAP::WSDL::Part' => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||
| 64 | 0 | my ($self, $node) = @_; | |||||||||||||||||||||||||||
| 65 | 0 | my $ident = ident $self; | |||||||||||||||||||||||||||
| 66 | 0 | ▶ | my $types = $types_of{ $ident } = $definitions_of{ $ident }->get_types()->[0] | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 67 | or return []; | ||||||||||||||||||||||||||||
| 68 | return [ | ||||||||||||||||||||||||||||
| 69 | # If we have a type, this type is to be used in document/literal | ||||||||||||||||||||||||||||
| 70 | # as global type. However this is forbidden, at least by WS-I. | ||||||||||||||||||||||||||||
| 71 | # We should store the style/encoding somewhere, and regard it. | ||||||||||||||||||||||||||||
| 72 | # TODO: auto-generate element for RPC bindings | ||||||||||||||||||||||||||||
| 73 | $node->get_type() | ||||||||||||||||||||||||||||
| 74 | 0 | ▶ | ? do { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 75 | 0 | ▶ | die "unsupported global type <" | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 76 | . $node->get_type . "> found in part <". $node->get_name() . ">\n" | ||||||||||||||||||||||||||||
| 77 | . "Looks like a rpc/literal WSDL, which is not supported by SOAP::WSDL\n"; | ||||||||||||||||||||||||||||
| 78 | ## use this once we can auto-generate an element for RPC bindings | ||||||||||||||||||||||||||||
| 79 | # $types->find_type( $node->expand($node->get_type) ) | ||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||
| 81 | : (), | ||||||||||||||||||||||||||||
| 82 | $node->get_element() | ||||||||||||||||||||||||||||
| 83 | ? $types->find_element( $node->expand($node->get_element) ) | ||||||||||||||||||||||||||||
| 84 | : (), | ||||||||||||||||||||||||||||
| 85 | ]; | ||||||||||||||||||||||||||||
| 86 | }, | ||||||||||||||||||||||||||||
| 87 | 1 | ); | |||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||
| 89 | 0 | ▶ | sub init { | ||||||||||||||||||||||||||
|
Subroutine
init: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 90 | 0 | my ($self, $arg_of) = @_; | |||||||||||||||||||||||||||
| 91 | 0 | my $ident = ident $self; | |||||||||||||||||||||||||||
| 92 | 0 | undef $portType_of{ $ident }; | |||||||||||||||||||||||||||
| 93 | 0 | undef $types_of{ $ident }; | |||||||||||||||||||||||||||
| 94 | $nodes_of{ $ident } = [ | ||||||||||||||||||||||||||||
| 95 | exists($arg_of->{ node }) | ||||||||||||||||||||||||||||
| 96 | ? $arg_of->{ node } | ||||||||||||||||||||||||||||
| 97 | 0 | ▶ | : $definitions_of{ ident $self } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 98 | ]; | ||||||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||
| 101 | 0 | ▶ | sub get_next { | ||||||||||||||||||||||||||
|
Subroutine
get_next: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 102 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 103 | 0 | my $ident = ident $self; | |||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||
| 105 | 0 | my $node = shift @{ $nodes_of{ $ident }}; | |||||||||||||||||||||||||||
| 106 | 0 | ▶ | return if ! defined $node; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||
| 108 | 0 | ▶ | unshift @{ $nodes_of{ $ident }}, @{ $self->get_nextNodes( $node ) || [] }; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->get_nextNodes($node) || []
MC/DC0%0/1
$self->get_nextNodes($node) || []
$self->get_nextNodes($node)
Truth table0%0/2
A
A= $self->get_nextNodes($node)
| |||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||
| 110 | 0 | return $node; | |||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||
| 113 | 0 | ▶ | sub get_nextNodes { | ||||||||||||||||||||||||||
|
Subroutine
get_nextNodes: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 114 | 0 | my ($self, $node) = @_; | |||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||
| 116 | 0 | ▶ | my $method = $METHOD_OF{ ref $node } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 117 | or return []; | ||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||
| 119 | 0 | ▶ | return (ref($method) eq 'CODE') | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 120 | ? $method->( $self, $node ) | ||||||||||||||||||||||||||||
| 121 | : $node->can($method)->( $node ); | ||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||
| 124 | 1 | 1; | |||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||
| 126 | __END__ | ||||||||||||||||||||||||||||