| 1 | package SOAP::XML::Client::DotNet; | ||||||||||
| 2 | 1 | $SOAP::XML::Client::DotNet::VERSION = '2.8'; | |||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use Scalar::Util qw(weaken); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use base qw(SOAP::XML::Client); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | # The actual call to a .net server | ||||||||||
| 10 | 0 | ▶ | sub _call { | ||||||||
|
Subroutine
_call: not called CC=3 SCAR=24.8
| |||||||||||
| 11 | 0 | my ( $self, $method ) = @_; | |||||||||
| 12 | |||||||||||
| 13 | # No, I don't know why this has to be a sub, it just does, | ||||||||||
| 14 | # it's to do with the on_action which .net requires so it | ||||||||||
| 15 | # submits as $uri/$method, rather than $uri#$method | ||||||||||
| 16 | |||||||||||
| 17 | 0 | my $this = $self; | |||||||||
| 18 | 0 | weaken($this); # weaken to avoid circular references | |||||||||
| 19 | 0 | ▶ | my $soap_action = sub { return $this->uri() . '/' . $method }; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 20 | |||||||||||
| 21 | 0 | my $caller; | |||||||||
| 22 | 0 | eval { | |||||||||
| 23 | $caller | ||||||||||
| 24 | 0 | = $self->{soap}->uri( $self->uri() ) | |||||||||
| 25 | ->proxy( $self->proxy(), timeout => $self->timeout() ) | ||||||||||
| 26 | ->encoding( $self->encoding )->on_action($soap_action); | ||||||||||
| 27 | }; | ||||||||||
| 28 | 0 | ▶ | if ($@) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | 0 | warn "error for uri:" . $self->uri . "\n"; | |||||||||
| 30 | 0 | die $@; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 0 | $caller->soapversion( $self->soapversion() ); | |||||||||
| 34 | |||||||||||
| 35 | # Create a SOAP::Data node for the method name | ||||||||||
| 36 | 0 | my $method_name | |||||||||
| 37 | = SOAP::Data->name($method)->attr( { 'xmlns' => $self->xmlns() } ); | ||||||||||
| 38 | |||||||||||
| 39 | 0 | my @params = ( $self->{sdb}->to_soap_data() ); | |||||||||
| 40 | 0 | ▶ | unshift( @params, $self->header() ) if $self->header(); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 41 | |||||||||||
| 42 | # Execute the SOAP Request and get the resulting XML | ||||||||||
| 43 | 0 | my $res = $caller->call( $method_name => @params ); | |||||||||
| 44 | |||||||||||
| 45 | 0 | return $res, $caller->transport; | |||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | 1 | 1; | |||||||||
| 49 | |||||||||||
| 50 | __END__ | ||||||||||