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

发布于 2024-10-16 21:55:44 字数 2147 浏览 4 评论 0原文

我正在与联邦快递国际船舶服务整合。但我确实被困在某一部分上。我正在尝试使用他们的测试环境创建原产地证书。我遵循了 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 是一个枚举,并且我正在使用其中的值之一。我仍然收到此错误。有什么想法我可能会出错吗? 任何信息都会有很大的帮助。我曾尝试联系联邦快递技术支持,但他们并没有真正提供很大的帮助。

I am in the process of integrating with the FedEx international Ship Service. But I am really stuck on one part. I am trying to create a certificate of origin using their test environment. I have followed the xml schema and have come up with the code below

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;

    }

But I keep getting an error message back from the web service stating “Invalid Stock Type”. Even though the shipmentDocumentStockType is an enum and I am using one of the values from it. I am still getting this error. Any ideas where I might be going wrong?
Any information will be a great help. I have tried getting in touch with FedEx technical support and they were not really a great help.

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

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

发布评论

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

评论(1

夏见 2024-10-23 21:55:44

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

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

这有帮助

This might be a little late for you but just wanted to provide an answer in case someone else might be looking for it.

I was having a similar problem but instead of the Certificate of Origin it was with the Commercial Invoice. Turns out these forms need to be printed on a full 8.5 x 11 page in PDF format, so changing the StockType from STOCK_4x6 to PAPER_LETTER fixed it for me:

From:

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

To:

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

Hope this helps

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