| 1 | package Shipment::Purolator::WSDLV2::Interfaces::ServiceAvailabilityService::ServiceAvailabilityServiceEndpoint; | ||
| 2 | $Shipment::Purolator::WSDLV2::Interfaces::ServiceAvailabilityService::ServiceAvailabilityServiceEndpoint::VERSION = '3.11'; | ||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use Class::Std::Fast::Storable; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use Scalar::Util qw(blessed); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | ▶ | use base qw(SOAP::WSDL::Client::Base); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | |||
| 10 | # only load if it hasn't been loaded before | ||
| 11 | require Shipment::Purolator::WSDLV2::Typemaps::ServiceAvailabilityService | ||
| 12 | if | ||
| 13 | not Shipment::Purolator::WSDLV2::Typemaps::ServiceAvailabilityService->can( | ||
| 14 | 'get_class'); | ||
| 15 | |||
| 16 | |||
| 17 | sub START { | ||
| 18 | |||
| 19 | my $proxy_domain = $_[2]->{proxy_domain} || 'devwebservices.purolator.com'; | ||
| 20 | |||
| 21 | $_[0]->set_proxy('https://' | ||
| 22 | . $proxy_domain | ||
| 23 | . '/EWS/V2/ServiceAvailability/ServiceAvailabilityService.asmx') | ||
| 24 | if not $_[2]->{proxy}; | ||
| 25 | |||
| 26 | $_[0]->set_class_resolver( | ||
| 27 | 'Shipment::Purolator::WSDLV2::Typemaps::ServiceAvailabilityService') | ||
| 28 | if not $_[2]->{class_resolver}; | ||
| 29 | |||
| 30 | $_[0]->set_prefix($_[2]->{use_prefix}) if exists $_[2]->{use_prefix}; | ||
| 31 | |||
| 32 | my $options = $_[2]; | ||
| 33 | ## provide credentials | ||
| 34 | eval { use SOAP::Lite; }; | ||
| 35 | if ($@) { | ||
| 36 | warn "SOAP::Lite not installed, using builtin SOAP::WSDL Transport"; | ||
| 37 | *SOAP::WSDL::Transport::HTTP::get_basic_credentials = | ||
| 38 | sub { return ($options->{key}, $options->{password}); }; | ||
| 39 | } | ||
| 40 | else { | ||
| 41 | *SOAP::Transport::HTTP::Client::get_basic_credentials = | ||
| 42 | sub { return ($options->{key}, $options->{password}); }; | ||
| 43 | } | ||
| 44 | |||
| 45 | } | ||
| 46 | |||
| 47 | sub GetServicesOptions { | ||
| 48 | my ($self, $body, $header) = @_; | ||
| 49 | die | ||
| 50 | "GetServicesOptions must be called as object method (\$self is <$self>)" | ||
| 51 | if not blessed($self); | ||
| 52 | return $self->SUPER::call( | ||
| 53 | { operation => 'GetServicesOptions', | ||
| 54 | soap_action => | ||
| 55 | 'http://purolator.com/pws/service/v2/GetServicesOptions', | ||
| 56 | style => 'document', | ||
| 57 | body => { | ||
| 58 | |||
| 59 | |||
| 60 | 'use' => 'literal', | ||
| 61 | namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', | ||
| 62 | encodingStyle => '', | ||
| 63 | parts => [ | ||
| 64 | qw( Shipment::Purolator::WSDLV2::Elements::GetServicesOptionsRequest ) | ||
| 65 | ], | ||
| 66 | }, | ||
| 67 | header => { | ||
| 68 | |||
| 69 | 'use' => 'literal', | ||
| 70 | namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', | ||
| 71 | encodingStyle => '', | ||
| 72 | parts => [ | ||
| 73 | qw( Shipment::Purolator::WSDLV2::Elements::RequestContext ) | ||
| 74 | ], | ||
| 75 | |||
| 76 | }, | ||
| 77 | headerfault => { | ||
| 78 | |||
| 79 | }, | ||
| 80 | response => { | ||
| 81 | header => { | ||
| 82 | |||
| 83 | |||
| 84 | 'use' => 'literal', | ||
| 85 | namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', | ||
| 86 | encodingStyle => '', | ||
| 87 | parts => [ | ||
| 88 | qw( Shipment::Purolator::WSDLV2::Elements::ResponseContext ) | ||
| 89 | ], | ||
| 90 | }, | ||
| 91 | body => { | ||
| 92 | |||
| 93 | |||
| 94 | 'use' => 'literal', | ||
| 95 | namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', | ||
| 96 | encodingStyle => '', | ||
| 97 | parts => [ | ||
| 98 | qw( Shipment::Purolator::WSDLV2::Elements::GetServicesOptionsResponse ) | ||
| 99 | ], | ||
| 100 | }, | ||
| 101 | } | ||
| 102 | }, | ||
| 103 | $body, | ||
| 104 | $header | ||
| 105 | ); | ||
| 106 | } | ||
| 107 | |||
| 108 | |||
| 109 | sub GetServiceRules { | ||
| 110 | my ($self, $body, $header) = @_; | ||
| 111 | die "GetServiceRules must be called as object method (\$self is <$self>)" | ||
| 112 | if not blessed($self); | ||
| 113 | return $self->SUPER::call( | ||
| 114 | { operation => 'GetServiceRules', | ||
| 115 | soap_action => | ||
| 116 | 'http://purolator.com/pws/service/v2/GetServiceRules', | ||
| 117 | style => 'document', | ||
| 118 | body => { | ||
| 119 | |||
| 120 | |||
| 121 | 'use' => 'literal', | ||
| 122 | namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', | ||
| 123 | encodingStyle => '', | ||
| 124 | parts => [ | ||
| 125 | qw( Shipment::Purolator::WSDLV2::Elements::GetServiceRulesRequest ) | ||
| 126 | ], | ||
| 127 | }, | ||
| 128 | header => { | ||
| 129 | |||
| 130 | 'use' => 'literal', | ||
| 131 | namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', | ||
| 132 | encodingStyle => '', | ||
| 133 | parts => [ | ||
| 134 | qw( Shipment::Purolator::WSDLV2::Elements::RequestContext ) | ||
| 135 | ], | ||
| 136 | |||
| 137 | }, | ||
| 138 | headerfault => { | ||
| 139 | |||
| 140 | }, | ||
| 141 | response => { | ||
| 142 | header => { | ||
| 143 | |||
| 144 | |||
| 145 | 'use' => 'literal', | ||
| 146 | namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', | ||
| 147 | encodingStyle => '', | ||
| 148 | parts => [ | ||
| 149 | qw( Shipment::Purolator::WSDLV2::Elements::ResponseContext ) | ||
| 150 | ], | ||
| 151 | }, | ||
| 152 | body => { | ||
| 153 | |||
| 154 | |||
| 155 | 'use' => 'literal', | ||
| 156 | namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', | ||
| 157 | encodingStyle => '', | ||
| 158 | parts => [ | ||
| 159 | qw( Shipment::Purolator::WSDLV2::Elements::GetServiceRulesResponse ) | ||
| 160 | ], | ||
| 161 | }, | ||
| 162 | } | ||
| 163 | }, | ||
| 164 | $body, | ||
| 165 | $header | ||
| 166 | ); | ||
| 167 | } | ||
| 168 | |||
| 169 | |||
| 170 | sub ValidateCityPostalCodeZip { | ||
| 171 | my ($self, $body, $header) = @_; | ||
| 172 | die | ||
| 173 | "ValidateCityPostalCodeZip must be called as object method (\$self is <$self>)" | ||
| 174 | if not blessed($self); | ||
| 175 | return $self->SUPER::call( | ||
| 176 | { operation => 'ValidateCityPostalCodeZip', | ||
| 177 | soap_action => | ||
| 178 | 'http://purolator.com/pws/service/v2/ValidateCityPostalCodeZip', | ||
| 179 | style => 'document', | ||
| 180 | body => { | ||
| 181 | |||
| 182 | |||
| 183 | 'use' => 'literal', | ||
| 184 | namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', | ||
| 185 | encodingStyle => '', | ||
| 186 | parts => [ | ||
| 187 | qw( Shipment::Purolator::WSDLV2::Elements::ValidateCityPostalCodeZipRequest ) | ||
| 188 | ], | ||
| 189 | }, | ||
| 190 | header => { | ||
| 191 | |||
| 192 | 'use' => 'literal', | ||
| 193 | namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', | ||
| 194 | encodingStyle => '', | ||
| 195 | parts => [ | ||
| 196 | qw( Shipment::Purolator::WSDLV2::Elements::RequestContext ) | ||
| 197 | ], | ||
| 198 | |||
| 199 | }, | ||
| 200 | headerfault => { | ||
| 201 | |||
| 202 | }, | ||
| 203 | response => { | ||
| 204 | header => { | ||
| 205 | |||
| 206 | |||
| 207 | 'use' => 'literal', | ||
| 208 | namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', | ||
| 209 | encodingStyle => '', | ||
| 210 | parts => [ | ||
| 211 | qw( Shipment::Purolator::WSDLV2::Elements::ResponseContext ) | ||
| 212 | ], | ||
| 213 | }, | ||
| 214 | body => { | ||
| 215 | |||
| 216 | |||
| 217 | 'use' => 'literal', | ||
| 218 | namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', | ||
| 219 | encodingStyle => '', | ||
| 220 | parts => [ | ||
| 221 | qw( Shipment::Purolator::WSDLV2::Elements::ValidateCityPostalCodeZipResponse ) | ||
| 222 | ], | ||
| 223 | }, | ||
| 224 | } | ||
| 225 | }, | ||
| 226 | $body, | ||
| 227 | $header | ||
| 228 | ); | ||
| 229 | } | ||
| 230 | |||
| 231 | |||
| 232 | sub _get_name_resolver { | ||
| 233 | |||
| 234 | my $prefix_1 = { | ||
| 235 | 'attribute' => 'Shipment::Purolator::WSDLV2::Attributes', | ||
| 236 | 'typemap' => 'Shipment::Purolator::WSDLV2::Typemaps', | ||
| 237 | 'interface' => 'Shipment::Purolator::WSDLV2::Interfaces', | ||
| 238 | 'type' => 'Shipment::Purolator::WSDLV2::Types', | ||
| 239 | 'server' => 'Shipment::Purolator::WSDLV2::Server', | ||
| 240 | 'element' => 'Shipment::Purolator::WSDLV2::Elements' | ||
| 241 | }; | ||
| 242 | |||
| 243 | |||
| 244 | return SOAP::WSDL::Generator::Template::Plugin::XSD->new( | ||
| 245 | { prefix_resolver => SOAP::WSDL::Generator::PrefixResolver->new( | ||
| 246 | { namespace_prefix_map => { | ||
| 247 | 'http://www.w3.org/2001/XMLSchema' => | ||
| 248 | 'SOAP::WSDL::XSD::Typelib::Builtin', | ||
| 249 | }, | ||
| 250 | namespace_map => {}, | ||
| 251 | prefix => $prefix_1, | ||
| 252 | } | ||
| 253 | ) | ||
| 254 | } | ||
| 255 | ); | ||
| 256 | } | ||
| 257 | |||
| 258 | 1; | ||
| 259 | |||
| 260 | __END__ | ||