0

公式のUPSSDKに付属しているUPSFreightShippingAPIのPHPテストを実行しようとしています。ついに正しいユーザー名、パスワード、APIキーでSOAPサービスに接続できるようになりましたが、解決方法がわからないというエラーが発生します。サーバーから返されるエラーは

無効な出荷要求文書

サーバーからの完全な応答は次のようになります。

SoapFault Object
(
[message:protected] => An exception has been raised as a result of client data.
[string:private] => 
[code:protected] => 0
[file:protected] => /my_home_dir/UPS_API/test.php
[line:protected] => 224
[trace:private] => Array
    (
        [0] => Array
            (
                [file] => /my_home_dir/UPS_API/test.php
                [line] => 224
                [function] => __soapCall
                [class] => SoapClient
                [type] => ->
                [args] => Array
                    (
                        [0] => ProcessFreightRate
                        [1] => Array
                            (
                                [0] => Array
                                    (
                                        [Request] => Array
                                            (
                                                [RequestOption] => RateChecking Option
                                            )

                                        [ShipFrom] => Array
                                            (
                                                [Name] => Good Incorporation
                                                [Address] => Array
                                                    (
                                                        [AddressLine] => 2010 WARSAW ROAD
                                                        [City] => Roswell
                                                        [StateProvinceCode] => GA
                                                        [PostalCode] => 30076
                                                        [CountryCode] => US
                                                    )

                                            )

                                        [ShipTo] => Array
                                            (
                                                [Name] => Sony Company Incorporation
                                                [Address] => Array
                                                    (
                                                        [AddressLine] => 2311 YORK ROAD
                                                        [City] => TIMONIUM
                                                        [StateProvinceCode] => MD
                                                        [PostalCode] => 21093
                                                        [CountryCode] => US
                                                    )

                                            )

                                        [PaymentInformation] => Array
                                            (
                                                [Payer] => Array
                                                    (
                                                        [Name] => Payer inc
                                                        [Address] => Array
                                                            (
                                                                [AddressLine] => 435 SOUTH STREET
                                                                [City] => RIS TOWNSHIP
                                                                [StateProvinceCode] => NJ
                                                                [PostalCode] => 07960
                                                                [CountryCode] => US
                                                            )

                                                    )

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

                                            )

                                        [Service] => Array
                                            (
                                                [Code] => 308
                                                [Description] => UPS Freight LTL
                                            )

                                        [HandlingUnitOne] => Array
                                            (
                                                [Quantity] => 20
                                                [Type] => Array
                                                    (
                                                        [Code] => PLT
                                                        [Description] => PALLET
                                                    )

                                            )

                                        [Commodity] => Array
                                            (
                                                [CommodityID] => 
                                                [Description] => No Description
                                                [Weight] => Array
                                                    (
                                                        [UnitOfMeasurement] => Array
                                                            (
                                                                [Code] => LBS
                                                                [Description] => Pounds
                                                            )

                                                        [Value] => 750
                                                    )

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

                                                        [Length] => 23
                                                        [Width] => 17
                                                        [Height] => 45
                                                    )

                                                [NumberOfPieces] => 45
                                                [PackagingType] => Array
                                                    (
                                                        [Code] => BAG
                                                        [Description] => BAG
                                                    )

                                                [DangerousGoodsIndicator] => 
                                                [CommodityValue] => Array
                                                    (
                                                        [CurrencyCode] => USD
                                                        [MonetaryValue] => 5670
                                                    )

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

                                        [ShipmentServiceOptions] => Array
                                            (
                                                [PickupOptions] => Array
                                                    (
                                                        [HolidayPickupIndicator] => 
                                                        [InsidePickupIndicator] => 
                                                        [ResidentialPickupIndicator] => 
                                                        [WeekendPickupIndicator] => 
                                                        [LiftGateRequiredIndicator] => 
                                                    )

                                                [OverSeasLeg] => Array
                                                    (
                                                        [Dimensions] => Array
                                                            (
                                                                [Volume] => 20
                                                                [UnitOfMeasurement] => Array
                                                                    (
                                                                        [Code] => CF
                                                                        [Description] => String
                                                                    )

                                                            )

                                                        [Value] => Array
                                                            (
                                                                [Cube] => Array
                                                                    (
                                                                        [CurrencyCode] => USD
                                                                        [MonetaryValue] => 5670
                                                                    )

                                                            )

                                                        [COD] => Array
                                                            (
                                                                [CODValue] => Array
                                                                    (
                                                                        [CurrencyCode] => USD
                                                                        [MonetaryValue] => 363
                                                                    )

                                                                [CODPaymentMethod] => Array
                                                                    (
                                                                        [Code] => M
                                                                        [Description] => For Company Check
                                                                    )

                                                                [CODBillingOption] => Array
                                                                    (
                                                                        [Code] => 01
                                                                        [Description] => Prepaid
                                                                    )

                                                                [RemitTo] => Array
                                                                    (
                                                                        [Name] => RemitToSomebody
                                                                        [Address] => Array
                                                                            (
                                                                                [AddressLine] => 640 WINTERS AVE
                                                                                [City] => PARAMUS
                                                                                [StateProvinceCode] => NJ
                                                                                [PostalCode] => 07652
                                                                                [CountryCode] => US
                                                                            )

                                                                        [AttentionName] => C J Parker
                                                                    )

                                                            )

                                                        [DangerousGoods] => Array
                                                            (
                                                                [Name] => Very Safe
                                                                [Phone] => Array
                                                                    (
                                                                        [Number] => 453563321
                                                                        [Extension] => 1111
                                                                    )

                                                                [TransportationMode] => Array
                                                                    (
                                                                        [Code] => CARGO
                                                                        [Description] => Cargo Mode
                                                                    )

                                                            )

                                                        [SortingAndSegregating] => Array
                                                            (
                                                                [Quantity] => 23452
                                                            )

                                                        [CustomsValue] => Array
                                                            (
                                                                [CurrencyCode] => USD
                                                                [MonetaryValue] => 23457923
                                                            )

                                                        [HandlingCharge] => Array
                                                            (
                                                                [Amount] => Array
                                                                    (
                                                                        [CurrencyCode] => USD
                                                                        [MonetaryValue] => 450
                                                                    )

                                                            )

                                                    )

                                            )

                                    )

                            )

                    )

            )

    )

[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
                            )

                    )

            )

    )

)

私がリクエストを行うために使用しているコードはここにあります(セキュリティのためにクレデンシャルは削除されています):http://pastebin.com/Yw7sPQdg

4

1 に答える 1

1

間違ったエンドポイントを指していたことがわかりました。運賃のエンドポイントURLは次のようになります:https ://wwwcie.ups.com/webservices/FreightRate

于 2012-06-13T15:08:55.830 に答える