Shipment/Purolator/WSDL/Interfaces/EstimatingService/EstimatingServiceEndpoint.pm untested

filter: Statementstmt 0.0% 0 / 65 Branchbran 0.0% 0 / 14 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 11 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 97 CC 7 SCAR 24.1
CC
7
Cov
0%
START
30.0
GetQuickEstimate
6.0
GetFullEstimate
6.0
CRAP 11.2
1 package Shipment::Purolator::WSDL::Interfaces::EstimatingService::EstimatingServiceEndpoint;
2 $Shipment::Purolator::WSDL::Interfaces::EstimatingService::EstimatingServiceEndpoint::VERSION = '3.11';
3 use strict;
4 use warnings;
5 use Class::Std::Fast::Storable;
6 use Scalar::Util qw(blessed);
7 use base qw(SOAP::WSDL::Client::Base);
8  
9  
10 # only load if it hasn't been loaded before
11 require Shipment::Purolator::WSDL::Typemaps::EstimatingService
12 if
13 not Shipment::Purolator::WSDL::Typemaps::EstimatingService->can('get_class');
14  
15  
16 sub START {
17  
18 my $proxy_domain = $_[2]->{proxy_domain} || 'devwebservices.purolator.com';
19  
20 $_[0]->set_proxy('https://'
21 . $proxy_domain
22 . '/EWS/V1/Estimating/EstimatingService.asmx')
23 if not $_[2]->{proxy};
24  
25 $_[0]->set_class_resolver(
26 'Shipment::Purolator::WSDL::Typemaps::EstimatingService')
27 if not $_[2]->{class_resolver};
28  
29 $_[0]->set_prefix($_[2]->{use_prefix}) if exists $_[2]->{use_prefix};
30  
31 my $options = $_[2];
32 ## provide credentials
33 eval { use SOAP::Lite; };
34 if ($@) {
35 warn "SOAP::Lite not installed, using builtin SOAP::WSDL Transport";
36 *SOAP::WSDL::Transport::HTTP::get_basic_credentials =
37 sub { return ($options->{key}, $options->{password}); };
38 }
39 else {
40 *SOAP::Transport::HTTP::Client::get_basic_credentials =
41 sub { return ($options->{key}, $options->{password}); };
42 }
43 }
44  
45 sub GetQuickEstimate {
46 my ($self, $body, $header) = @_;
47 die "GetQuickEstimate must be called as object method (\$self is <$self>)"
48 if not blessed($self);
49 return $self->SUPER::call(
50 { operation => 'GetQuickEstimate',
51 soap_action =>
52 'http://purolator.com/pws/service/v1/GetQuickEstimate',
53 style => 'document',
54 body => {
55  
56  
57 'use' => 'literal',
58 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
59 encodingStyle => '',
60 parts => [
61 qw( Shipment::Purolator::WSDL::Elements::GetQuickEstimateRequest )
62 ],
63 },
64 header => {
65  
66 'use' => 'literal',
67 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
68 encodingStyle => '',
69 parts =>
70 [qw( Shipment::Purolator::WSDL::Elements::RequestContext )],
71  
72 },
73 headerfault => {
74  
75 },
76 response => {
77 header => {
78  
79  
80 'use' => 'literal',
81 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
82 encodingStyle => '',
83 parts => [
84 qw( Shipment::Purolator::WSDL::Elements::ResponseContext )
85 ],
86 },
87 body => {
88  
89  
90 'use' => 'literal',
91 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
92 encodingStyle => '',
93 parts => [
94 qw( Shipment::Purolator::WSDL::Elements::GetQuickEstimateResponse )
95 ],
96 },
97 }
98 },
99 $body,
100 $header
101 );
102 }
103  
104  
105 sub GetFullEstimate {
106 my ($self, $body, $header) = @_;
107 die "GetFullEstimate must be called as object method (\$self is <$self>)"
108 if not blessed($self);
109 return $self->SUPER::call(
110 { operation => 'GetFullEstimate',
111 soap_action =>
112 'http://purolator.com/pws/service/v1/GetFullEstimate',
113 style => 'document',
114 body => {
115  
116  
117 'use' => 'literal',
118 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
119 encodingStyle => '',
120 parts => [
121 qw( Shipment::Purolator::WSDL::Elements::GetFullEstimateRequest )
122 ],
123 },
124 header => {
125  
126 'use' => 'literal',
127 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
128 encodingStyle => '',
129 parts =>
130 [qw( Shipment::Purolator::WSDL::Elements::RequestContext )],
131  
132 },
133 headerfault => {
134  
135 },
136 response => {
137 header => {
138  
139  
140 'use' => 'literal',
141 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
142 encodingStyle => '',
143 parts => [
144 qw( Shipment::Purolator::WSDL::Elements::ResponseContext )
145 ],
146 },
147 body => {
148  
149  
150 'use' => 'literal',
151 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
152 encodingStyle => '',
153 parts => [
154 qw( Shipment::Purolator::WSDL::Elements::GetFullEstimateResponse )
155 ],
156 },
157 }
158 },
159 $body,
160 $header
161 );
162 }
163  
164  
165 sub _get_name_resolver {
166  
167 my $prefix_1 = {
168 'attribute' => 'Shipment::Purolator::WSDL::Attributes',
169 'typemap' => 'Shipment::Purolator::WSDL::Typemaps',
170 'interface' => 'Shipment::Purolator::WSDL::Interfaces',
171 'type' => 'Shipment::Purolator::WSDL::Types',
172 'server' => 'Shipment::Purolator::WSDL::Server',
173 'element' => 'Shipment::Purolator::WSDL::Elements'
174 };
175  
176  
177 return SOAP::WSDL::Generator::Template::Plugin::XSD->new(
178 { prefix_resolver => SOAP::WSDL::Generator::PrefixResolver->new(
179 { namespace_prefix_map => {
180 'http://www.w3.org/2001/XMLSchema' =>
181 'SOAP::WSDL::XSD::Typelib::Builtin',
182 },
183 namespace_map => {},
184 prefix => $prefix_1,
185 }
186 )
187 }
188 );
189 }
190  
191 1;
192  
193 __END__