File Coverage

blib/lib/SOAP/XML/Client/DotNet.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1             package SOAP::XML::Client::DotNet;
2             $SOAP::XML::Client::DotNet::VERSION = '2.8';
3 1     1   24604 use strict;
  1         1  
  1         31  
4 1     1   5 use Carp;
  1         2  
  1         56  
5 1     1   4 use Scalar::Util qw(weaken);
  1         1  
  1         36  
6              
7 1     1   3 use base qw(SOAP::XML::Client);
  1         2  
  1         544  
8              
9             # The actual call to a .net server
10             sub _call {
11             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             my $this = $self;
18             weaken($this); # weaken to avoid circular references
19             my $soap_action = sub { return $this->uri() . '/' . $method };
20              
21             my $caller;
22             eval {
23             $caller
24             = $self->{soap}->uri( $self->uri() )
25             ->proxy( $self->proxy(), timeout => $self->timeout() )
26             ->encoding( $self->encoding )->on_action($soap_action);
27             };
28             if ($@) {
29             warn "error for uri:" . $self->uri . "\n";
30             die $@;
31             }
32              
33             $caller->soapversion( $self->soapversion() );
34              
35             # Create a SOAP::Data node for the method name
36             my $method_name
37             = SOAP::Data->name($method)->attr( { 'xmlns' => $self->xmlns() } );
38              
39             my @params = ( $self->{sdb}->to_soap_data() );
40             unshift( @params, $self->header() ) if $self->header();
41              
42             # Execute the SOAP Request and get the resulting XML
43             my $res = $caller->call( $method_name => @params );
44              
45             return $res, $caller->transport;
46             }
47              
48             1;
49              
50             __END__