gtaylor/python-fedex — Issue #13: FedEx may have moved their web services test API
Author: MikeSandford
Created: 2012-01-27 22:52:55+00:00
State: open

I just signed up to get started, and I am quite excited about the software you put together.

But I am unable to get a successful response from FedEx. I copied & pasted examples/create_shipment.py and examples/example_config.py and filled in my own values. I then tried to run the example using my test key/password/etc and got this error message:

Traceback (most recent call last):
File "testfedex.py", line 113, in
shipment.send_validation_request()
File "/usr/local/lib/python2.6/dist-packages/fedex/services/ship_service.py", line 102, in send_validation_request
self.send_request(send_function=self._assemble_and_send_validation_request)
File "/usr/local/lib/python2.6/dist-packages/fedex/base_service.py", line 226, in send_request
self._check_response_for_request_errors()
File "/usr/local/lib/python2.6/dist-packages/fedex/base_service.py", line 188, in _check_response_for_request_errors
notification.Message)
fedex.base_service.FedexError: Authentication Failed (Error code: 1000)
sandford@Compy686:~/workspace/labels/fedex$

I thought that the problem might be related to the validation I was asking it to do (I uncommented the "validate this request" line). So I removed the validation, and was greeted with this:

Traceback (most recent call last):
File "testfedex.py", line 116, in
shipment.send_request()
File "/usr/local/lib/python2.6/dist-packages/fedex/base_service.py", line 219, in send_request
raise SchemaValidationError()
fedex.base_service.SchemaValidationError: "suds encountered an error validating your data against this service's WSDL schema. Please double-check for missing or invalid values, filling all required fields." (Error code: -1)
sandford@Compy686:~/workspace/labels/fedex$

That's not so good, since I was hoping to use the example to get started.

I went back to the previous error (authentication failed) and did a little digging. The WSDL files show the URL being something like https://gatewaybeta.fedex.com:443/web-services but in an email FedEx sent me with my test account information they list https://wsbeta.fedex.com:443/web-services. I can't help but wonder if that cased the authentication problem I first noted.

In the interests of figuring out what the problem was with the create_shipment request (sans validation) I found this on SO (http://stackoverflow.com/questions/2388046/can-you-help-me-solve-this-suds-soap-issue) and cranked logging up to DEBUG. I found this:
soapenv:ServerSchema validation failed for request.5Schema validation failed for request.string value '' is not a valid enumeration value for EdtRequestType in namespace http://fedex.com/ws/ship/v7string value '' is not a valid enumeration value for PhysicalPackagingType in namespace http://fedex.com/ws/ship/v7
The important bit there seems to be this:
string value '' is not a valid enumeration value for EdtRequestType in namespace http://fedex.com/ws/ship/v7

Then I go to http://www.fedex.com/ws/ship/v7 and FedEx gives me a 404 error.

I am basically out of ideas on how to debug these issues at this point. Any help you can give me would be greatly appreciated.

Thanks!
Mike