我正在与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;
}
Run Code Online (Sandbox Code Playgroud)
但我不断收到来自Web服务的错误消息,指出"无效的库存类型".尽管shipmentDocumentStockType是一个枚举,我正在使用其中的一个值.我仍然收到此错误.我可能会出错的任何想法?任何信息都将是一个很大的帮助.我已尝试与FedEx技术支持取得联系,但这些帮助并不是很好.
小智 5
这对你来说可能有点晚,但只是想提供一个答案以防其他人可能正在寻找它.
我遇到了类似的问题,但它不是原产地证书,而是商业发票.原来这些表格需要以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 };
希望这可以帮助
| 归档时间: |
|
| 查看次数: |
3693 次 |
| 最近记录: |