Fedex Web Services + createObject("webservice") == Migraine
A very long time ago, I wrote an entry on my novice struggles using the Fedex web services with createObject(). Though the entry shows I still had a lot to learn about web services, I still get occasional questions about it. In particular, about working with the Fedex web services and createObject(). So I will offer this advice to anyone looking to do the same - don't.
While ColdFusion definitely simplifies the process of working with web services, it is also not the best tool for every web service. Especially the more complex ones. If you have ever tried using the FedEx web services with createObject("webservice"), you know how painful it can be. They are extremely complex and deeply nested. So unless you miraculously hit on the right code the first time around, you are likely to waste a LOT of time trying to troubleshoot cryptic Axis error messages .. and the time you spend will not be fun.
So my recommendation is to try using SOAP + CFHTTP instead. The Fedex WSDL developer files include working SOAP samples. They will get you up and running much faster than trying to translate the java examples into CF code. An old entry on Russ Michaels blog has some good tips on working with SOAP. There is also a current project using the SOAP approach with the Fedex Rates Web Service, under the project name CFFedexRates. You could easily use it as a base for some of the other web services.
Take my word for it, you will be glad you did.
For a version of CFFedexRates that is compatible with the Rate Service v7, see issue #2 http://code.google.com/p/cffedexrates/issues/detail?id=2
Update January 21, 2010:
The featured downloads section was updated to include a version compatible with Rate Service v7.
Update May 4, 2010:
For a version of CFFedexRates that is compatible with the Rate Service v8, see issue #4 http://code.google.com/p/cffedexrates/issues/detail?id=4
5 comments:
RIAforge.com also has a FedEx rate example should anyone be looking for one (note, it's not mine... I just choose to use it).
@Matthew,
Thanks for mentioning another fedex example. The more the better. Would you mind posting a link? My brain must be broken, because I did not see any Fedex projects when last I looked ;-)
Cheers
-Leigh
Couldn't have timed this post any better. We were looking for alternatives because all of the existing packages that we could find used the v3-v5. We recently received a client request to update to use a feature introduced in v7. If you could point us to, or could provide a working example submission using the v7 protocol that would be greatly appreciated. We all have migraines over here after the repeat bashing of heads against desks as we got the same response back no matter which method we seem to try (cfinvoke, createobject, cfhttp).
Thanks,
Roy
Hi @Roy,
Which one, the Rate Service?
-Leigh
@Roy,
I made some minor changes to the CFFedexRates cfc (which uses SOAP+CFHTTP), so it works with v7. I uploaded a copy to Issues. (Note: CFFedexRates is not my project)
http://code.google.com/p/cffedexrates/issues/detail?id=2
HTH
-Leigh
Post a Comment