Friday, October 30, 2009

Calculating UPS Shipping Rate in C#

Some useful links for doing UPS shipping rate calculations.

  • UPS Rates & Service Selection
  • https://www.ups.com/ups.app/xml/Rate
    The XML service for retrieving the rate data
  • dtk_RateXML_V1.zip
    Look for
    /Developers Guide/RSS_Tool_06_10_09.pdf
    in the zip.
  • Use the Xml Schemas/DataTypes support utility (xsd.exe) from the Visual Studio command prompt to generate classes that you can pass through the System.Xml.Serialization.XmlSerializer class straight to a HttpWebRequest RequestStream or from the corresponding ResponseStream.
    • xsd.exe RateRequest_external.xsd /classes /l:cs /n:FishOfPrey.SampleNamespace
    • xsd.exe RateResponse_external.xsd /classes /l:cs /n:FishOfPrey.SampleNamespace