使用FedEx航运服务WSDL创建FedEx运输文件

3

我正在与联邦快递国际运输服务集成。但是有一个部分让我卡住了。我正在尝试使用他们的测试环境创建一份原产地证明书。我已经遵循了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;

    }

但是我一直收到一个错误消息,来自网络服务,指出“无效的股票类型”。尽管shipmentDocumentStockType是一个枚举,并且我正在使用其中一个值,但我仍然收到此错误。有任何想法我可能错在哪里吗?任何信息都将是一个很大的帮助。我已经试图联系联邦快递技术支持,但他们并没有提供太多的帮助。

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 }; 希望这可以帮助到您。

仍然是真的。我尝试使用PAPER_7X4.75作为商业发票,但出现了错误。 - Schwarz Software

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接