Shipment/Purolator/WSDL/Interfaces/ServiceAvailabilityService/ServiceAvailabilityServiceEndpoint.pm untested

filter: Statementstmt 0.0% 0 / 77 Branchbran 0.0% 0 / 16 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 12 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 113 CC 8 SCAR 23.6
CC
8
Cov
0%
START
30.0
GetServicesOptions
6.0
GetServiceRules
6.0
CRAP 10.6
1 package Shipment::Purolator::WSDL::Interfaces::ServiceAvailabilityService::ServiceAvailabilityServiceEndpoint;
2 $Shipment::Purolator::WSDL::Interfaces::ServiceAvailabilityService::ServiceAvailabilityServiceEndpoint::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::ServiceAvailabilityService
12 if not Shipment::Purolator::WSDL::Typemaps::ServiceAvailabilityService->can(
13 '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/ServiceAvailability/ServiceAvailabilityService.asmx')
23 if not $_[2]->{proxy};
24  
25 $_[0]->set_class_resolver(
26 'Shipment::Purolator::WSDL::Typemaps::ServiceAvailabilityService')
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  
46 sub GetServicesOptions {
47 my ($self, $body, $header) = @_;
48 die
49 "GetServicesOptions must be called as object method (\$self is <$self>)"
50 if not blessed($self);
51 return $self->SUPER::call(
52 { operation => 'GetServicesOptions',
53 soap_action =>
54 'http://purolator.com/pws/service/v1/GetServicesOptions',
55 style => 'document',
56 body => {
57  
58  
59 'use' => 'literal',
60 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
61 encodingStyle => '',
62 parts => [
63 qw( Shipment::Purolator::WSDL::Elements::GetServicesOptionsRequest )
64 ],
65 },
66 header => {
67  
68 'use' => 'literal',
69 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
70 encodingStyle => '',
71 parts =>
72 [qw( Shipment::Purolator::WSDL::Elements::RequestContext )],
73  
74 },
75 headerfault => {
76  
77 },
78 response => {
79 header => {
80  
81  
82 'use' => 'literal',
83 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
84 encodingStyle => '',
85 parts => [
86 qw( Shipment::Purolator::WSDL::Elements::ResponseContext )
87 ],
88 },
89 body => {
90  
91  
92 'use' => 'literal',
93 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
94 encodingStyle => '',
95 parts => [
96 qw( Shipment::Purolator::WSDL::Elements::GetServicesOptionsResponse )
97 ],
98 },
99 }
100 },
101 $body,
102 $header
103 );
104 }
105  
106  
107 sub GetServiceRules {
108 my ($self, $body, $header) = @_;
109 die "GetServiceRules must be called as object method (\$self is <$self>)"
110 if not blessed($self);
111 return $self->SUPER::call(
112 { operation => 'GetServiceRules',
113 soap_action =>
114 'http://purolator.com/pws/service/v1/GetServiceRules',
115 style => 'document',
116 body => {
117  
118  
119 'use' => 'literal',
120 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
121 encodingStyle => '',
122 parts => [
123 qw( Shipment::Purolator::WSDL::Elements::GetServiceRulesRequest )
124 ],
125 },
126 header => {
127  
128 'use' => 'literal',
129 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
130 encodingStyle => '',
131 parts =>
132 [qw( Shipment::Purolator::WSDL::Elements::RequestContext )],
133  
134 },
135 headerfault => {
136  
137 },
138 response => {
139 header => {
140  
141  
142 'use' => 'literal',
143 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
144 encodingStyle => '',
145 parts => [
146 qw( Shipment::Purolator::WSDL::Elements::ResponseContext )
147 ],
148 },
149 body => {
150  
151  
152 'use' => 'literal',
153 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
154 encodingStyle => '',
155 parts => [
156 qw( Shipment::Purolator::WSDL::Elements::GetServiceRulesResponse )
157 ],
158 },
159 }
160 },
161 $body,
162 $header
163 );
164 }
165  
166  
167 sub ValidateCityPostalCodeZip {
168 my ($self, $body, $header) = @_;
169 die
170 "ValidateCityPostalCodeZip must be called as object method (\$self is <$self>)"
171 if not blessed($self);
172 return $self->SUPER::call(
173 { operation => 'ValidateCityPostalCodeZip',
174 soap_action =>
175 'http://purolator.com/pws/service/v1/ValidateCityPostalCodeZip',
176 style => 'document',
177 body => {
178  
179  
180 'use' => 'literal',
181 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
182 encodingStyle => '',
183 parts => [
184 qw( Shipment::Purolator::WSDL::Elements::ValidateCityPostalCodeZipRequest )
185 ],
186 },
187 header => {
188  
189 'use' => 'literal',
190 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
191 encodingStyle => '',
192 parts =>
193 [qw( Shipment::Purolator::WSDL::Elements::RequestContext )],
194  
195 },
196 headerfault => {
197  
198 },
199 response => {
200 header => {
201  
202  
203 'use' => 'literal',
204 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
205 encodingStyle => '',
206 parts => [
207 qw( Shipment::Purolator::WSDL::Elements::ResponseContext )
208 ],
209 },
210 body => {
211  
212  
213 'use' => 'literal',
214 namespace => 'http://schemas.xmlsoap.org/wsdl/soap/',
215 encodingStyle => '',
216 parts => [
217 qw( Shipment::Purolator::WSDL::Elements::ValidateCityPostalCodeZipResponse )
218 ],
219 },
220 }
221 },
222 $body,
223 $header
224 );
225 }
226  
227  
228 sub _get_name_resolver {
229  
230 my $prefix_1 = {
231 'attribute' => 'Shipment::Purolator::WSDL::Attributes',
232 'typemap' => 'Shipment::Purolator::WSDL::Typemaps',
233 'interface' => 'Shipment::Purolator::WSDL::Interfaces',
234 'type' => 'Shipment::Purolator::WSDL::Types',
235 'server' => 'Shipment::Purolator::WSDL::Server',
236 'element' => 'Shipment::Purolator::WSDL::Elements'
237 };
238  
239  
240 return SOAP::WSDL::Generator::Template::Plugin::XSD->new(
241 { prefix_resolver => SOAP::WSDL::Generator::PrefixResolver->new(
242 { namespace_prefix_map => {
243 'http://www.w3.org/2001/XMLSchema' =>
244 'SOAP::WSDL::XSD::Typelib::Builtin',
245 },
246 namespace_map => {},
247 prefix => $prefix_1,
248 }
249 )
250 }
251 );
252 }
253  
254 1;
255  
256 __END__