开发者

How can i generate UPS HighValueReport?

开发者 https://www.devze.com 2023-04-10 21:52 出处:网络
I am trying to move from UPS Testing to Production. They required that i pass some tests. One of them is to produce HighValueReport by using insuredvalue greater than $999 .

I am trying to move from UPS Testing to Production. They required that i pass some tests.

One of them is to produce HighValueReport by using insuredvalue greater than $999 .

I don't know 开发者_运维技巧the property for this insuredvalue.


Insured value should be part of the Package element.

<ShipmentConfirmRequest>
<Shipment>
<Package>
<PackageWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
</UnitOfMeasurement>
<Weight>5.0</Weight>
</PackageWeight>
<PackageServiceOptions>
<InsuredValue>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>1000</MonetaryValue>
</InsuredValue>
</PackageServiceOptions>
</Package>
</Shipment>
</ShipmentConfirmRequest>

Once you submit your high value transation you'll get a control log returned in the element of the . Print two copies of the control log.


Just dealt with the same UPS production Shipping and Voiding certification tasks. You'll need to create a PackageDeclaredValueType which is a child of PackageServiceOptionsType. Here is my C# code for the SOAP web service for generating the "High Value report" HTML.

Even though UPS documentation says this report will be an "image" I confirmed with UPS Support that it is HTML text at this time and is called "ControlLogReceipt" in the XML response.

//-- XML Path: ShipmentRequest/Shipment/Package/PackageServiceOptions/DeclaredValue
PackageServiceOptionsType packServiceOptions = new PackageServiceOptionsType();
PackageDeclaredValueType decType = new PackageDeclaredValueType();
decType.CurrencyCode = "USD";
decType.MonetaryValue = "1199";

//-- Next four lines  may not be needed
DeclaredValueType decType2 = new DeclaredValueType();
decType2.Code = "01";   //Defaults to 01 - EVS
decType2.Description = "My generic description";
decType.Type = decType2;
//-- End four lines that may not be needed

packServiceOptions.DeclaredValue = decType;
package.PackageServiceOptions = packServiceOptions;

//...

//-- Submit request
ShipmentResponse shipmentResponse = shpSvc.ProcessShipment(shipmentRequest);

//-- High Value Report aka Declared Value Report aka Control Log
byte[] high_value_bytes = Convert.FromBase64String(shipmentResponse.ShipmentResults.ControlLogReceipt[0].GraphicImage);
string high_value_htmltext = System.Text.Encoding.ASCII.GetString(high_value_bytes);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号