fex 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,11 @@
1
+ require "base64"
2
+
3
+ module Fex
4
+ class ShipResponse < Response
5
+
6
+ def image
7
+ @image ||= Base64.decode64(xpath("//Label/Parts/Image").inner_text)
8
+ end
9
+
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ module Fex
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,14 @@
1
+ module Fex
2
+
3
+ MissingWSDL = Class.new(ArgumentError)
4
+
5
+ class WSDL
6
+
7
+ def path_for(service)
8
+ path = File.expand_path("../../../wsdl/#{service}.wsdl", __FILE__)
9
+ fail MissingWSDL, "Unknown service: #{path.inspect}" unless File.exist?(path)
10
+ path
11
+ end
12
+
13
+ end
14
+ end
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Address Validation Services", :production_environment do
4
+
5
+ example "Address Validation" do
6
+
7
+ client = Fex.client(credentials: credentials, mode: mode, client: { logger: logger})
8
+ service = client.service(:address_validation)
9
+ response = service.call(:address_validation,
10
+ request_timestamp: Time.now.utc.iso8601(2),
11
+ options: {
12
+ check_residential_status: 1,
13
+ },
14
+ addresses_to_validate: {
15
+ address_id: "String",
16
+ company_name: "String",
17
+ address: {
18
+ street_lines: "475 PARK AVE S FL 11",
19
+ city: "NEWYORK",
20
+ state_or_province_code: "NY",
21
+ postal_code: "10016",
22
+ urbanization_code: "String",
23
+ residential: 1
24
+ }
25
+ }
26
+ )
27
+ response.severity.should eq "SUCCESS"
28
+ end
29
+
30
+ end
@@ -0,0 +1,67 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Rate Service", :test_environment do
4
+
5
+ example "Get Rates" do
6
+
7
+ client = Fex.client(credentials: credentials, mode: mode, client: { logger: logger })
8
+ service = client.service(:rate)
9
+ response = service.call(:get_rates,
10
+ requested_shipment: {
11
+ ship_timestamp: Time.now.utc.iso8601(2),
12
+ dropoff_type: "REGULAR_PICKUP",
13
+ service_type: "PRIORITY_OVERNIGHT",
14
+ packaging_type: "YOUR_PACKAGING",
15
+ shipper: {
16
+ contact: {
17
+ contact_id: "SY32030",
18
+ person_name: "Sunil Yadav",
19
+ company_name: "Syntel Inc",
20
+ phone_number: "9545871684",
21
+ phone_extension: "020",
22
+ e_mail_address: "sunil_yadav3@syntelinc.com"
23
+ },
24
+ address: {
25
+ street_lines: [ "SHIPPER ADDRESS LINE 1", "SHIPPER ADDRESS LINE 2" ],
26
+ city: "COLORADO SPRINGS",
27
+ state_or_province_code: "CO",
28
+ postal_code: "80915",
29
+ urbanization_code: "CO",
30
+ country_code: "US",
31
+ residential: 0
32
+ }
33
+ },
34
+ recipient: {
35
+ contact: {
36
+ person_name: "Receipient",
37
+ company_name: "Receiver Org",
38
+ phone_number: "9982145555",
39
+ phone_extension: "011",
40
+ e_mail_address: "receiver@yahoo.com"
41
+ },
42
+ address: {
43
+ street_lines: [ "RECIPIENT ADDRESS LINE 1", "RECIPIENT ADDRESS LINE 2" ],
44
+ city: "DENVER",
45
+ state_or_province_code: "CO",
46
+ postal_code: "80204",
47
+ urbanization_code: "CO",
48
+ country_code: "US",
49
+ residential: 0
50
+ }
51
+ },
52
+ requested_package_line_items: [
53
+ {
54
+ sequence_number: 1,
55
+ group_number: 1,
56
+ group_package_count: 1,
57
+ weight: { units: "LB", value: "20.0" },
58
+ dimensions: { length: 12, width: 12, height: 12, units: "IN" },
59
+ physical_packaging: "BAG",
60
+ }
61
+ ]
62
+ }
63
+ )
64
+ response.severity.should eq "WARNING"
65
+ end
66
+
67
+ end
@@ -0,0 +1,88 @@
1
+ require 'spec_helper'
2
+ require 'base64'
3
+
4
+ describe "Ship Service", :test_environment do
5
+
6
+ example "Process Shipment" do
7
+
8
+ client = Fex.client(credentials: credentials, mode: mode, client: { logger: logger })
9
+ service = client.service(:ship)
10
+
11
+ service.should have(7).operations
12
+
13
+ response = service.call(:process_shipment,
14
+ requested_shipment: {
15
+ ship_timestamp: Time.now.utc.iso8601(2),
16
+ dropoff_type: "REGULAR_PICKUP",
17
+ service_type: "PRIORITY_OVERNIGHT",
18
+ packaging_type: "YOUR_PACKAGING",
19
+ shipper: {
20
+ contact: {
21
+ contact_id: "SY32030",
22
+ person_name: "Sunil Yadav",
23
+ company_name: "Syntel Inc",
24
+ phone_number: "9545871684",
25
+ phone_extension: "020",
26
+ e_mail_address: "sunil_yadav3@syntelinc.com"
27
+ },
28
+ address: {
29
+ street_lines: [ "SHIPPER ADDRESS LINE 1", "SHIPPER ADDRESS LINE 2" ],
30
+ city: "COLORADO SPRINGS",
31
+ state_or_province_code: "CO",
32
+ postal_code: "80915",
33
+ urbanization_code: "CO",
34
+ country_code: "US",
35
+ residential: 0
36
+ }
37
+ },
38
+ recipient: {
39
+ contact: {
40
+ person_name: "Receipient",
41
+ company_name: "Receiver Org",
42
+ phone_number: "9982145555",
43
+ phone_extension: "011",
44
+ e_mail_address: "receiver@yahoo.com"
45
+ },
46
+ address: {
47
+ street_lines: [ "RECIPIENT ADDRESS LINE 1", "RECIPIENT ADDRESS LINE 2" ],
48
+ city: "DENVER",
49
+ state_or_province_code: "CO",
50
+ postal_code: "80204",
51
+ urbanization_code: "CO",
52
+ country_code: "US",
53
+ residential: 0
54
+ }
55
+ },
56
+ shipping_charges_payment: {
57
+ payment_type: "SENDER",
58
+ payor: {
59
+ responsible_party: {
60
+ account_number: credentials[:account_number],
61
+ contact: ""
62
+ }
63
+ }
64
+ },
65
+ label_specification: {
66
+ label_format_type: "COMMON2D",
67
+ image_type: "PNG",
68
+ label_stock_type: "PAPER_4X6"
69
+ },
70
+ rate_request_types: ["ACCOUNT"],
71
+ package_count: 1,
72
+ requested_package_line_items: [
73
+ {
74
+ sequence_number: 1,
75
+ group_number: 1,
76
+ group_package_count: 1,
77
+ weight: { units: "LB", value: "20.0" },
78
+ dimensions: { length: 12, width: 12, height: 12, units: "IN" },
79
+ physical_packaging: "BAG"
80
+ }
81
+ ]
82
+ }
83
+ )
84
+ response.severity.should eq "SUCCESS"
85
+ response.image.bytesize.should be_within(1024).of(10746)
86
+ end
87
+
88
+ end
@@ -0,0 +1,26 @@
1
+ require 'pry-nav'
2
+ require 'support/credentials'
3
+ require 'support/logger_helper'
4
+ require 'fex'
5
+
6
+ RSpec.configure do |config|
7
+ config.treat_symbols_as_metadata_keys_with_true_values = true
8
+ config.run_all_when_everything_filtered = false
9
+ config.order = 'random'
10
+
11
+ config.include LoggerHelper
12
+
13
+ if Credentials.all.has_key?("production")
14
+ config.include Credentials::Keys, :production_environment
15
+ config.include Credentials::Production, :production_environment
16
+ else
17
+ config.filter_run_excluding :production_environment
18
+ end
19
+
20
+ if Credentials.all.has_key?("test")
21
+ config.include Credentials::Keys, :test_environment
22
+ config.include Credentials::Test, :test_environment
23
+ else
24
+ config.filter_run_excluding :test_environment
25
+ end
26
+ end
@@ -0,0 +1,27 @@
1
+ module Credentials
2
+
3
+ FILE = File.expand_path("../credentials.yml", __FILE__)
4
+
5
+ def self.all
6
+ YAML.load_file(FILE) if File.exist?(FILE)
7
+ end
8
+
9
+ module Keys
10
+ def credentials
11
+ @test_keys ||= Credentials.all[mode]
12
+ end
13
+ end
14
+
15
+ module Test
16
+ def mode
17
+ "test"
18
+ end
19
+ end
20
+
21
+ module Production
22
+ def mode
23
+ "production"
24
+ end
25
+ end
26
+
27
+ end
@@ -0,0 +1,15 @@
1
+ require 'fileutils'
2
+
3
+ module LoggerHelper
4
+
5
+ def logger
6
+ if ENV["VERBOSE"] == "true"
7
+ Logger.new(STDERR)
8
+ else
9
+ file = "log/test.log"
10
+ FileUtils.mkdir_p(File.dirname(file))
11
+ Logger.new(file)
12
+ end
13
+ end
14
+
15
+ end
@@ -0,0 +1,22 @@
1
+ require "fex/service"
2
+
3
+ describe Fex::Service do
4
+
5
+ let(:client) { mock :client }
6
+
7
+ before do
8
+ Savon.stub(:client => client)
9
+ end
10
+
11
+ it "wraps Savon" do
12
+ service = Fex::Service.new(
13
+ name: :address_validation,
14
+ defaults: { :default => "value" },
15
+ response: Struct.new(:new)
16
+ )
17
+ Savon.should_receive(:client).with(wsdl: instance_of(String), convert_request_keys_to: :camelcase, pretty_print_xml: true)
18
+ client.should_receive(:call).with(:address_validation, {:message=>{:default=>"value", :the=>"message"}})
19
+ service.call(:address_validation, the: "message")
20
+ end
21
+
22
+ end
@@ -0,0 +1,19 @@
1
+ require 'fex/wsdl'
2
+
3
+ describe Fex::WSDL do
4
+
5
+ subject(:wsdl) { Fex::WSDL.new }
6
+
7
+ it "depends on the service" do
8
+ wsdl.path_for("ship").should end_with "wsdl/ship.wsdl"
9
+ end
10
+
11
+ it "is a full path" do
12
+ wsdl.path_for("ship").should start_with "/"
13
+ end
14
+
15
+ it "raises an exception if the wsdl is not found" do
16
+ expect { wsdl.path_for("nothing") }.to raise_error(Fex::MissingWSDL)
17
+ end
18
+
19
+ end
@@ -0,0 +1,603 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://fedex.com/ws/addressvalidation/v2" xmlns:s1="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://fedex.com/ws/addressvalidation/v2" name="AddressValidationServiceDefinitions">
3
+ <types>
4
+ <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://fedex.com/ws/addressvalidation/v2" xmlns:xs="http://www.w3.org/2001/XMLSchema">
5
+ <xs:element name="AddressValidationRequest" type="ns:AddressValidationRequest"/>
6
+ <xs:element name="AddressValidationReply" type="ns:AddressValidationReply"/>
7
+ <xs:complexType name="AddressValidationRequest">
8
+ <xs:sequence>
9
+ <xs:element name="WebAuthenticationDetail" type="ns:WebAuthenticationDetail" minOccurs="1">
10
+ <xs:annotation>
11
+ <xs:documentation>The descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services).</xs:documentation>
12
+ </xs:annotation>
13
+ </xs:element>
14
+ <xs:element name="ClientDetail" type="ns:ClientDetail">
15
+ <xs:annotation>
16
+ <xs:documentation>Descriptive data identifying the client submitting the transaction.</xs:documentation>
17
+ </xs:annotation>
18
+ </xs:element>
19
+ <xs:element name="TransactionDetail" type="ns:TransactionDetail" minOccurs="0">
20
+ <xs:annotation>
21
+ <xs:documentation>Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply.</xs:documentation>
22
+ </xs:annotation>
23
+ </xs:element>
24
+ <xs:element name="Version" type="ns:VersionId">
25
+ <xs:annotation>
26
+ <xs:documentation>Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply).</xs:documentation>
27
+ </xs:annotation>
28
+ </xs:element>
29
+ <xs:element name="RequestTimestamp" type="xs:dateTime"/>
30
+ <xs:element name="Options" type="ns:AddressValidationOptions"/>
31
+ <xs:element name="AddressesToValidate" type="ns:AddressToValidate" maxOccurs="100"/>
32
+ </xs:sequence>
33
+ </xs:complexType>
34
+ <xs:complexType name="AddressValidationReply">
35
+ <xs:sequence>
36
+ <xs:element name="HighestSeverity" type="ns:NotificationSeverityType"/>
37
+ <xs:element name="Notifications" type="ns:Notification" maxOccurs="unbounded"/>
38
+ <xs:element name="TransactionDetail" type="ns:TransactionDetail" minOccurs="0"/>
39
+ <xs:element name="Version" type="ns:VersionId" minOccurs="0"/>
40
+ <xs:element name="ReplyTimestamp" type="xs:dateTime"/>
41
+ <xs:element name="AddressResults" type="ns:AddressValidationResult" maxOccurs="100"/>
42
+ </xs:sequence>
43
+ </xs:complexType>
44
+ <xs:complexType name="AddressValidationOptions">
45
+ <xs:sequence>
46
+ <xs:element name="VerifyAddresses" type="xs:boolean" minOccurs="0"/>
47
+ <xs:element name="CheckResidentialStatus" type="xs:boolean" minOccurs="0"/>
48
+ <xs:element name="MaximumNumberOfMatches" minOccurs="0">
49
+ <xs:simpleType>
50
+ <xs:restriction base="xs:positiveInteger">
51
+ <xs:maxInclusive value="10"/>
52
+ </xs:restriction>
53
+ </xs:simpleType>
54
+ </xs:element>
55
+ <xs:element name="StreetAccuracy" type="ns:AddressValidationAccuracyType" minOccurs="0"/>
56
+ <xs:element name="DirectionalAccuracy" type="ns:AddressValidationAccuracyType" minOccurs="0"/>
57
+ <xs:element name="CompanyNameAccuracy" type="ns:AddressValidationAccuracyType" minOccurs="0"/>
58
+ <xs:element name="ConvertToUpperCase" type="xs:boolean" minOccurs="0"/>
59
+ <xs:element name="RecognizeAlternateCityNames" type="xs:boolean" minOccurs="0"/>
60
+ <xs:element name="ReturnParsedElements" type="xs:boolean" minOccurs="0"/>
61
+ </xs:sequence>
62
+ </xs:complexType>
63
+ <xs:complexType name="AddressToValidate">
64
+ <xs:sequence>
65
+ <xs:element name="AddressId" type="xs:string" minOccurs="0"/>
66
+ <xs:element name="CompanyName" type="xs:string" minOccurs="0"/>
67
+ <xs:element name="Address" type="ns:Address"/>
68
+ </xs:sequence>
69
+ </xs:complexType>
70
+ <xs:complexType name="AddressValidationResult">
71
+ <xs:sequence>
72
+ <xs:element name="AddressId" type="xs:string" minOccurs="0"/>
73
+ <xs:element name="ProposedAddressDetails" type="ns:ProposedAddressDetail" minOccurs="0" maxOccurs="10"/>
74
+ </xs:sequence>
75
+ </xs:complexType>
76
+ <xs:complexType name="WebAuthenticationDetail">
77
+ <xs:annotation>
78
+ <xs:documentation>Used in authentication of the sender's identity.</xs:documentation>
79
+ </xs:annotation>
80
+ <xs:sequence>
81
+ <xs:element name="UserCredential" type="ns:WebAuthenticationCredential" minOccurs="1">
82
+ <xs:annotation>
83
+ <xs:documentation>Credential used to authenticate a specific software application. This value is provided by FedEx after registration.</xs:documentation>
84
+ </xs:annotation>
85
+ </xs:element>
86
+ </xs:sequence>
87
+ </xs:complexType>
88
+ <xs:complexType name="WebAuthenticationCredential">
89
+ <xs:annotation>
90
+ <xs:documentation>Two part authentication string used for the sender's identity.</xs:documentation>
91
+ </xs:annotation>
92
+ <xs:sequence>
93
+ <xs:element name="Key" type="xs:string" minOccurs="1">
94
+ <xs:annotation>
95
+ <xs:documentation>Identifying part of the authentication key. This value is provided by FedEx after registration.</xs:documentation>
96
+ <xs:appinfo>
97
+ <xs:MaxLength>16</xs:MaxLength>
98
+ </xs:appinfo>
99
+ </xs:annotation>
100
+ </xs:element>
101
+ <xs:element name="Password" type="xs:string" minOccurs="1">
102
+ <xs:annotation>
103
+ <xs:documentation>Secret part of authentication key used for authentication. This value is provided by FedEx after registration.</xs:documentation>
104
+ <xs:appinfo>
105
+ <xs:MaxLength>25</xs:MaxLength>
106
+ </xs:appinfo>
107
+ </xs:annotation>
108
+ </xs:element>
109
+ </xs:sequence>
110
+ </xs:complexType>
111
+ <xs:complexType name="ProposedAddressDetail">
112
+ <xs:sequence>
113
+ <xs:element name="Score" type="xs:integer" minOccurs="0"/>
114
+ <xs:element name="Changes" type="ns:AddressValidationChangeType" minOccurs="1" maxOccurs="unbounded"/>
115
+ <xs:element name="ResidentialStatus" type="ns:ResidentialStatusType" minOccurs="0"/>
116
+ <xs:element name="DeliveryPointValidation" type="ns:DeliveryPointValidationType" minOccurs="0"/>
117
+ <xs:element name="CompanyName" type="xs:string" minOccurs="0"/>
118
+ <xs:element name="Address" type="ns:Address"/>
119
+ <xs:element name="ParsedCompanyName" type="ns:ParsedAddressPart" minOccurs="0"/>
120
+ <xs:element name="ParsedAddress" type="ns:ParsedAddress" minOccurs="0"/>
121
+ <xs:element name="RemovedNonAddressData" type="xs:string" minOccurs="0"/>
122
+ </xs:sequence>
123
+ </xs:complexType>
124
+ <xs:complexType name="ParsedAddress">
125
+ <xs:sequence>
126
+ <xs:element name="ParsedUrbanizationCode" type="ns:ParsedAddressPart" minOccurs="0"/>
127
+ <xs:element name="ParsedStreetLine" type="ns:ParsedAddressPart" minOccurs="0" maxOccurs="4"/>
128
+ <xs:element name="ParsedCity" type="ns:ParsedAddressPart" minOccurs="0"/>
129
+ <xs:element name="ParsedStateOrProvinceCode" type="ns:ParsedAddressPart" minOccurs="0"/>
130
+ <xs:element name="ParsedPostalCode" type="ns:ParsedAddressPart" minOccurs="0"/>
131
+ <xs:element name="ParsedCountryCode" type="ns:ParsedAddressPart" minOccurs="0"/>
132
+ </xs:sequence>
133
+ </xs:complexType>
134
+ <xs:complexType name="ParsedAddressPart">
135
+ <xs:sequence>
136
+ <xs:element name="Elements" type="ns:ParsedElement" minOccurs="1" maxOccurs="unbounded"/>
137
+ </xs:sequence>
138
+ </xs:complexType>
139
+ <xs:complexType name="ParsedElement">
140
+ <xs:sequence>
141
+ <xs:element name="Name" type="xs:string"/>
142
+ <xs:element name="Value" type="xs:string"/>
143
+ <xs:element name="Changes" type="ns:AddressValidationChangeType" maxOccurs="unbounded"/>
144
+ </xs:sequence>
145
+ </xs:complexType>
146
+ <xs:simpleType name="ResidentialStatusType">
147
+ <xs:restriction base="xs:string">
148
+ <xs:enumeration value="UNDETERMINED"/>
149
+ <xs:enumeration value="BUSINESS"/>
150
+ <xs:enumeration value="RESIDENTIAL"/>
151
+ <xs:enumeration value="INSUFFICIENT_DATA"/>
152
+ <xs:enumeration value="UNAVAILABLE"/>
153
+ <xs:enumeration value="NOT_APPLICABLE_TO_COUNTRY"/>
154
+ </xs:restriction>
155
+ </xs:simpleType>
156
+ <xs:simpleType name="DeliveryPointValidationType">
157
+ <xs:restriction base="xs:string">
158
+ <xs:enumeration value="CONFIRMED"/>
159
+ <xs:enumeration value="UNCONFIRMED"/>
160
+ <xs:enumeration value="UNAVAILABLE"/>
161
+ </xs:restriction>
162
+ </xs:simpleType>
163
+ <xs:simpleType name="AddressValidationAccuracyType">
164
+ <xs:restriction base="xs:string">
165
+ <xs:enumeration value="EXACT"/>
166
+ <xs:enumeration value="TIGHT"/>
167
+ <xs:enumeration value="MEDIUM"/>
168
+ <xs:enumeration value="LOOSE"/>
169
+ </xs:restriction>
170
+ </xs:simpleType>
171
+ <xs:simpleType name="AddressValidationChangeType">
172
+ <xs:restriction base="xs:string">
173
+ <xs:enumeration value="APARTMENT_NUMBER_NOT_FOUND">
174
+ <xs:annotation>
175
+ <xs:documentation>
176
+ (EAS 100) Apartment number not found for this address.
177
+ </xs:documentation>
178
+ </xs:annotation>
179
+ </xs:enumeration>
180
+ <xs:enumeration value="APARTMENT_NUMBER_REQUIRED">
181
+ <xs:annotation>
182
+ <xs:documentation>
183
+ (EAS 101) Address requires apartment number.
184
+ </xs:documentation>
185
+ </xs:annotation>
186
+ </xs:enumeration>
187
+ <xs:enumeration value="NORMALIZED">
188
+ <xs:annotation>
189
+ <xs:documentation>
190
+ (EAS 102) Address normalized - abbreviations applied.
191
+ </xs:documentation>
192
+ </xs:annotation>
193
+ </xs:enumeration>
194
+ <xs:enumeration value="REMOVED_DATA">
195
+ <xs:annotation>
196
+ <xs:documentation>
197
+ (EAS 103) Dropped data.
198
+ </xs:documentation>
199
+ </xs:annotation>
200
+ </xs:enumeration>
201
+ <xs:enumeration value="BOX_NUMBER_REQUIRED">
202
+ <xs:annotation>
203
+ <xs:documentation>
204
+ (EAS 104) Address requires box number.
205
+ </xs:documentation>
206
+ </xs:annotation>
207
+ </xs:enumeration>
208
+ <xs:enumeration value="NO_CHANGES">
209
+ <xs:annotation>
210
+ <xs:documentation>
211
+ (EAS 200) Match - no changes applied to input address.
212
+ </xs:documentation>
213
+ </xs:annotation>
214
+ </xs:enumeration>
215
+ <xs:enumeration value="MODIFIED_TO_ACHIEVE_MATCH">
216
+ <xs:annotation>
217
+ <xs:documentation>
218
+ (EAS 201) Address modified to achieve match.
219
+ </xs:documentation>
220
+ </xs:annotation>
221
+ </xs:enumeration>
222
+ <xs:enumeration value="STREET_RANGE_MATCH">
223
+ <xs:annotation>
224
+ <xs:documentation>
225
+ (EAS 202) Match to street range.
226
+ </xs:documentation>
227
+ </xs:annotation>
228
+ </xs:enumeration>
229
+ <xs:enumeration value="BOX_NUMBER_MATCH">
230
+ <xs:annotation>
231
+ <xs:documentation>
232
+ (EAS 203) Match to box number.
233
+ </xs:documentation>
234
+ </xs:annotation>
235
+ </xs:enumeration>
236
+ <xs:enumeration value="RR_OR_HC_MATCH">
237
+ <xs:annotation>
238
+ <xs:documentation>
239
+ (EAS 204) Match to Rural Route (RR) / Highway Contract (HC) address.
240
+ </xs:documentation>
241
+ </xs:annotation>
242
+ </xs:enumeration>
243
+ <xs:enumeration value="CITY_MATCH">
244
+ <xs:annotation>
245
+ <xs:documentation>
246
+ (EAS 205) Match to city (non-US, non-Canada).
247
+ </xs:documentation>
248
+ </xs:annotation>
249
+ </xs:enumeration>
250
+ <xs:enumeration value="POSTAL_CODE_MATCH">
251
+ <xs:annotation>
252
+ <xs:documentation>
253
+ (EAS 206) Match to postal code only (non-street)
254
+ </xs:documentation>
255
+ </xs:annotation>
256
+ </xs:enumeration>
257
+ <xs:enumeration value="RR_OR_HC_BOX_NUMBER_NEEDED">
258
+ <xs:annotation>
259
+ <xs:documentation>
260
+ (EAS 207) Need box number for Rural Route / Highway Contract (HC) match.
261
+ </xs:documentation>
262
+ </xs:annotation>
263
+ </xs:enumeration>
264
+ <xs:enumeration value="FORMATTED_FOR_COUNTRY">
265
+ <xs:annotation>
266
+ <xs:documentation>
267
+ (EAS 208) Formatting performed for country (non-US, non-Canada).
268
+ </xs:documentation>
269
+ </xs:annotation>
270
+ </xs:enumeration>
271
+ <xs:enumeration value="APO_OR_FPO_MATCH">
272
+ <xs:annotation>
273
+ <xs:documentation>
274
+ (EAS 209) Match to military address (e.g. APO/FPO).
275
+ </xs:documentation>
276
+ </xs:annotation>
277
+ </xs:enumeration>
278
+ <xs:enumeration value="GENERAL_DELIVERY_MATCH">
279
+ <xs:annotation>
280
+ <xs:documentation>
281
+ (EAS 210) Match to general delivery.
282
+ </xs:documentation>
283
+ </xs:annotation>
284
+ </xs:enumeration>
285
+ <xs:enumeration value="FIELD_TRUNCATED">
286
+ <xs:annotation>
287
+ <xs:documentation>
288
+ (EAS 211) Address exceeded 35 character plug-in limit.
289
+ </xs:documentation>
290
+ </xs:annotation>
291
+ </xs:enumeration>
292
+ <xs:enumeration value="UNABLE_TO_APPEND_NON_ADDRESS_DATA">
293
+ <xs:annotation>
294
+ <xs:documentation>
295
+ (EAS 212) Unable to append non-address; data 35 character limit imposed.
296
+ </xs:documentation>
297
+ </xs:annotation>
298
+ </xs:enumeration>
299
+ <xs:enumeration value="INSUFFICIENT_DATA">
300
+ <xs:annotation>
301
+ <xs:documentation>
302
+ (EAS 300) Insufficient data for address verification.
303
+ </xs:documentation>
304
+ </xs:annotation>
305
+ </xs:enumeration>
306
+ <xs:enumeration value="HOUSE_OR_BOX_NUMBER_NOT_FOUND">
307
+ <xs:annotation>
308
+ <xs:documentation>
309
+ (EAS 301) Address (house or box number) not found.
310
+ </xs:documentation>
311
+ </xs:annotation>
312
+ </xs:enumeration>
313
+ <xs:enumeration value="POSTAL_CODE_NOT_FOUND">
314
+ <xs:annotation>
315
+ <xs:documentation>
316
+ (EAS 303) Postal code not found.
317
+ </xs:documentation>
318
+ </xs:annotation>
319
+ </xs:enumeration>
320
+ <xs:enumeration value="INVALID_COUNTRY">
321
+ <xs:annotation>
322
+ <xs:documentation>
323
+ (EAS 305) Invalid country.
324
+ </xs:documentation>
325
+ </xs:annotation>
326
+ </xs:enumeration>
327
+ <xs:enumeration value="SERVICE_UNAVAILABLE_FOR_ADDRESS">
328
+ <xs:annotation>
329
+ <xs:documentation>
330
+ (EAS 400) Service unavailable for request address.
331
+ </xs:documentation>
332
+ </xs:annotation>
333
+ </xs:enumeration>
334
+ </xs:restriction>
335
+ </xs:simpleType>
336
+ <xs:complexType name="ClientDetail">
337
+ <xs:annotation>
338
+ <xs:documentation>The descriptive data identifying the client submitting the transaction.</xs:documentation>
339
+ </xs:annotation>
340
+ <xs:sequence>
341
+ <xs:element name="AccountNumber" type="xs:string">
342
+ <xs:annotation>
343
+ <xs:documentation>The FedEx account number assigned to the customer initiating the request.</xs:documentation>
344
+ <xs:appinfo>
345
+ <xs:MaxLength>12</xs:MaxLength>
346
+ </xs:appinfo>
347
+ </xs:annotation>
348
+ </xs:element>
349
+ <xs:element name="MeterNumber" type="xs:string">
350
+ <xs:annotation>
351
+ <xs:documentation>Identifies the unique client device submitting the request. This number is assigned by FedEx and identifies the unique device from which the request is originating.</xs:documentation>
352
+ <xs:appinfo>
353
+ <xs:MaxLength>10</xs:MaxLength>
354
+ </xs:appinfo>
355
+ </xs:annotation>
356
+ </xs:element>
357
+ <xs:element name="Localization" type="ns:Localization" minOccurs="0">
358
+ <xs:annotation>
359
+ <xs:documentation>Governs any future language/translations used for human-readable Notification.localizedMessages in responses to the request containing this ClientDetail object. Different requests from the same client may contain different Localization data. (Contrast with TransactionDetail.localization, which governs data payload language/translation.)</xs:documentation>
360
+ </xs:annotation>
361
+ </xs:element>
362
+ </xs:sequence>
363
+ </xs:complexType>
364
+ <xs:complexType name="Localization">
365
+ <xs:annotation>
366
+ <xs:documentation>Governs any future language/translations used for human-readable text.</xs:documentation>
367
+ </xs:annotation>
368
+ <xs:sequence>
369
+ <xs:element name="LanguageCode" type="xs:string">
370
+ <xs:annotation>
371
+ <xs:documentation>Identifies the language to use for human-readable messages.</xs:documentation>
372
+ <xs:appinfo>
373
+ <xs:MaxLength>2</xs:MaxLength>
374
+ </xs:appinfo>
375
+ </xs:annotation>
376
+ </xs:element>
377
+ <xs:element name="LocaleCode" type="xs:string" minOccurs="0">
378
+ <xs:annotation>
379
+ <xs:documentation>Identifies the locale (i.e. country code) associated with the language.</xs:documentation>
380
+ <xs:appinfo>
381
+ <xs:MaxLength>2</xs:MaxLength>
382
+ </xs:appinfo>
383
+ </xs:annotation>
384
+ </xs:element>
385
+ </xs:sequence>
386
+ </xs:complexType>
387
+ <xs:complexType name="TransactionDetail">
388
+ <xs:annotation>
389
+ <xs:documentation>Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply.</xs:documentation>
390
+ </xs:annotation>
391
+ <xs:sequence>
392
+ <xs:element name="CustomerTransactionId" type="xs:string" minOccurs="0">
393
+ <xs:annotation>
394
+ <xs:documentation>Identifies a customer-supplied unique identifier for this transaction. It is returned in the reply message to aid in matching requests to replies.</xs:documentation>
395
+ <xs:appinfo>
396
+ <xs:MaxLength>40</xs:MaxLength>
397
+ </xs:appinfo>
398
+ </xs:annotation>
399
+ </xs:element>
400
+ <xs:element name="Localization" type="ns:Localization" minOccurs="0">
401
+ <xs:annotation>
402
+ <xs:documentation>Governs any future language/translations applied to the data payload(contrasted with ClientDetail.localization, which governs Notification.localizedMessage language selection).</xs:documentation>
403
+ </xs:annotation>
404
+ </xs:element>
405
+ </xs:sequence>
406
+ </xs:complexType>
407
+ <xs:complexType name="VersionId">
408
+ <xs:annotation>
409
+ <xs:documentation>Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply).</xs:documentation>
410
+ </xs:annotation>
411
+ <xs:sequence>
412
+ <xs:element name="ServiceId" type="xs:string" fixed="aval" minOccurs="1">
413
+ <xs:annotation>
414
+ <xs:documentation>Identifies a system or sub-system which performs an operation.</xs:documentation>
415
+ </xs:annotation>
416
+ </xs:element>
417
+ <xs:element name="Major" type="xs:int" fixed="2" minOccurs="1">
418
+ <xs:annotation>
419
+ <xs:documentation>Identifies the service business level. For the initial FedEx Web Service release this value should be set to 1.</xs:documentation>
420
+ </xs:annotation>
421
+ </xs:element>
422
+ <xs:element name="Intermediate" type="xs:int" fixed="0" minOccurs="1">
423
+ <xs:annotation>
424
+ <xs:documentation>Identifies the service interface level. For the initial FedEx Web Service release this value should be set to 0.</xs:documentation>
425
+ </xs:annotation>
426
+ </xs:element>
427
+ <xs:element name="Minor" type="xs:int" fixed="0" minOccurs="1">
428
+ <xs:annotation>
429
+ <xs:documentation>Identifies the service code level. For the initial FedEx Web Service release this value should be set to 0.</xs:documentation>
430
+ </xs:annotation>
431
+ </xs:element>
432
+ </xs:sequence>
433
+ </xs:complexType>
434
+ <xs:simpleType name="NotificationSeverityType">
435
+ <xs:annotation>
436
+ <xs:documentation>Identifies the set of severity values for a Notification.</xs:documentation>
437
+ </xs:annotation>
438
+ <xs:restriction base="xs:string">
439
+ <xs:enumeration value="ERROR"/>
440
+ <xs:enumeration value="FAILURE"/>
441
+ <xs:enumeration value="NOTE"/>
442
+ <xs:enumeration value="SUCCESS"/>
443
+ <xs:enumeration value="WARNING"/>
444
+ </xs:restriction>
445
+ </xs:simpleType>
446
+ <xs:complexType name="Notification">
447
+ <xs:annotation>
448
+ <xs:documentation>The descriptive data regarding the results of the submitted transaction.</xs:documentation>
449
+ </xs:annotation>
450
+ <xs:sequence>
451
+ <xs:element name="Severity" type="ns:NotificationSeverityType">
452
+ <xs:annotation>
453
+ <xs:documentation>The severity of this notification. this can indicate success or failure or some other information about the request such as errors or notes.</xs:documentation>
454
+ </xs:annotation>
455
+ </xs:element>
456
+ <xs:element name="Source" type="xs:string">
457
+ <xs:annotation>
458
+ <xs:documentation>Indicates the source of the notification. Combined with Code, it uniqely identifies this message.</xs:documentation>
459
+ </xs:annotation>
460
+ </xs:element>
461
+ <xs:element name="Code" type="xs:string" minOccurs="0">
462
+ <xs:annotation>
463
+ <xs:documentation>A code that represents this notification. Combined with Source, it uniqely identifies this message.</xs:documentation>
464
+ <xs:appinfo>
465
+ <xs:MaxLength>8</xs:MaxLength>
466
+ </xs:appinfo>
467
+ </xs:annotation>
468
+ </xs:element>
469
+ <xs:element name="Message" type="xs:string" minOccurs="0">
470
+ <xs:annotation>
471
+ <xs:documentation>Text that explains this notification.</xs:documentation>
472
+ <xs:appinfo>
473
+ <xs:MaxLength>255</xs:MaxLength>
474
+ </xs:appinfo>
475
+ </xs:annotation>
476
+ </xs:element>
477
+ <xs:element name="LocalizedMessage" type="xs:string" minOccurs="0">
478
+ <xs:annotation>
479
+ <xs:documentation>A translated message. The translation is based on the Localization element of the ClientDetail element of the request.</xs:documentation>
480
+ <xs:appinfo>
481
+ <xs:MaxLength>TBD</xs:MaxLength>
482
+ </xs:appinfo>
483
+ </xs:annotation>
484
+ </xs:element>
485
+ <xs:element name="MessageParameters" type="ns:NotificationParameter" minOccurs="0" maxOccurs="unbounded">
486
+ <xs:annotation>
487
+ <xs:documentation>If the message used parameter replacement to be specific as to the meaning of the message, this is the list of parameters that were used.</xs:documentation>
488
+ <xs:appinfo>
489
+ <xs:MaxLength>TBD</xs:MaxLength>
490
+ </xs:appinfo>
491
+ </xs:annotation>
492
+ </xs:element>
493
+ </xs:sequence>
494
+ </xs:complexType>
495
+ <xs:complexType name="NotificationParameter">
496
+ <xs:sequence>
497
+ <xs:element name="Id" type="xs:string" minOccurs="0">
498
+ <xs:annotation>
499
+ <xs:documentation>Name identifiying the type of the data in the element 'Value'</xs:documentation>
500
+ </xs:annotation>
501
+ </xs:element>
502
+ <xs:element name="Value" type="xs:string" minOccurs="0">
503
+ <xs:annotation>
504
+ <xs:documentation>The value that was used as the replacement parameter.</xs:documentation>
505
+ </xs:annotation>
506
+ </xs:element>
507
+ </xs:sequence>
508
+ </xs:complexType>
509
+ <xs:complexType name="Address">
510
+ <xs:annotation>
511
+ <xs:documentation>The descriptive data for a physical location.</xs:documentation>
512
+ </xs:annotation>
513
+ <xs:sequence>
514
+ <xs:element name="StreetLines" type="xs:string" minOccurs="0" maxOccurs="4">
515
+ <xs:annotation>
516
+ <xs:documentation>Combination of number, street name, etc. At least one line is required for a valid physical address; empty lines should not be included.</xs:documentation>
517
+ <xs:appinfo>
518
+ <xs:MaxLength>35</xs:MaxLength>
519
+ </xs:appinfo>
520
+ </xs:annotation>
521
+ </xs:element>
522
+ <xs:element name="City" type="xs:string" minOccurs="0">
523
+ <xs:annotation>
524
+ <xs:documentation>Name of city, town, etc.</xs:documentation>
525
+ <xs:appinfo>
526
+ <xs:MaxLength>
527
+ <ns:Express>35</ns:Express>
528
+ <ns:Ground>20</ns:Ground>
529
+ </xs:MaxLength>
530
+ </xs:appinfo>
531
+ </xs:annotation>
532
+ </xs:element>
533
+ <xs:element name="StateOrProvinceCode" type="xs:string" minOccurs="0">
534
+ <xs:annotation>
535
+ <xs:documentation>Identifying abbreviation for US state, Canada province, etc. Format and presence of this field will vary, depending on country.</xs:documentation>
536
+ <xs:appinfo>
537
+ <xs:MaxLength>14</xs:MaxLength>
538
+ </xs:appinfo>
539
+ </xs:annotation>
540
+ </xs:element>
541
+ <xs:element name="PostalCode" type="xs:string" minOccurs="0">
542
+ <xs:annotation>
543
+ <xs:documentation>Identification of a region (usually small) for mail/package delivery. Format and presence of this field will vary, depending on country. This element is required if both the City and StateOrProvinceCode are not present.</xs:documentation>
544
+ <xs:appinfo>
545
+ <xs:MaxLength>16</xs:MaxLength>
546
+ </xs:appinfo>
547
+ </xs:annotation>
548
+ </xs:element>
549
+ <xs:element name="UrbanizationCode" type="xs:string" minOccurs="0">
550
+ <xs:annotation>
551
+ <xs:documentation>Relevant only to addresses in Puerto Rico. In Puerto Rico, multiple addresses within the same ZIP code can have the same house number and street name. When this is the case, the urbanization code is needed to distinguish them.</xs:documentation>
552
+ <xs:appinfo>
553
+ <xs:MaxLength>100</xs:MaxLength>
554
+ </xs:appinfo>
555
+ </xs:annotation>
556
+ </xs:element>
557
+ <xs:element name="CountryCode" type="xs:string" minOccurs="0">
558
+ <xs:annotation>
559
+ <xs:documentation>Identification of a country.</xs:documentation>
560
+ <xs:appinfo>
561
+ <xs:MaxLength>2</xs:MaxLength>
562
+ </xs:appinfo>
563
+ </xs:annotation>
564
+ </xs:element>
565
+ <xs:element name="Residential" type="xs:boolean" minOccurs="0">
566
+ <xs:annotation>
567
+ <xs:documentation>Indicates whether this address is residential (as opposed to commercial).</xs:documentation>
568
+ </xs:annotation>
569
+ </xs:element>
570
+ </xs:sequence>
571
+ </xs:complexType>
572
+ </xs:schema>
573
+ </types>
574
+ <message name="AddressValidationRequest">
575
+ <part name="AddressValidationRequest" element="ns:AddressValidationRequest"/>
576
+ </message>
577
+ <message name="AddressValidationReply">
578
+ <part name="AddressValidationReply" element="ns:AddressValidationReply"/>
579
+ </message>
580
+ <portType name="AddressValidationPortType">
581
+ <operation name="addressValidation" parameterOrder="AddressValidationRequest">
582
+ <input message="ns:AddressValidationRequest"/>
583
+ <output message="ns:AddressValidationReply"/>
584
+ </operation>
585
+ </portType>
586
+ <binding name="AddressValidationServiceSoapBinding" type="ns:AddressValidationPortType">
587
+ <s1:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
588
+ <operation name="addressValidation">
589
+ <s1:operation soapAction="addressValidation" style="document"/>
590
+ <input>
591
+ <s1:body use="literal"/>
592
+ </input>
593
+ <output>
594
+ <s1:body use="literal"/>
595
+ </output>
596
+ </operation>
597
+ </binding>
598
+ <service name="AddressValidationService">
599
+ <port name="AddressValidationServicePort" binding="ns:AddressValidationServiceSoapBinding">
600
+ <s1:address location="https://gatewaybeta.fedex.com:443/web-services"/>
601
+ </port>
602
+ </service>
603
+ </definitions>