« Shipment/Purolator/WSDL/Interfaces/EstimatingService/EstimatingServiceEndpoint.pm
↑ Summary
Shipment/Purolator/WSDLV2/Interfaces/EstimatingService/EstimatingServiceEndpoint.pm »
| 1 | package Shipment::Purolator::WSDL::Interfaces::ShippingDocumentsService::ShippingDocumentsServiceEndpoint; | ||
| 2 | $Shipment::Purolator::WSDL::Interfaces::ShippingDocumentsService::ShippingDocumentsServiceEndpoint::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::ShippingDocumentsService | ||
| 12 | if not Shipment::Purolator::WSDL::Typemaps::ShippingDocumentsService->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/ShippingDocuments/ShippingDocumentsService.asmx') | ||
| 23 | if not $_[2]->{proxy}; | ||
| 24 | |||
| 25 | $_[0]->set_class_resolver( | ||
| 26 | 'Shipment::Purolator::WSDL::Typemaps::ShippingDocumentsService') | ||
| 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 GetDocuments { | ||
| 46 | my ($self, $body, $header) = @_; | ||
| 47 | die "GetDocuments must be called as object method (\$self is <$self>)" | ||
| 48 | if not blessed($self); | ||
| 49 | return $self->SUPER::call( | ||
| 50 | { operation => 'GetDocuments', | ||
| 51 | soap_action => 'http://purolator.com/pws/service/v1/GetDocuments', | ||
| 52 | style => 'document', | ||
| 53 | body => { | ||
| 54 | |||
| 55 | |||
| 56 | 'use' => 'literal', | ||
| 57 | namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', | ||
| 58 | encodingStyle => '', | ||
| 59 | parts => [ | ||
| 60 | qw( Shipment::Purolator::WSDL::Elements::GetDocumentsRequest ) | ||
| 61 | ], | ||
| 62 | }, | ||
| 63 | header => { | ||
| 64 | |||
| 65 | 'use' => 'literal', | ||
| 66 | namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', | ||
| 67 | encodingStyle => '', | ||
| 68 | parts => | ||
| 69 | [qw( Shipment::Purolator::WSDL::Elements::RequestContext )], | ||
| 70 | |||
| 71 | }, | ||
| 72 | headerfault => { | ||
| 73 | |||
| 74 | }, | ||
| 75 | response => { | ||
| 76 | header => { | ||
| 77 | |||
| 78 | |||
| 79 | 'use' => 'literal', | ||
| 80 | namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', | ||
| 81 | encodingStyle => '', | ||
| 82 | parts => [ | ||
| 83 | qw( Shipment::Purolator::WSDL::Elements::ResponseContext ) | ||
| 84 | ], | ||
| 85 | }, | ||
| 86 | body => { | ||
| 87 | |||
| 88 | |||
| 89 | 'use' => 'literal', | ||
| 90 | namespace => 'http://schemas.xmlsoap.org/wsdl/soap/', | ||
| 91 | encodingStyle => '', | ||
| 92 | parts => [ | ||
| 93 | qw( Shipment::Purolator::WSDL::Elements::GetDocumentsResponse ) | ||
| 94 | ], | ||
| 95 | }, | ||
| 96 | } | ||
| 97 | }, | ||
| 98 | $body, | ||
| 99 | $header | ||
| 100 | ); | ||
| 101 | } | ||
| 102 | |||
| 103 | |||
| 104 | sub GetShipmentManifestDocument { | ||
| 105 | my ($self, $body, $header) = @_; | ||
| 106 | die | ||
| 107 | "GetShipmentManifestDocument must be called as object method (\$self is <$self>)" | ||
| 108 | if not blessed($self); | ||
| 109 | return $self->SUPER::call( | ||
| 110 | { operation => 'GetShipmentManifestDocument', | ||
| 111 | soap_action => | ||
| 112 | 'http://purolator.com/pws/service/v1/GetShipmentManifestDocument', | ||
| 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::GetShipmentManifestDocumentRequest ) | ||
| 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::GetShipmentManifestDocumentResponse ) | ||
| 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__ |