Skip to content

Commit 4f78c31

Browse files
author
Greg Taylor
committed
1 parent 695cf2f commit 4f78c31

14 files changed

+8721
-8
lines changed

fedex/base_service.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,15 @@ def __init__(self, config_obj, wsdl_name, *args, **kwargs):
6666
- FXSP (Fedex Smartpost)
6767
"""
6868
self.config_obj = config_obj
69-
self.wsdl_path = os.path.join(config_obj.wsdl_path, wsdl_name)
69+
70+
# If the config object is set to use the test server, point
71+
# suds at the test server WSDL directory.
72+
if config_obj.use_test_server:
73+
self.wsdl_path = os.path.join(config_obj.wsdl_path,
74+
'test_server_wsdl', wsdl_name)
75+
else:
76+
self.wsdl_path = os.path.join(config_obj.wsdl_path, wsdl_name)
77+
7078
self.client = Client('file://%s' % self.wsdl_path)
7179
self.logger = logging.getLogger('fedex')
7280
self.response = None

fedex/config.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class FedexConfig(object):
2020
at a later time if you must.
2121
"""
2222
def __init__(self, key, password, account_number=None, meter_number=None,
23-
integrator_id=None, wsdl_path=None):
23+
integrator_id=None, wsdl_path=None, use_test_server=False):
2424
"""
2525
@type key: L{str}
2626
@param key: Developer test key.
@@ -39,6 +39,11 @@ def __init__(self, key, password, account_number=None, meter_number=None,
3939
@type wsdl_path: L{str}
4040
@keyword wsdl_path: In the event that you want to override the path to
4141
your WSDL directory, do so with this argument.
42+
@type use_test_server: L{bool}
43+
@keyword use_test_server: When this is True, test server WSDLs are used
44+
instead of the production server. You will also need to make sure
45+
that your L{FedexConfig} object has a production account number,
46+
meter number, authentication key, and password.
4247
"""
4348
self.key = key
4449
"""@ivar: Developer test key."""
@@ -50,6 +55,8 @@ def __init__(self, key, password, account_number=None, meter_number=None,
5055
"""@ivar: Web services meter number."""
5156
self.integrator_id = integrator_id
5257
"""@ivar: Web services integrator ID."""
58+
self.use_test_server = use_test_server
59+
"""@ivar: When True, point to the test server."""
5360

5461
# Allow overriding of the WDSL path.
5562
if wsdl_path == None:

fedex/wsdl/AddressValidationService_v2.wsdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@
597597
</binding>
598598
<service name="AddressValidationService">
599599
<port name="AddressValidationServicePort" binding="ns:AddressValidationServiceSoapBinding">
600-
<s1:address location="https://gatewaybeta.fedex.com:443/web-services"/>
600+
<s1:address location="https://gateway.fedex.com:443/web-services"/>
601601
</port>
602602
</service>
603603
</definitions>

fedex/wsdl/CloseService_v2.wsdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@
542542
</binding>
543543
<service name="CloseService">
544544
<port name="CloseServicePort" binding="ns:CloseServiceSoapBinding">
545-
<s1:address location="https://gatewaybeta.fedex.com:443/web-services/close"/>
545+
<s1:address location="https://gateway.fedex.com:443/web-services/close"/>
546546
</port>
547547
</service>
548548
</definitions>

fedex/wsdl/CourierDispatchService_v3.wsdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@
10691069
</binding>
10701070
<service name="CourierDispatchService">
10711071
<port name="CourierDispatchServicePort" binding="ns:CourierDispatchServiceSoapBinding">
1072-
<s1:address location="https://gatewaybeta.fedex.com:443/web-services"/>
1072+
<s1:address location="https://gateway.fedex.com:443/web-services"/>
10731073
</port>
10741074
</service>
10751075
</definitions>

fedex/wsdl/ReturnTagService_v1.wsdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@
415415
</binding>
416416
<service name="ReturnTagService">
417417
<port name="ReturnTagServicePort" binding="ns:ReturnTagServiceSoapBinding">
418-
<s1:address location="https://gatewaybeta.fedex.com:443/web-services"/>
418+
<s1:address location="https://gateway.fedex.com:443/web-services"/>
419419
</port>
420420
</service>
421421
</definitions>

fedex/wsdl/ShipService_v7.wsdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4650,7 +4650,7 @@
46504650
</binding>
46514651
<service name="ShipService">
46524652
<port name="ShipServicePort" binding="ns:ShipServiceSoapBinding">
4653-
<s1:address location="https://gatewaybeta.fedex.com:443/web-services"/>
4653+
<s1:address location="https://gateway.fedex.com:443/web-services"/>
46544654
</port>
46554655
</service>
46564656
</definitions>

fedex/wsdl/TrackService_v4.wsdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@
13891389
</binding>
13901390
<service name="TrackService">
13911391
<port name="TrackServicePort" binding="ns:TrackServiceSoapBinding">
1392-
<s1:address location="https://gatewaybeta.fedex.com:443/web-services/track"/>
1392+
<s1:address location="https://gateway.fedex.com:443/web-services/track"/>
13931393
</port>
13941394
</service>
13951395
</definitions>

0 commit comments

Comments
 (0)