2012-07-05 85 views
2

我從UPS.com下載ShippingGroundFreightWebService PHP示例。我得到以下錯誤信息:UPS Shipping API集成錯誤(PHP)

SoapFault Object 
(
    [message:protected] => An exception has been raised as a result of client data. 
    [string:private] => 
[code:protected] => 0 
[file:protected] => /home5/vizparts/public_html/PHP/SoapGroundFreightShipClient.php 
[line:protected] => 193 
[trace:private] => Array 
    (
     [0] => Array 
      (
       [file] => /home5/vizparts/public_html/PHP/SoapGroundFreightShipClient.php 
       [line] => 193 
       [function] => __soapCall 
       [class] => SoapClient 
       [type] => -> 
       [args] => Array 
        (
         [0] => ProcessShipment 
         [1] => Array 
          (
           [0] => Array 
            (
             [Request] => Array 
              (
               [RequestOption] => Array 
                (
                 [0] => 1 
                 [1] => Shipping 
                ) 

              ) 

             [Shipment] => Array 
              (
               [ShipFrom] => Array 
                (
                 [Name] => Pat Stewart 
                 [TaxIdentification] => 1234567890 
                 [Address] => Array 
                  (
                   [AddressLine] => 2311 York Road 
                   [City] => Timonium 
                   [StateProvinceCode] => MD 
                   [PostalCode] => 21093 
                   [CountryCode] => US 
                  ) 

                 [AttentionName] => String 
                 [Phone] => Array 
                  (
                   [Number] => 6785851000 
                   [Extension] => 123 
                  ) 

                ) 

               [ShipperNumber] => 222006 
               [ShipTo] => Array 
                (
                 [Name] => Superman 
                 [Address] => Array 
                  (
                   [AddressLine] => 2010 Warsaw Road 
                   [StateProvinceCode] => GA 
                   [PostalCode] => 30076 
                   [CountryCode] => US 
                   [City] => Roswell 
                  ) 

                 [AttentionName] => String 
                 [Phone] => Array 
                  (
                   [Number] => 6785851000 
                   [Extention] => 111 
                  ) 

                ) 

               [PaymentInformation] => Array 
                (
                 [Payer] => Array 
                  (
                   [Name] => Superman 
                   [Address] => Array 
                    (
                     [AddressLine] => 2010 Warsaw Road 
                     [City] => Roswell 
                     [StateProvinceCode] => GA 
                     [PostalCode] => 30075 
                     [CountryCode] => US 
                    ) 

                   [ShipperNumber] => 00613270 
                   [AttentionName] => String 
                   [Phone] => Array 
                    (
                     [Number] => 6785851000 
                    ) 

                  ) 

                 [ShipmentBillingOption] => Array 
                  (
                   [Code] => 10 
                   [Description] => String 
                  ) 

                ) 

               [Service] => Array 
                (
                 [Code] => 308 
                 [Description] => String 
                ) 

               [HandlingUnitOne] => Array 
                (
                 [Quantity] => 16 
                 [Type] => Array 
                  (
                   [Code] => PLT 
                   [Description] => String 
                  ) 

                ) 

               [Commodity] => Array 
                (
                 [CommodityID] => 22 
                 [Description] => BUGS 
                 [Weight] => Array 
                  (
                   [UnitOfMeasurement] => Array 
                    (
                     [Code] => LBS 
                     [Description] => String 
                    ) 

                   [Value] => 511.25 
                  ) 

                 [Dimensions] => Array 
                  (
                   [UnitOfMeasurement] => Array 
                    (
                     [Code] => IN 
                     [Description] => String 
                    ) 

                   [Length] => 1.25 
                   [Width] => 1.2 
                   [Height] => 5 
                  ) 

                 [NumberOfPieces] => 1 
                 [PackagingType] => Array 
                  (
                   [Code] => PLT 
                   [Description] => String 
                  ) 

                 [CommodityValue] => Array 
                  (
                   [CurrencyCode] => USD 
                   [MonetaryValue] => 265.2 
                  ) 

                 [FreightClass] => 60 
                 [NMFCCommodityCode] => 566 
                ) 

               [Reference] => Array 
                (
                 [Number] => Array 
                  (
                   [Code] => PM 
                   [Value] => 1651651616 
                  ) 

                 [BarCodeIndicator] => Array 
                  (
                   [NumberOfCartons] => 5 
                   [Weight] => Array 
                    (
                     [UnitOfMeasurement] => Array 
                      (
                       [Code] => LBS 
                       [Description] => String 
                      ) 

                     [Value] => 2 
                    ) 

                  ) 

                ) 

              ) 

            ) 

          ) 

        ) 

      ) 

    ) 

[faultstring] => An exception has been raised as a result of client data. 
[faultcode] => Client 
[faultcodens] => http://schemas.xmlsoap.org/soap/envelope/ 
[detail] => stdClass Object 
    (
     [Errors] => stdClass Object 
      (
       [ErrorDetail] => stdClass Object 
        (
         [Severity] => Hard 
         [PrimaryErrorCode] => stdClass Object 
          (
           [Code] => 9121000 
           [Description] => Invalid Ship Request Document 
          ) 

        ) 

      ) 

    ) 

) 

我想將UPS API集成到我自己的網站。我想打印運輸標籤。如何解決這個問題?

+0

這似乎是你的請求XML不正確組成。您可以通過webcollage.wordpress.com查看所有與UPS標籤相關的幫助。 –

回答

0

您應該設置請求xsd文件,在您下載的包中的其他文件夾中找到它,然後使用它設置請求文件。