title: UPS API Error: Invalid Ship Request Document
body: <p>I'm trying to run the PHP test for the UPS Freight Shipping API that came with the official UPS SDK.  I finally got it to connect to the SOAP service with a correct username, password, and API key, but now I'm getting an error that I don't know how to solve.  The error coming back from the server is</p>
  
  <blockquote>
    <p>Invalid Ship Request Document</p>
  </blockquote>
  
  <p>The full response from the server looks like this:</p>
  
  <pre><code>SoapFault Object
  (
  [message:protected] =&gt; An exception has been raised as a result of client data.
  [string:private] =&gt; 
  [code:protected] =&gt; 0
  [file:protected] =&gt; /my_home_dir/UPS_API/test.php
  [line:protected] =&gt; 224
  [trace:private] =&gt; Array
      (
          [0] =&gt; Array
              (
                  [file] =&gt; /my_home_dir/UPS_API/test.php
                  [line] =&gt; 224
                  [function] =&gt; __soapCall
                  [class] =&gt; SoapClient
                  [type] =&gt; -&gt;
                  [args] =&gt; Array
                      (
                          [0] =&gt; ProcessFreightRate
                          [1] =&gt; Array
                              (
                                  [0] =&gt; Array
                                      (
                                          [Request] =&gt; Array
                                              (
                                                  [RequestOption] =&gt; RateChecking Option
                                              )
  
                                          [ShipFrom] =&gt; Array
                                              (
                                                  [Name] =&gt; Good Incorporation
                                                  [Address] =&gt; Array
                                                      (
                                                          [AddressLine] =&gt; 2010 WARSAW ROAD
                                                          [City] =&gt; Roswell
                                                          [StateProvinceCode] =&gt; GA
                                                          [PostalCode] =&gt; 30076
                                                          [CountryCode] =&gt; US
                                                      )
  
                                              )
  
                                          [ShipTo] =&gt; Array
                                              (
                                                  [Name] =&gt; Sony Company Incorporation
                                                  [Address] =&gt; Array
                                                      (
                                                          [AddressLine] =&gt; 2311 YORK ROAD
                                                          [City] =&gt; TIMONIUM
                                                          [StateProvinceCode] =&gt; MD
                                                          [PostalCode] =&gt; 21093
                                                          [CountryCode] =&gt; US
                                                      )
  
                                              )
  
                                          [PaymentInformation] =&gt; Array
                                              (
                                                  [Payer] =&gt; Array
                                                      (
                                                          [Name] =&gt; Payer inc
                                                          [Address] =&gt; Array
                                                              (
                                                                  [AddressLine] =&gt; 435 SOUTH STREET
                                                                  [City] =&gt; RIS TOWNSHIP
                                                                  [StateProvinceCode] =&gt; NJ
                                                                  [PostalCode] =&gt; 07960
                                                                  [CountryCode] =&gt; US
                                                              )
  
                                                      )
  
                                                  [ShipmentBillingOption] =&gt; Array
                                                      (
                                                          [Code] =&gt; 10
                                                          [Description] =&gt; PREPAID
                                                      )
  
                                              )
  
                                          [Service] =&gt; Array
                                              (
                                                  [Code] =&gt; 308
                                                  [Description] =&gt; UPS Freight LTL
                                              )
  
                                          [HandlingUnitOne] =&gt; Array
                                              (
                                                  [Quantity] =&gt; 20
                                                  [Type] =&gt; Array
                                                      (
                                                          [Code] =&gt; PLT
                                                          [Description] =&gt; PALLET
                                                      )
  
                                              )
  
                                          [Commodity] =&gt; Array
                                              (
                                                  [CommodityID] =&gt; 
                                                  [Description] =&gt; No Description
                                                  [Weight] =&gt; Array
                                                      (
                                                          [UnitOfMeasurement] =&gt; Array
                                                              (
                                                                  [Code] =&gt; LBS
                                                                  [Description] =&gt; Pounds
                                                              )
  
                                                          [Value] =&gt; 750
                                                      )
  
                                                  [Dimensions] =&gt; Array
                                                      (
                                                          [UnitOfMeasurement] =&gt; Array
                                                              (
                                                                  [Code] =&gt; IN
                                                                  [Description] =&gt; Inches
                                                              )
  
                                                          [Length] =&gt; 23
                                                          [Width] =&gt; 17
                                                          [Height] =&gt; 45
                                                      )
  
                                                  [NumberOfPieces] =&gt; 45
                                                  [PackagingType] =&gt; Array
                                                      (
                                                          [Code] =&gt; BAG
                                                          [Description] =&gt; BAG
                                                      )
  
                                                  [DangerousGoodsIndicator] =&gt; 
                                                  [CommodityValue] =&gt; Array
                                                      (
                                                          [CurrencyCode] =&gt; USD
                                                          [MonetaryValue] =&gt; 5670
                                                      )
  
                                                  [FreightClass] =&gt; 60
                                                  [NMFCCommodityCode] =&gt; 
                                              )
  
                                          [ShipmentServiceOptions] =&gt; Array
                                              (
                                                  [PickupOptions] =&gt; Array
                                                      (
                                                          [HolidayPickupIndicator] =&gt; 
                                                          [InsidePickupIndicator] =&gt; 
                                                          [ResidentialPickupIndicator] =&gt; 
                                                          [WeekendPickupIndicator] =&gt; 
                                                          [LiftGateRequiredIndicator] =&gt; 
                                                      )
  
                                                  [OverSeasLeg] =&gt; Array
                                                      (
                                                          [Dimensions] =&gt; Array
                                                              (
                                                                  [Volume] =&gt; 20
                                                                  [UnitOfMeasurement] =&gt; Array
                                                                      (
                                                                          [Code] =&gt; CF
                                                                          [Description] =&gt; String
                                                                      )
  
                                                              )
  
                                                          [Value] =&gt; Array
                                                              (
                                                                  [Cube] =&gt; Array
                                                                      (
                                                                          [CurrencyCode] =&gt; USD
                                                                          [MonetaryValue] =&gt; 5670
                                                                      )
  
                                                              )
  
                                                          [COD] =&gt; Array
                                                              (
                                                                  [CODValue] =&gt; Array
                                                                      (
                                                                          [CurrencyCode] =&gt; USD
                                                                          [MonetaryValue] =&gt; 363
                                                                      )
  
                                                                  [CODPaymentMethod] =&gt; Array
                                                                      (
                                                                          [Code] =&gt; M
                                                                          [Description] =&gt; For Company Check
                                                                      )
  
                                                                  [CODBillingOption] =&gt; Array
                                                                      (
                                                                          [Code] =&gt; 01
                                                                          [Description] =&gt; Prepaid
                                                                      )
  
                                                                  [RemitTo] =&gt; Array
                                                                      (
                                                                          [Name] =&gt; RemitToSomebody
                                                                          [Address] =&gt; Array
                                                                              (
                                                                                  [AddressLine] =&gt; 640 WINTERS AVE
                                                                                  [City] =&gt; PARAMUS
                                                                                  [StateProvinceCode] =&gt; NJ
                                                                                  [PostalCode] =&gt; 07652
                                                                                  [CountryCode] =&gt; US
                                                                              )
  
                                                                          [AttentionName] =&gt; C J Parker
                                                                      )
  
                                                              )
  
                                                          [DangerousGoods] =&gt; Array
                                                              (
                                                                  [Name] =&gt; Very Safe
                                                                  [Phone] =&gt; Array
                                                                      (
                                                                          [Number] =&gt; 453563321
                                                                          [Extension] =&gt; 1111
                                                                      )
  
                                                                  [TransportationMode] =&gt; Array
                                                                      (
                                                                          [Code] =&gt; CARGO
                                                                          [Description] =&gt; Cargo Mode
                                                                      )
  
                                                              )
  
                                                          [SortingAndSegregating] =&gt; Array
                                                              (
                                                                  [Quantity] =&gt; 23452
                                                              )
  
                                                          [CustomsValue] =&gt; Array
                                                              (
                                                                  [CurrencyCode] =&gt; USD
                                                                  [MonetaryValue] =&gt; 23457923
                                                              )
  
                                                          [HandlingCharge] =&gt; Array
                                                              (
                                                                  [Amount] =&gt; Array
                                                                      (
                                                                          [CurrencyCode] =&gt; USD
                                                                          [MonetaryValue] =&gt; 450
                                                                      )
  
                                                              )
  
                                                      )
  
                                              )
  
                                      )
  
                              )
  
                      )
  
              )
  
      )
  
  [faultstring] =&gt; An exception has been raised as a result of client data.
  [faultcode] =&gt; Client
  [faultcodens] =&gt; http://schemas.xmlsoap.org/soap/envelope/
  [detail] =&gt; stdClass Object
      (
          [Errors] =&gt; stdClass Object
              (
                  [ErrorDetail] =&gt; stdClass Object
                      (
                          [Severity] =&gt; Hard
                          [PrimaryErrorCode] =&gt; stdClass Object
                              (
                                  [Code] =&gt; 9121000
                                  [Description] =&gt; Invalid Ship Request Document
                              )
  
                      )
  
              )
  
      )
  
  )
  </code></pre>
  
  <p>The code that I am using to make the request can be found here (credentials have been removed for security): <a href="http://pastebin.com/Yw7sPQdg" rel="nofollow">http://pastebin.com/Yw7sPQdg</a></p>