| 1 | package WWW::Salesforce::Deserializer; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 7 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | 7 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 5 | 7 | ▶ | use SOAP::Lite; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||
| 7 | 7 | our $VERSION = '0.401'; | |||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||
| 9 | 7 | our @ISA = qw( SOAP::Deserializer ); | |||||||||||||||||||||||||||||||
| 10 | 7 | ▶ | use strict 'refs'; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||
| 12 | 7 | our $XSD_NSPREFIX = "xsd"; | |||||||||||||||||||||||||||||||
| 13 | 7 | our $XSI_NSPREFIX = "xsi"; | |||||||||||||||||||||||||||||||
| 14 | 7 | our $SOAPENV_NSPREFIX = "SOAP-ENV"; | |||||||||||||||||||||||||||||||
| 15 | 7 | our $SOAPENC_NSPREFIX = "SOAP-ENC"; | |||||||||||||||||||||||||||||||
| 16 | 7 | our $NSPREFIX = "wsisup"; | |||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||
| 18 | 7 | ▶ | BEGIN { | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=12.4
| |||||||||||||||||||||||||||||||||
| 19 | 7 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 20 | 7 | for my $class (qw(LoginResult)) { | |||||||||||||||||||||||||||||||
| 21 | 7 | my $method_name = "as_" . $class; | |||||||||||||||||||||||||||||||
| 22 | 7 | my $class_name = "WWW::Salesforce::" . $class; | |||||||||||||||||||||||||||||||
| 23 | 7 | my $method_body = <<END_OF_SUB; | |||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||
| 25 | sub $method_name { | ||||||||||||||||||||||||||||||||
| 26 | my (\$self,\$f,\$name,\$attr) = splice(\@_,0,4); | ||||||||||||||||||||||||||||||||
| 27 | my \$ns = pop; | ||||||||||||||||||||||||||||||||
| 28 | my \$${class} = WWW::Salesforce::${class}->new; | ||||||||||||||||||||||||||||||||
| 29 | foreach my \$elem (\@_) { | ||||||||||||||||||||||||||||||||
| 30 | \$elem = shift \@\$elem if (ref(\$elem->[0]) eq 'ARRAY'); | ||||||||||||||||||||||||||||||||
| 31 | my (\$name2, \$attr2, \$value2, \$ns2) = splice(\@{\$elem},0,4); | ||||||||||||||||||||||||||||||||
| 32 | my (\$pre2,\$type2) = (\${attr2}->{\$XSI_NSPREFIX.":type"} =~ /([^:]*):(.*)/); | ||||||||||||||||||||||||||||||||
| 33 | if (\$pre2 && \$pre2 eq \$XSD_NSPREFIX) { | ||||||||||||||||||||||||||||||||
| 34 | \$${class}->{'_'.\$name2} = \$value2; | ||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||
| 36 | else { | ||||||||||||||||||||||||||||||||
| 37 | my \$cmd = '\$self->as_'.\$type2.'(\$f,\@\$value2);'; | ||||||||||||||||||||||||||||||||
| 38 | \$${class}->{'_'.\$name2} = eval \$cmd; | ||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||||||
| 41 | return \$${class}; | ||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||
| 43 | END_OF_SUB | ||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||
| 45 | # print STDERR $method_body; | ||||||||||||||||||||||||||||||||
| 46 | # *$method_name = eval $method_body; | ||||||||||||||||||||||||||||||||
| 47 | 0 | ▶ | eval $method_body; | ||||||||||||||||||||||||||||||
|
Subroutine
as_LoginResult: not called CC=5 SCAR=32.8
Pod
undocumented
Branch: 2 branches
Condition0%0/3
$pre2 and $pre2 eq $WWW::Salesforce::Deserializer::XSD_NSPREFIX
MC/DC0%0/2
$pre2 and $pre2 eq $WWW::Salesforce::Deserializer::XSD_NSPREFIX
$pre2
$pre2 eq $WWW::Salesforce::Deserializer::XSD_NSPREFIX
Truth table0%0/3
A and B
A= $pre2B= $pre2 eq $WWW::Salesforce::Deserializer::XSD_NSPREFIX
| |||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||
| 51 | #************************************************************************** | ||||||||||||||||||||||||||||||||
| 52 | # as_Array() | ||||||||||||||||||||||||||||||||
| 53 | # -- returns the data as an array | ||||||||||||||||||||||||||||||||
| 54 | #************************************************************************** | ||||||||||||||||||||||||||||||||
| 55 | 0 | ▶ | sub as_Array { | ||||||||||||||||||||||||||||||
|
Subroutine
as_Array: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 56 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 57 | 0 | my $f = shift; | |||||||||||||||||||||||||||||||
| 58 | 0 | my @Array; | |||||||||||||||||||||||||||||||
| 59 | 0 | foreach my $elem (@_) { | |||||||||||||||||||||||||||||||
| 60 | 0 | my ( $name, $attr, $value, $ns ) = splice( @$elem, 0, 4 ); | |||||||||||||||||||||||||||||||
| 61 | 0 | my $attrv = ${attr}->{ $XSI_NSPREFIX . ":type" }; | |||||||||||||||||||||||||||||||
| 62 | 0 | my ( $pre, $type ) = ( $attrv =~ /([^:]*):(.*)/ ); | |||||||||||||||||||||||||||||||
| 63 | 0 | my $result; | |||||||||||||||||||||||||||||||
| 64 | 0 | ▶ | if ( $pre eq $XSD_NSPREFIX ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 65 | 0 | $result = $value; | |||||||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||||||
| 67 | else { | ||||||||||||||||||||||||||||||||
| 68 | 0 | my $cmd = | |||||||||||||||||||||||||||||||
| 69 | '$self->as_' . $type . '(1, $name, $attr, @$value, $ns );'; | ||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||
| 71 | # print STDERR $cmd . "\n"; | ||||||||||||||||||||||||||||||||
| 72 | 0 | $result = eval $cmd; | |||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||
| 74 | 0 | push( @Array, $result ); | |||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||
| 76 | 0 | return \@Array; | |||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||
| 79 | 7 | 1; | |||||||||||||||||||||||||||||||