我如何生成 UPS HighValueReport?

发布于 2024-12-08 07:15:13 字数 106 浏览 5 评论 0原文

我正在尝试从 UPS 测试转向生产。他们要求我通过一些测试。

其中之一是使用大于 $999 的保险价值来生成 HighValueReport。

我不知道该保险价值的财产。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

分開簡單 2024-12-15 07:15:13

保险价值应是包裹要素的一部分。

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

提交高价值交易后,您将获得在 的元素中返回的控制日志。打印两份控制日志。

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.

巴黎夜雨 2024-12-15 07:15:13

刚刚处理了同样的UPS生产运输和作废认证任务。您需要创建一个 PackageDeclaredValueType,它是 PackageServiceOptionsType 的子项。以下是我的 SOAP Web 服务的 C# 代码,用于生成“高价值报告”HTML。

尽管 UPS 文档称此报告将是一个“图像”,但我向 UPS 支持部门确认,此时它是 HTML 文本,并且在 XML 响应中称为“ControlLogReceipt”。

//-- 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);

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);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文