3

我正在与 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;

    }

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

4

1 回答 1

6

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

我遇到了类似的问题,但不是原产地证书,而是商业发票。原来这些表格需要以 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 };

希望这可以帮助

于 2011-06-28T18:08:13.970 回答