Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(SQL Server) UPS Rate RequestSee more UPS ExamplesSimple UPS Rate Example For more information, see https://developer.ups.com/api/reference?loc=en_US#operation/Rate
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls. -- CREATE PROCEDURE ChilkatSample AS BEGIN DECLARE @hr int DECLARE @iTmp0 int -- Important: Do not use nvarchar(max). See the warning about using nvarchar(max). DECLARE @sTmp0 nvarchar(4000) -- This example assumes the Chilkat API to have been previously unlocked. -- See Global Unlock Sample for sample code. DECLARE @http int -- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT IF @hr <> 0 BEGIN PRINT 'Failed to create ActiveX component' RETURN END -- Use this online tool to generate code from sample JSON: -- Generate Code to Create JSON -- The following JSON is sent in the request body. -- { -- "RateRequest": { -- "Request": { -- "TransactionReference": { -- "CustomerContext": "CustomerContext" -- } -- }, -- "Shipment": { -- "Shipper": { -- "Name": "ShipperName", -- "ShipperNumber": "ShipperNumber", -- "Address": { -- "AddressLine": [ -- "ShipperAddressLine", -- "ShipperAddressLine", -- "ShipperAddressLine" -- ], -- "City": "TIMONIUM", -- "StateProvinceCode": "MD", -- "PostalCode": "21093", -- "CountryCode": "US" -- } -- }, -- "ShipTo": { -- "Name": "ShipToName", -- "Address": { -- "AddressLine": [ -- "ShipToAddressLine", -- "ShipToAddressLine", -- "ShipToAddressLine" -- ], -- "City": "Alpharetta", -- "StateProvinceCode": "GA", -- "PostalCode": "30005", -- "CountryCode": "US" -- } -- }, -- "ShipFrom": { -- "Name": "ShipFromName", -- "Address": { -- "AddressLine": [ -- "ShipFromAddressLine", -- "ShipFromAddressLine", -- "ShipFromAddressLine" -- ], -- "City": "TIMONIUM", -- "StateProvinceCode": "MD", -- "PostalCode": "21093", -- "CountryCode": "US" -- } -- }, -- "PaymentDetails": { -- "ShipmentCharge": { -- "Type": "01", -- "BillShipper": { -- "AccountNumber": "ShipperNumber" -- } -- } -- }, -- "Service": { -- "Code": "03", -- "Description": "Ground" -- }, -- "NumOfPieces": "1", -- "Package": { -- "PackagingType": { -- "Code": "02", -- "Description": "Packaging" -- }, -- "Dimensions": { -- "UnitOfMeasurement": { -- "Code": "IN", -- "Description": "Inches" -- }, -- "Length": "5", -- "Width": "5", -- "Height": "5" -- }, -- "PackageWeight": { -- "UnitOfMeasurement": { -- "Code": "LBS", -- "Description": "Pounds" -- }, -- "Weight": "1" -- } -- } -- } -- } -- } DECLARE @json int -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @json OUT DECLARE @success int EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Request.TransactionReference.CustomerContext', 'CustomerContext' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Shipper.Name', 'ShipperName' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Shipper.ShipperNumber', 'ShipperNumber' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Shipper.Address.AddressLine[0]', 'ShipperAddressLine' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Shipper.Address.AddressLine[1]', 'ShipperAddressLine' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Shipper.Address.AddressLine[2]', 'ShipperAddressLine' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Shipper.Address.City', 'TIMONIUM' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Shipper.Address.StateProvinceCode', 'MD' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Shipper.Address.PostalCode', '21093' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Shipper.Address.CountryCode', 'US' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.ShipTo.Name', 'ShipToName' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.ShipTo.Address.AddressLine[0]', 'ShipToAddressLine' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.ShipTo.Address.AddressLine[1]', 'ShipToAddressLine' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.ShipTo.Address.AddressLine[2]', 'ShipToAddressLine' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.ShipTo.Address.City', 'Alpharetta' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.ShipTo.Address.StateProvinceCode', 'GA' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.ShipTo.Address.PostalCode', '30005' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.ShipTo.Address.CountryCode', 'US' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.ShipFrom.Name', 'ShipFromName' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.ShipFrom.Address.AddressLine[0]', 'ShipFromAddressLine' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.ShipFrom.Address.AddressLine[1]', 'ShipFromAddressLine' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.ShipFrom.Address.AddressLine[2]', 'ShipFromAddressLine' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.ShipFrom.Address.City', 'TIMONIUM' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.ShipFrom.Address.StateProvinceCode', 'MD' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.ShipFrom.Address.PostalCode', '21093' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.ShipFrom.Address.CountryCode', 'US' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.PaymentDetails.ShipmentCharge.Type', '01' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.PaymentDetails.ShipmentCharge.BillShipper.AccountNumber', 'ShipperNumber' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Service.Code', '03' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Service.Description', 'Ground' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.NumOfPieces', '1' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Package.PackagingType.Code', '02' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Package.PackagingType.Description', 'Packaging' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Package.Dimensions.UnitOfMeasurement.Code', 'IN' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Package.Dimensions.UnitOfMeasurement.Description', 'Inches' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Package.Dimensions.Length', '5' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Package.Dimensions.Width', '5' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Package.Dimensions.Height', '5' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Package.PackageWeight.UnitOfMeasurement.Code', 'LBS' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Package.PackageWeight.UnitOfMeasurement.Description', 'Pounds' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RateRequest.Shipment.Package.PackageWeight.Weight', '1' -- Load the OAuth2 access token obtained via client credentials as shown -- in this UPS OAuth2 Client Credentials example. DECLARE @jsonToken int -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @jsonToken OUT DECLARE @success int EXEC sp_OAMethod @jsonToken, 'LoadFile', @success OUT, 'qa_data/tokens/ups_oauth2_token.json' IF @success <> 1 BEGIN PRINT 'Failed to load ups_oauth2_token.json' EXEC @hr = sp_OADestroy @http EXEC @hr = sp_OADestroy @json EXEC @hr = sp_OADestroy @jsonToken RETURN END -- The access token JSON looks something like this: -- { -- "token_type": "Bearer", -- "issued_at": "1686911985606", -- "client_id": "2498righ8wr6aihe98rt8rhowirtyw9er6twe80rtywrehrt", -- "access_token": "eyJraW......R2sbqrY", -- "expires_in": "14399", -- "status": "approved" -- } -- Adds the "Authorization: Bearer <YOUR_TOKEN_HERE>" header. EXEC sp_OAMethod @jsonToken, 'StringOf', @sTmp0 OUT, 'access_token' EXEC sp_OASetProperty @http, 'AuthToken', @sTmp0 EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'Content-Type', 'application/json' EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'transId', 'string' EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'transactionSrc', 'testing' -- The "version" indicates Rate API to display the new release features in Rate API response based on Rate release. -- Supported values: v1, v1601, v1607, v1701, v1707, v2108, v2205. EXEC sp_OAMethod @http, 'SetUrlVar', @success OUT, 'version', 'v1' -- The "requestoption" has the following valid values: -- Rate = The server rates (The default Request option is Rate if a Request Option is not provided). -- Shop = The server validates the shipment, and returns rates for all UPS products from the ShipFrom to the ShipTo addresses. -- Rate is the only valid request option for Ground Freight Pricing requests. EXEC sp_OAMethod @http, 'SetUrlVar', @success OUT, 'requestoption', 'Rate' DECLARE @resp int EXEC sp_OAMethod @http, 'PostJson3', @resp OUT, 'https://wwwcie.ups.com/api/rating/{$version}/{$requestoption}?additionalinfo=string', 'application/json', @json EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT IF @iTmp0 = 0 BEGIN EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT PRINT @sTmp0 EXEC @hr = sp_OADestroy @http EXEC @hr = sp_OADestroy @json EXEC @hr = sp_OADestroy @jsonToken RETURN END DECLARE @sbResponseBody int -- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT EXEC sp_OAMethod @resp, 'GetBodySb', @success OUT, @sbResponseBody DECLARE @jResp int -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @jResp OUT EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody EXEC sp_OASetProperty @jResp, 'EmitCompact', 0 PRINT 'Response Body:' EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT PRINT @sTmp0 -- ---------------------------------------------------------------------------------------------------------- -- Important: If you get the following error response, read further for the solution.. -- -- { -- "response": { -- "errors": [ -- { -- "code": "250002", -- "message": "Invalid Authentication Information." -- } -- ] -- } -- } -- -- It means you didn't add the Rating API permission to your app. -- To add the Rating API, login to your developer account and go to your Apps page at https://developer.ups.com/apps?loc=en_US -- Then edit your app and add the Rating API. -- ---------------------------------------------------------------------------------------------------------- DECLARE @respStatusCode int EXEC sp_OAGetProperty @resp, 'StatusCode', @respStatusCode OUT PRINT 'Response Status Code = ' + @respStatusCode IF @respStatusCode >= 400 BEGIN PRINT 'Response Header:' EXEC sp_OAGetProperty @resp, 'Header', @sTmp0 OUT PRINT @sTmp0 PRINT 'Failed.' EXEC @hr = sp_OADestroy @resp EXEC @hr = sp_OADestroy @http EXEC @hr = sp_OADestroy @json EXEC @hr = sp_OADestroy @jsonToken EXEC @hr = sp_OADestroy @sbResponseBody EXEC @hr = sp_OADestroy @jResp RETURN END EXEC @hr = sp_OADestroy @resp -- Sample JSON response: -- (Sample code for parsing the JSON response is shown below) -- { -- "RateResponse": { -- "Response": { -- "ResponseStatus": { -- "Code": "s", -- "Description": "string" -- }, -- "Alert": [ -- { -- "Code": "string", -- "Description": "string" -- } -- ], -- "AlertDetail": [ -- { -- "Code": "string", -- "Description": "string", -- "ElementLevelInformation": { -- "Level": "s", -- "ElementIdentifier": [ -- { -- "Code": null, -- "Value": null -- } -- ] -- } -- } -- ], -- "TransactionReference": { -- "CustomerContext": "string" -- } -- }, -- "RatedShipment": [ -- { -- "Disclaimer": [ -- { -- "Code": "st", -- "Description": "string" -- } -- ], -- "Service": { -- "Code": "str", -- "Description": "string" -- }, -- "RateChart": "s", -- "RatedShipmentAlert": [ -- { -- "Code": "string", -- "Description": "string" -- } -- ], -- "BillableWeightCalculationMethod": "st", -- "RatingMethod": "st", -- "BillingWeight": { -- "UnitOfMeasurement": { -- "Code": "str", -- "Description": "string" -- }, -- "Weight": "strin" -- }, -- "TransportationCharges": { -- "CurrencyCode": "str", -- "MonetaryValue": "stringstringstri" -- }, -- "BaseServiceCharge": { -- "CurrencyCode": "str", -- "MonetaryValue": "stringstringstri" -- }, -- "ItemizedCharges": [ -- { -- "Code": "str", -- "Description": "string", -- "CurrencyCode": "str", -- "MonetaryValue": "string", -- "SubType": "string" -- } -- ], -- "FRSShipmentData": { -- "TransportationCharges": { -- "GrossCharge": { -- "CurrencyCode": "str", -- "MonetaryValue": "string" -- }, -- "DiscountAmount": { -- "CurrencyCode": "str", -- "MonetaryValue": "string" -- }, -- "DiscountPercentage": "st", -- "NetCharge": { -- "CurrencyCode": "str", -- "MonetaryValue": "string" -- } -- }, -- "FreightDensityRate": { -- "Density": "strin", -- "TotalCubicFeet": "string" -- }, -- "HandlingUnits": [ -- { -- "Quantity": "string", -- "Type": { -- "Code": null, -- "Description": null -- }, -- "Dimensions": { -- "UnitOfMeasurement": null, -- "Length": null, -- "Width": null, -- "Height": null -- }, -- "AdjustedHeight": { -- "Value": null, -- "UnitOfMeasurement": null -- } -- } -- ] -- }, -- "ServiceOptionsCharges": { -- "CurrencyCode": "str", -- "MonetaryValue": "string" -- }, -- "TaxCharges": [ -- { -- "Type": "string", -- "MonetaryValue": "string" -- } -- ], -- "TotalCharges": { -- "CurrencyCode": "str", -- "MonetaryValue": "string" -- }, -- "TotalChargesWithTaxes": { -- "CurrencyCode": "str", -- "MonetaryValue": "string" -- }, -- "NegotiatedRateCharges": { -- "ItemizedCharges": [ -- { -- "Code": "str", -- "Description": "string", -- "CurrencyCode": "str", -- "MonetaryValue": "string", -- "SubType": "string" -- } -- ], -- "TaxCharges": [ -- { -- "Type": "string", -- "MonetaryValue": "string" -- } -- ], -- "TotalCharge": { -- "CurrencyCode": "string", -- "MonetaryValue": "string" -- }, -- "TotalChargesWithTaxes": { -- "CurrencyCode": "string", -- "MonetaryValue": "string" -- } -- }, -- "RatedPackage": [ -- { -- "BaseServiceCharge": { -- "CurrencyCode": "str", -- "MonetaryValue": "string" -- }, -- "TransportationCharges": { -- "CurrencyCode": "string", -- "MonetaryValue": "string" -- }, -- "ServiceOptionsCharges": { -- "CurrencyCode": "string", -- "MonetaryValue": "string" -- }, -- "TotalCharges": { -- "CurrencyCode": "string", -- "MonetaryValue": "string" -- }, -- "Weight": "string", -- "BillingWeight": { -- "UnitOfMeasurement": { -- "Code": null, -- "Description": null -- }, -- "Weight": "string" -- }, -- "Accessorial": [ -- { -- "Code": null, -- "Description": null -- } -- ], -- "ItemizedCharges": [ -- { -- "Code": null, -- "Description": null, -- "CurrencyCode": null, -- "MonetaryValue": null, -- "SubType": null -- } -- ], -- "NegotiatedCharges": { -- "ItemizedCharges": [ -- null -- ] -- }, -- "SimpleRate": { -- "Code": "st" -- }, -- "RateModifier": [ -- { -- "ModifierType": null, -- "ModifierDesc": null, -- "Amount": null -- } -- ] -- } -- ], -- "TimeInTransit": { -- "PickupDate": "stringst", -- "DocumentsOnlyIndicator": "string", -- "PackageBillType": "st", -- "ServiceSummary": { -- "Service": { -- "Description": "string" -- }, -- "GuaranteedIndicator": "string", -- "Disclaimer": "string", -- "EstimatedArrival": { -- "Arrival": { -- "Date": null, -- "Time": null -- }, -- "BusinessDaysInTransit": "strin", -- "Pickup": { -- "Date": null, -- "Time": null -- }, -- "DayOfWeek": "string", -- "CustomerCenterCutoff": "string", -- "DelayCount": "str", -- "HolidayCount": "st", -- "RestDays": "st", -- "TotalTransitDays": "strin" -- }, -- "SaturdayDelivery": "string", -- "SaturdayDeliveryDisclaimer": "string", -- "SundayDelivery": "string", -- "SundayDeliveryDisclaimer": "string" -- }, -- "AutoDutyCode": "st", -- "Disclaimer": "string" -- }, -- "ScheduledDeliveryDate": "string", -- "RoarRatedIndicator": "string" -- } -- ] -- } -- } -- Sample code for parsing the JSON response... -- Use the following online tool to generate parsing code from sample JSON: -- Generate Parsing Code from JSON DECLARE @Level nvarchar(4000) DECLARE @j int DECLARE @count_j int DECLARE @Value nvarchar(4000) DECLARE @ServiceCode nvarchar(4000) DECLARE @ServiceDescription nvarchar(4000) DECLARE @RateChart nvarchar(4000) DECLARE @BillableWeightCalculationMethod nvarchar(4000) DECLARE @RatingMethod nvarchar(4000) DECLARE @UnitOfMeasurementCode nvarchar(4000) DECLARE @UnitOfMeasurementDescription nvarchar(4000) DECLARE @Weight nvarchar(4000) DECLARE @CurrencyCode nvarchar(4000) DECLARE @MonetaryValue nvarchar(4000) DECLARE @BaseServiceChargeCurrencyCode nvarchar(4000) DECLARE @BaseServiceChargeMonetaryValue nvarchar(4000) DECLARE @GrossChargeCurrencyCode nvarchar(4000) DECLARE @GrossChargeMonetaryValue nvarchar(4000) DECLARE @DiscountAmountCurrencyCode nvarchar(4000) DECLARE @DiscountAmountMonetaryValue nvarchar(4000) DECLARE @DiscountPercentage nvarchar(4000) DECLARE @NetChargeCurrencyCode nvarchar(4000) DECLARE @NetChargeMonetaryValue nvarchar(4000) DECLARE @Density nvarchar(4000) DECLARE @TotalCubicFeet nvarchar(4000) DECLARE @ServiceOptionsChargesCurrencyCode nvarchar(4000) DECLARE @ServiceOptionsChargesMonetaryValue nvarchar(4000) DECLARE @TotalChargesCurrencyCode nvarchar(4000) DECLARE @TotalChargesMonetaryValue nvarchar(4000) DECLARE @TotalChargesWithTaxesCurrencyCode nvarchar(4000) DECLARE @TotalChargesWithTaxesMonetaryValue nvarchar(4000) DECLARE @TotalChargeCurrencyCode nvarchar(4000) DECLARE @TotalChargeMonetaryValue nvarchar(4000) DECLARE @PickupDate nvarchar(4000) DECLARE @DocumentsOnlyIndicator nvarchar(4000) DECLARE @PackageBillType nvarchar(4000) DECLARE @GuaranteedIndicator nvarchar(4000) DECLARE @Disclaimer nvarchar(4000) DECLARE @Date nvarchar(4000) DECLARE @Time nvarchar(4000) DECLARE @BusinessDaysInTransit nvarchar(4000) DECLARE @PickupTime nvarchar(4000) DECLARE @DayOfWeek nvarchar(4000) DECLARE @CustomerCenterCutoff nvarchar(4000) DECLARE @DelayCount nvarchar(4000) DECLARE @HolidayCount nvarchar(4000) DECLARE @RestDays nvarchar(4000) DECLARE @TotalTransitDays nvarchar(4000) DECLARE @SaturdayDelivery nvarchar(4000) DECLARE @SaturdayDeliveryDisclaimer nvarchar(4000) DECLARE @SundayDelivery nvarchar(4000) DECLARE @SundayDeliveryDisclaimer nvarchar(4000) DECLARE @AutoDutyCode nvarchar(4000) DECLARE @TimeInTransitDisclaimer nvarchar(4000) DECLARE @ScheduledDeliveryDate nvarchar(4000) DECLARE @RoarRatedIndicator nvarchar(4000) DECLARE @SubType nvarchar(4000) DECLARE @Quantity nvarchar(4000) DECLARE @TypeCode nvarchar(4000) DECLARE @TypeDescription nvarchar(4000) DECLARE @UnitOfMeasurement nvarchar(4000) DECLARE @Length nvarchar(4000) DECLARE @Width nvarchar(4000) DECLARE @Height nvarchar(4000) DECLARE @AdjustedHeightValue nvarchar(4000) DECLARE @AdjustedHeightUnitOfMeasurement nvarchar(4000) DECLARE @v_Type nvarchar(4000) DECLARE @TransportationChargesCurrencyCode nvarchar(4000) DECLARE @TransportationChargesMonetaryValue nvarchar(4000) DECLARE @BillingWeightWeight nvarchar(4000) DECLARE @SimpleRateCode nvarchar(4000) DECLARE @k int DECLARE @count_k int DECLARE @nullVal int DECLARE @ModifierType nvarchar(4000) DECLARE @ModifierDesc nvarchar(4000) DECLARE @Amount nvarchar(4000) DECLARE @Code nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @Code OUT, 'RateResponse.Response.ResponseStatus.Code' DECLARE @Description nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @Description OUT, 'RateResponse.Response.ResponseStatus.Description' DECLARE @CustomerContext nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @CustomerContext OUT, 'RateResponse.Response.TransactionReference.CustomerContext' DECLARE @i int SELECT @i = 0 DECLARE @count_i int EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'RateResponse.Response.Alert' WHILE @i < @count_i BEGIN EXEC sp_OASetProperty @jResp, 'I', @i EXEC sp_OAMethod @jResp, 'StringOf', @Code OUT, 'RateResponse.Response.Alert[i].Code' EXEC sp_OAMethod @jResp, 'StringOf', @Description OUT, 'RateResponse.Response.Alert[i].Description' SELECT @i = @i + 1 END SELECT @i = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'RateResponse.Response.AlertDetail' WHILE @i < @count_i BEGIN EXEC sp_OASetProperty @jResp, 'I', @i EXEC sp_OAMethod @jResp, 'StringOf', @Code OUT, 'RateResponse.Response.AlertDetail[i].Code' EXEC sp_OAMethod @jResp, 'StringOf', @Description OUT, 'RateResponse.Response.AlertDetail[i].Description' EXEC sp_OAMethod @jResp, 'StringOf', @Level OUT, 'RateResponse.Response.AlertDetail[i].ElementLevelInformation.Level' SELECT @j = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier' WHILE @j < @count_j BEGIN EXEC sp_OASetProperty @jResp, 'J', @j EXEC sp_OAMethod @jResp, 'StringOf', @Code OUT, 'RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier[j].Code' EXEC sp_OAMethod @jResp, 'StringOf', @Value OUT, 'RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier[j].Value' SELECT @j = @j + 1 END SELECT @i = @i + 1 END SELECT @i = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'RateResponse.RatedShipment' WHILE @i < @count_i BEGIN EXEC sp_OASetProperty @jResp, 'I', @i EXEC sp_OAMethod @jResp, 'StringOf', @ServiceCode OUT, 'RateResponse.RatedShipment[i].Service.Code' EXEC sp_OAMethod @jResp, 'StringOf', @ServiceDescription OUT, 'RateResponse.RatedShipment[i].Service.Description' EXEC sp_OAMethod @jResp, 'StringOf', @RateChart OUT, 'RateResponse.RatedShipment[i].RateChart' EXEC sp_OAMethod @jResp, 'StringOf', @BillableWeightCalculationMethod OUT, 'RateResponse.RatedShipment[i].BillableWeightCalculationMethod' EXEC sp_OAMethod @jResp, 'StringOf', @RatingMethod OUT, 'RateResponse.RatedShipment[i].RatingMethod' EXEC sp_OAMethod @jResp, 'StringOf', @UnitOfMeasurementCode OUT, 'RateResponse.RatedShipment[i].BillingWeight.UnitOfMeasurement.Code' EXEC sp_OAMethod @jResp, 'StringOf', @UnitOfMeasurementDescription OUT, 'RateResponse.RatedShipment[i].BillingWeight.UnitOfMeasurement.Description' EXEC sp_OAMethod @jResp, 'StringOf', @Weight OUT, 'RateResponse.RatedShipment[i].BillingWeight.Weight' EXEC sp_OAMethod @jResp, 'StringOf', @CurrencyCode OUT, 'RateResponse.RatedShipment[i].TransportationCharges.CurrencyCode' EXEC sp_OAMethod @jResp, 'StringOf', @MonetaryValue OUT, 'RateResponse.RatedShipment[i].TransportationCharges.MonetaryValue' EXEC sp_OAMethod @jResp, 'StringOf', @BaseServiceChargeCurrencyCode OUT, 'RateResponse.RatedShipment[i].BaseServiceCharge.CurrencyCode' EXEC sp_OAMethod @jResp, 'StringOf', @BaseServiceChargeMonetaryValue OUT, 'RateResponse.RatedShipment[i].BaseServiceCharge.MonetaryValue' EXEC sp_OAMethod @jResp, 'StringOf', @GrossChargeCurrencyCode OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.GrossCharge.CurrencyCode' EXEC sp_OAMethod @jResp, 'StringOf', @GrossChargeMonetaryValue OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.GrossCharge.MonetaryValue' EXEC sp_OAMethod @jResp, 'StringOf', @DiscountAmountCurrencyCode OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountAmount.CurrencyCode' EXEC sp_OAMethod @jResp, 'StringOf', @DiscountAmountMonetaryValue OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountAmount.MonetaryValue' EXEC sp_OAMethod @jResp, 'StringOf', @DiscountPercentage OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountPercentage' EXEC sp_OAMethod @jResp, 'StringOf', @NetChargeCurrencyCode OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.NetCharge.CurrencyCode' EXEC sp_OAMethod @jResp, 'StringOf', @NetChargeMonetaryValue OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.NetCharge.MonetaryValue' EXEC sp_OAMethod @jResp, 'StringOf', @Density OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.FreightDensityRate.Density' EXEC sp_OAMethod @jResp, 'StringOf', @TotalCubicFeet OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.FreightDensityRate.TotalCubicFeet' EXEC sp_OAMethod @jResp, 'StringOf', @ServiceOptionsChargesCurrencyCode OUT, 'RateResponse.RatedShipment[i].ServiceOptionsCharges.CurrencyCode' EXEC sp_OAMethod @jResp, 'StringOf', @ServiceOptionsChargesMonetaryValue OUT, 'RateResponse.RatedShipment[i].ServiceOptionsCharges.MonetaryValue' EXEC sp_OAMethod @jResp, 'StringOf', @TotalChargesCurrencyCode OUT, 'RateResponse.RatedShipment[i].TotalCharges.CurrencyCode' EXEC sp_OAMethod @jResp, 'StringOf', @TotalChargesMonetaryValue OUT, 'RateResponse.RatedShipment[i].TotalCharges.MonetaryValue' EXEC sp_OAMethod @jResp, 'StringOf', @TotalChargesWithTaxesCurrencyCode OUT, 'RateResponse.RatedShipment[i].TotalChargesWithTaxes.CurrencyCode' EXEC sp_OAMethod @jResp, 'StringOf', @TotalChargesWithTaxesMonetaryValue OUT, 'RateResponse.RatedShipment[i].TotalChargesWithTaxes.MonetaryValue' EXEC sp_OAMethod @jResp, 'StringOf', @TotalChargeCurrencyCode OUT, 'RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalCharge.CurrencyCode' EXEC sp_OAMethod @jResp, 'StringOf', @TotalChargeMonetaryValue OUT, 'RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalCharge.MonetaryValue' EXEC sp_OAMethod @jResp, 'StringOf', @TotalChargesWithTaxesCurrencyCode OUT, 'RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalChargesWithTaxes.CurrencyCode' EXEC sp_OAMethod @jResp, 'StringOf', @TotalChargesWithTaxesMonetaryValue OUT, 'RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalChargesWithTaxes.MonetaryValue' EXEC sp_OAMethod @jResp, 'StringOf', @PickupDate OUT, 'RateResponse.RatedShipment[i].TimeInTransit.PickupDate' EXEC sp_OAMethod @jResp, 'StringOf', @DocumentsOnlyIndicator OUT, 'RateResponse.RatedShipment[i].TimeInTransit.DocumentsOnlyIndicator' EXEC sp_OAMethod @jResp, 'StringOf', @PackageBillType OUT, 'RateResponse.RatedShipment[i].TimeInTransit.PackageBillType' EXEC sp_OAMethod @jResp, 'StringOf', @ServiceDescription OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.Service.Description' EXEC sp_OAMethod @jResp, 'StringOf', @GuaranteedIndicator OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.GuaranteedIndicator' EXEC sp_OAMethod @jResp, 'StringOf', @Disclaimer OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.Disclaimer' EXEC sp_OAMethod @jResp, 'StringOf', @Date OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Arrival.Date' EXEC sp_OAMethod @jResp, 'StringOf', @Time OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Arrival.Time' EXEC sp_OAMethod @jResp, 'StringOf', @BusinessDaysInTransit OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.BusinessDaysInTransit' EXEC sp_OAMethod @jResp, 'StringOf', @PickupDate OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Pickup.Date' EXEC sp_OAMethod @jResp, 'StringOf', @PickupTime OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Pickup.Time' EXEC sp_OAMethod @jResp, 'StringOf', @DayOfWeek OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.DayOfWeek' EXEC sp_OAMethod @jResp, 'StringOf', @CustomerCenterCutoff OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.CustomerCenterCutoff' EXEC sp_OAMethod @jResp, 'StringOf', @DelayCount OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.DelayCount' EXEC sp_OAMethod @jResp, 'StringOf', @HolidayCount OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.HolidayCount' EXEC sp_OAMethod @jResp, 'StringOf', @RestDays OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.RestDays' EXEC sp_OAMethod @jResp, 'StringOf', @TotalTransitDays OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.TotalTransitDays' EXEC sp_OAMethod @jResp, 'StringOf', @SaturdayDelivery OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SaturdayDelivery' EXEC sp_OAMethod @jResp, 'StringOf', @SaturdayDeliveryDisclaimer OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SaturdayDeliveryDisclaimer' EXEC sp_OAMethod @jResp, 'StringOf', @SundayDelivery OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SundayDelivery' EXEC sp_OAMethod @jResp, 'StringOf', @SundayDeliveryDisclaimer OUT, 'RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SundayDeliveryDisclaimer' EXEC sp_OAMethod @jResp, 'StringOf', @AutoDutyCode OUT, 'RateResponse.RatedShipment[i].TimeInTransit.AutoDutyCode' EXEC sp_OAMethod @jResp, 'StringOf', @TimeInTransitDisclaimer OUT, 'RateResponse.RatedShipment[i].TimeInTransit.Disclaimer' EXEC sp_OAMethod @jResp, 'StringOf', @ScheduledDeliveryDate OUT, 'RateResponse.RatedShipment[i].ScheduledDeliveryDate' EXEC sp_OAMethod @jResp, 'StringOf', @RoarRatedIndicator OUT, 'RateResponse.RatedShipment[i].RoarRatedIndicator' SELECT @j = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RateResponse.RatedShipment[i].Disclaimer' WHILE @j < @count_j BEGIN EXEC sp_OASetProperty @jResp, 'J', @j EXEC sp_OAMethod @jResp, 'StringOf', @Code OUT, 'RateResponse.RatedShipment[i].Disclaimer[j].Code' EXEC sp_OAMethod @jResp, 'StringOf', @Description OUT, 'RateResponse.RatedShipment[i].Disclaimer[j].Description' SELECT @j = @j + 1 END SELECT @j = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RateResponse.RatedShipment[i].RatedShipmentAlert' WHILE @j < @count_j BEGIN EXEC sp_OASetProperty @jResp, 'J', @j EXEC sp_OAMethod @jResp, 'StringOf', @Code OUT, 'RateResponse.RatedShipment[i].RatedShipmentAlert[j].Code' EXEC sp_OAMethod @jResp, 'StringOf', @Description OUT, 'RateResponse.RatedShipment[i].RatedShipmentAlert[j].Description' SELECT @j = @j + 1 END SELECT @j = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RateResponse.RatedShipment[i].ItemizedCharges' WHILE @j < @count_j BEGIN EXEC sp_OASetProperty @jResp, 'J', @j EXEC sp_OAMethod @jResp, 'StringOf', @Code OUT, 'RateResponse.RatedShipment[i].ItemizedCharges[j].Code' EXEC sp_OAMethod @jResp, 'StringOf', @Description OUT, 'RateResponse.RatedShipment[i].ItemizedCharges[j].Description' EXEC sp_OAMethod @jResp, 'StringOf', @CurrencyCode OUT, 'RateResponse.RatedShipment[i].ItemizedCharges[j].CurrencyCode' EXEC sp_OAMethod @jResp, 'StringOf', @MonetaryValue OUT, 'RateResponse.RatedShipment[i].ItemizedCharges[j].MonetaryValue' EXEC sp_OAMethod @jResp, 'StringOf', @SubType OUT, 'RateResponse.RatedShipment[i].ItemizedCharges[j].SubType' SELECT @j = @j + 1 END SELECT @j = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits' WHILE @j < @count_j BEGIN EXEC sp_OASetProperty @jResp, 'J', @j EXEC sp_OAMethod @jResp, 'StringOf', @Quantity OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Quantity' EXEC sp_OAMethod @jResp, 'StringOf', @TypeCode OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Type.Code' EXEC sp_OAMethod @jResp, 'StringOf', @TypeDescription OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Type.Description' EXEC sp_OAMethod @jResp, 'StringOf', @UnitOfMeasurement OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.UnitOfMeasurement' EXEC sp_OAMethod @jResp, 'StringOf', @Length OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Length' EXEC sp_OAMethod @jResp, 'StringOf', @Width OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Width' EXEC sp_OAMethod @jResp, 'StringOf', @Height OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Height' EXEC sp_OAMethod @jResp, 'StringOf', @AdjustedHeightValue OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].AdjustedHeight.Value' EXEC sp_OAMethod @jResp, 'StringOf', @AdjustedHeightUnitOfMeasurement OUT, 'RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].AdjustedHeight.UnitOfMeasurement' SELECT @j = @j + 1 END SELECT @j = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RateResponse.RatedShipment[i].TaxCharges' WHILE @j < @count_j BEGIN EXEC sp_OASetProperty @jResp, 'J', @j EXEC sp_OAMethod @jResp, 'StringOf', @v_Type OUT, 'RateResponse.RatedShipment[i].TaxCharges[j].Type' EXEC sp_OAMethod @jResp, 'StringOf', @MonetaryValue OUT, 'RateResponse.RatedShipment[i].TaxCharges[j].MonetaryValue' SELECT @j = @j + 1 END SELECT @j = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges' WHILE @j < @count_j BEGIN EXEC sp_OASetProperty @jResp, 'J', @j EXEC sp_OAMethod @jResp, 'StringOf', @Code OUT, 'RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].Code' EXEC sp_OAMethod @jResp, 'StringOf', @Description OUT, 'RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].Description' EXEC sp_OAMethod @jResp, 'StringOf', @CurrencyCode OUT, 'RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].CurrencyCode' EXEC sp_OAMethod @jResp, 'StringOf', @MonetaryValue OUT, 'RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].MonetaryValue' EXEC sp_OAMethod @jResp, 'StringOf', @SubType OUT, 'RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].SubType' SELECT @j = @j + 1 END SELECT @j = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges' WHILE @j < @count_j BEGIN EXEC sp_OASetProperty @jResp, 'J', @j EXEC sp_OAMethod @jResp, 'StringOf', @v_Type OUT, 'RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges[j].Type' EXEC sp_OAMethod @jResp, 'StringOf', @MonetaryValue OUT, 'RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges[j].MonetaryValue' SELECT @j = @j + 1 END SELECT @j = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RateResponse.RatedShipment[i].RatedPackage' WHILE @j < @count_j BEGIN EXEC sp_OASetProperty @jResp, 'J', @j EXEC sp_OAMethod @jResp, 'StringOf', @BaseServiceChargeCurrencyCode OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].BaseServiceCharge.CurrencyCode' EXEC sp_OAMethod @jResp, 'StringOf', @BaseServiceChargeMonetaryValue OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].BaseServiceCharge.MonetaryValue' EXEC sp_OAMethod @jResp, 'StringOf', @TransportationChargesCurrencyCode OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].TransportationCharges.CurrencyCode' EXEC sp_OAMethod @jResp, 'StringOf', @TransportationChargesMonetaryValue OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].TransportationCharges.MonetaryValue' EXEC sp_OAMethod @jResp, 'StringOf', @ServiceOptionsChargesCurrencyCode OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].ServiceOptionsCharges.CurrencyCode' EXEC sp_OAMethod @jResp, 'StringOf', @ServiceOptionsChargesMonetaryValue OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].ServiceOptionsCharges.MonetaryValue' EXEC sp_OAMethod @jResp, 'StringOf', @TotalChargesCurrencyCode OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].TotalCharges.CurrencyCode' EXEC sp_OAMethod @jResp, 'StringOf', @TotalChargesMonetaryValue OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].TotalCharges.MonetaryValue' EXEC sp_OAMethod @jResp, 'StringOf', @Weight OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].Weight' EXEC sp_OAMethod @jResp, 'StringOf', @UnitOfMeasurementCode OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.UnitOfMeasurement.Code' EXEC sp_OAMethod @jResp, 'StringOf', @UnitOfMeasurementDescription OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.UnitOfMeasurement.Description' EXEC sp_OAMethod @jResp, 'StringOf', @BillingWeightWeight OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.Weight' EXEC sp_OAMethod @jResp, 'StringOf', @SimpleRateCode OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].SimpleRate.Code' SELECT @k = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_k OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].Accessorial' WHILE @k < @count_k BEGIN EXEC sp_OASetProperty @jResp, 'K', @k EXEC sp_OAMethod @jResp, 'StringOf', @Code OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].Accessorial[k].Code' EXEC sp_OAMethod @jResp, 'StringOf', @Description OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].Accessorial[k].Description' SELECT @k = @k + 1 END SELECT @k = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_k OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges' WHILE @k < @count_k BEGIN EXEC sp_OASetProperty @jResp, 'K', @k EXEC sp_OAMethod @jResp, 'StringOf', @Code OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].Code' EXEC sp_OAMethod @jResp, 'StringOf', @Description OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].Description' EXEC sp_OAMethod @jResp, 'StringOf', @CurrencyCode OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].CurrencyCode' EXEC sp_OAMethod @jResp, 'StringOf', @MonetaryValue OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].MonetaryValue' EXEC sp_OAMethod @jResp, 'StringOf', @SubType OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].SubType' SELECT @k = @k + 1 END SELECT @k = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_k OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].NegotiatedCharges.ItemizedCharges' WHILE @k < @count_k BEGIN EXEC sp_OASetProperty @jResp, 'K', @k EXEC sp_OAMethod @jResp, 'IsNullOf', @nullVal OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].NegotiatedCharges.ItemizedCharges[k]' SELECT @k = @k + 1 END SELECT @k = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_k OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].RateModifier' WHILE @k < @count_k BEGIN EXEC sp_OASetProperty @jResp, 'K', @k EXEC sp_OAMethod @jResp, 'StringOf', @ModifierType OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].ModifierType' EXEC sp_OAMethod @jResp, 'StringOf', @ModifierDesc OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].ModifierDesc' EXEC sp_OAMethod @jResp, 'StringOf', @Amount OUT, 'RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].Amount' SELECT @k = @k + 1 END SELECT @j = @j + 1 END SELECT @i = @i + 1 END EXEC @hr = sp_OADestroy @http EXEC @hr = sp_OADestroy @json EXEC @hr = sp_OADestroy @jsonToken EXEC @hr = sp_OADestroy @sbResponseBody EXEC @hr = sp_OADestroy @jResp END GO |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.