gpt4 book ai didi

c# - 使用 FedEx 运送服务 WSDL 创建 FedEx 运送文件

转载 作者:行者123 更新时间:2023-11-30 15:09:00 25 4
gpt4 key购买 nike

我正在与 FedEx 国际船舶服务集成。但我真的被困在一个部分。我正在尝试使用他们的测试环境创建原产地证书。我遵循了 xml 模式并提出了以下代码

private static void SetCustomInvoice(ProcessShipmentRequest request)
{
request.RequestedShipment.ShippingDocumentSpecification = new ShippingDocumentSpecification();
request.RequestedShipment.ShippingDocumentSpecification.ShippingDocumentTypes = new RequestedShippingDocumentType[1] { new RequestedShippingDocumentType() };
request.RequestedShipment.ShippingDocumentSpecification.ShippingDocumentTypes[0] = RequestedShippingDocumentType.CERTIFICATE_OF_ORIGIN;
request.RequestedShipment.ShippingDocumentSpecification.CertificateOfOrigin = new CertificateOfOriginDetail();
request.RequestedShipment.ShippingDocumentSpecification.CertificateOfOrigin.DocumentFormat = new ShippingDocumentFormat { StockType = ShippingDocumentStockType.STOCK_4X6, ImageType = ShippingDocumentImageType.PDF, ImageTypeSpecified = true, StockTypeSpecified = true };
request.RequestedShipment.SpecialServicesRequested = new ShipmentSpecialServicesRequested();
request.RequestedShipment.SpecialServicesRequested.SpecialServiceTypes = new ShipmentSpecialServiceType[1] { new ShipmentSpecialServiceType() };
request.RequestedShipment.SpecialServicesRequested.SpecialServiceTypes[0] = ShipmentSpecialServiceType.ELECTRONIC_TRADE_DOCUMENTS;

request.RequestedShipment.SpecialServicesRequested.EtdDetail = new EtdDetail();
request.RequestedShipment.SpecialServicesRequested.EtdDetail.RequestedDocumentCopies = new RequestedShippingDocumentType[1] { RequestedShippingDocumentType.CERTIFICATE_OF_ORIGIN };
request.RequestedShipment.SpecialServicesRequested.EtdDetail.DocumentReferences = new UploadDocumentReferenceDetail[1] { new UploadDocumentReferenceDetail() };
request.RequestedShipment.SpecialServicesRequested.EtdDetail.RequestedDocumentCopies[0] = RequestedShippingDocumentType.CERTIFICATE_OF_ORIGIN;

}

但我不断从 Web 服务收到一条错误消息,指出“库存类型无效”。尽管 shipmentDocumentStockType 是一个枚举,但我正在使用其中的一个值。我仍然收到此错误。我可能会出错的任何想法?任何信息都会有很大的帮助。我曾尝试与 FedEx 技术支持取得联系,但他们的帮助并不是很大。

最佳答案

这对您来说可能有点晚,但只是想提供一个答案,以防其他人可能正在寻找它。

我遇到了类似的问题,但不是原产地证书,而是商业发票。原来这些表格需要以 PDF 格式打印在完整的 8.5 x 11 页上,因此将 StockType 从 STOCK_4x6 更改为 PAPER_LETTER 为我修复了它:

来自:
request.RequestedShipment.ShippingDocumentSpecification.CertificateOfOrigin.DocumentFormat = new ShippingDocumentFormat { StockType = ShippingDocumentStockType.STOCK_4X6, ImageType = ShippingDocumentImageType.PDF, ImageTypeSpecified = true, StockTypeSpecified = true };

收件人:
request.RequestedShipment.ShippingDocumentSpecification.CertificateOfOrigin.DocumentFormat = new ShippingDocumentFormat { StockType = ShippingDocumentStockType.PAPER_LETTER, ImageType = ShippingDocumentImageType.PDF, ImageTypeSpecified = true, StockTypeSpecified = true };

希望对你有帮助

关于c# - 使用 FedEx 运送服务 WSDL 创建 FedEx 运送文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4955361/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com