Integrating FedEx Web Services into .Net, stuck at step 1

Matt Dawdy picture Matt Dawdy · Apr 5, 2010 · Viewed 7.6k times · Source

I'm signed up, I've downloaded sample code, I've got a WSDL...and yet I have no idea how to get this stuff into my existing .Net application. The WSDL was in a zip file, not a URL so I can't just "Add Web Reference." I've run the wsdl tool from the .Net command prompt, and it made a nice class for me...yet dropping that into my web_reference folder doesn't give me any kind of instantiatable class.

I know I'm missing something stupid. Can someone point me in the right direction please?

Answer

mmmeff picture mmmeff · Mar 19, 2013

The proper way to load the FedEx API WSDL file in Visual Studio 2010:

  1. Open the Solution Explorer
  2. Right click your project
  3. Click 'Add Service Reference'
  4. Click the 'Advanced...' button
  5. Click the 'Add Web Reference...' button
  6. Enter the exact path to the WSDL file for the specific FedEx web reference you're using. For example, I extracted mine to the root of my C:\ drive, so all I entered into the URL field was "C:\ShipService.wsdl" without quotes. If you leave quotes, it won't work.
  7. When you hit go, Visual Studio should consume the wsdl into workable classes for you. Click Add Reference and enjoy!

Note: Make sure you read the FedEx documentation well - a lot of their services have gotchyas and implementation can be a nightmare. For example, their address validation service is consumed incorrectly and creates two-dimensional arrays in Reference.cs where they shouldn't exist - this is detailed in the documentation. Worse yet, the fact that they don't allow address validation on their dev environment isn't documented anywhere! Good luck!