c# - Fedex WSDL C# - 设置 Invoice # 值

标签 c# fedex

我在 C# 中使用 Fedex 的 WSDL 来生成 COD 运输标签。在 Fedex 运输标签上,运输标签和 COD 返回标签上都有一个“发票编号”字符串。我想在对 Fedex 的请求中设置我的 orderid,以便我的 orderid 显示为发票编号。

我不清楚如何在 Fedex 的 wsdl 请求中设置 Invoice #。有没有人这样做过?

最佳答案

在标签中放置订单 ID发票编号 的方式如下:

  1. 在套餐客户引用中设置发票编号。
  2. 在 COD 详细信息节点(在引用指示器上)指定您希望 COD 标签包含发票编号作为其引用之一。

请注意,您还可以包含发票编号以外的其他引用信息(例如:采购订单、客户引用和跟踪)。

这是描述我之前所说内容的请求的示例 SOAP 信封:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <ProcessShipmentRequest xmlns="http://fedex.com/ws/ship/v12">
            <WebAuthenticationDetail>
                <CspCredential>
                    <Key>CSP_KEY(IF YOU ARE ONE)</Key>
                    <Password>CIS_PASSWORD(IF YOU ARE ONE)</Password>
                </CspCredential>
                <UserCredential>
                    <Key>CSP_USER_KEY(IF YOU BELONG TO THE CSP)</Key>
                    <Password>CSP_PASSWORD(IF YOU BELONG TO THE CSP)</Password>
                </UserCredential>
            </WebAuthenticationDetail>
            <ClientDetail>
                <AccountNumber>ACCOUNT_NUMBER</AccountNumber>
                <MeterNumber>METER_NUMBER</MeterNumber>
                <ClientProductId>CLIENT_PRODUCT_ID(IF ONE IS PROVIDED)</ClientProductId>
                <ClientProductVersion>CLIENT_VERSION(IF ONE IS PROVIDED)</ClientProductVersion>
            </ClientDetail>
            <TransactionDetail>
                <CustomerTransactionId>261</CustomerTransactionId>
            </TransactionDetail>
            <Version>
                <ServiceId>ship</ServiceId>
                <Major>12</Major>
                <Intermediate>0</Intermediate>
                <Minor>0</Minor>
            </Version>
            <RequestedShipment>
                <ShipTimestamp>2013-08-21T14:00:00-04:00</ShipTimestamp>
                <DropoffType>REGULAR_PICKUP</DropoffType>
                <ServiceType>PRIORITY_OVERNIGHT</ServiceType>
                <PackagingType>YOUR_PACKAGING</PackagingType>
                <Shipper>
                    <AccountNumber>ACCOUNT_NUMBER</AccountNumber>
                    <Contact>
                        <PersonName>323199 323199</PersonName>
                        <CompanyName>CSP Testing</CompanyName>
                        <PhoneNumber>9012633035</PhoneNumber>
                        <EMailAddress>csp@fedex.com</EMailAddress>
                    </Contact>
                    <Address>
                        <StreetLines>99 Fedex parkway</StreetLines>
                        <City>ALAMEDA</City>
                        <StateOrProvinceCode>CA</StateOrProvinceCode>
                        <PostalCode>94501</PostalCode>
                        <CountryCode>US</CountryCode>
                    </Address>
                </Shipper>
                <Recipient>
                    <Contact>
                        <PersonName>323257 323257</PersonName>
                        <CompanyName>CSP Testing</CompanyName>
                        <PhoneNumber>9012633035</PhoneNumber>
                        <EMailAddress>csp@fedex.com</EMailAddress>
                    </Contact>
                    <Address>
                        <StreetLines>124 Fedex parkway</StreetLines>
                        <City>PADUCAH</City>
                        <StateOrProvinceCode>KY</StateOrProvinceCode>
                        <PostalCode>42001</PostalCode>
                        <CountryCode>US</CountryCode>
                    </Address>
                </Recipient>
                <Origin>
                    <Contact>
                        <PersonName>323199 323199</PersonName>
                        <CompanyName>CSP Testing</CompanyName>
                        <PhoneNumber>9012633035</PhoneNumber>
                        <EMailAddress>csp@fedex.com</EMailAddress>
                    </Contact>
                    <Address>
                        <StreetLines>99 Fedex parkway</StreetLines>
                        <City>ALAMEDA</City>
                        <StateOrProvinceCode>CA</StateOrProvinceCode>
                        <PostalCode>94501</PostalCode>
                        <CountryCode>US</CountryCode>
                    </Address>
                </Origin>
                <ShippingChargesPayment>
                    <PaymentType>SENDER</PaymentType>
                    <Payor>
                        <ResponsibleParty>
                            <AccountNumber>ACCOUNT_NUMBER</AccountNumber>
                            <Contact>
                                <PersonName>CSP Testing</PersonName>
                                <CompanyName>RTC Testing</CompanyName>
                            </Contact>
                            <Address>
                                <CountryCode>US</CountryCode>
                            </Address>
                        </ResponsibleParty>
                    </Payor>
                </ShippingChargesPayment>
                <SpecialServicesRequested>
                    <SpecialServiceTypes>COD</SpecialServiceTypes>
                    <CodDetail>
                        <CodCollectionAmount>
                            <Currency>USD</Currency>
                            <Amount>50</Amount>
                        </CodCollectionAmount>
                        <CollectionType>ANY</CollectionType>
                        <ReferenceIndicator>INVOICE</ReferenceIndicator>
                    </CodDetail>
                </SpecialServicesRequested>
                <CustomsClearanceDetail>
                    <DocumentContent>NON_DOCUMENTS</DocumentContent>
                </CustomsClearanceDetail>
                <LabelSpecification>
                    <LabelFormatType>COMMON2D</LabelFormatType>
                    <ImageType>PNG</ImageType>
                    <LabelStockType>PAPER_4X6</LabelStockType>
                </LabelSpecification>
                <RateRequestTypes>ACCOUNTACCOUNT</RateRequestTypes>
                <PackageCount>1</PackageCount>
                <RequestedPackageLineItems>
                    <SequenceNumber>1</SequenceNumber>
                    <GroupPackageCount>1</GroupPackageCount>
                    <InsuredValue>
                        <Currency>USD</Currency>
                        <Amount>5000</Amount>
                    </InsuredValue>
                    <Weight>
                        <Units>LB</Units>
                        <Value>20</Value>
                    </Weight>
                    <PhysicalPackaging>OTHER</PhysicalPackaging>
                    <ItemDescription>MacBook Pro</ItemDescription>
                    <CustomerReferences>
                        <CustomerReferenceType>INVOICE_NUMBER</CustomerReferenceType>
                        <Value>INVOICE12345</Value>
                    </CustomerReferences>
                    <SpecialServicesRequested>
                        <SpecialServiceTypes>SIGNATURE_OPTION</SpecialServiceTypes>
                        <SignatureOptionDetail>
                            <OptionType>SERVICE_DEFAULT</OptionType>
                        </SignatureOptionDetail>
                    </SpecialServicesRequested>
                </RequestedPackageLineItems>
            </RequestedShipment>
        </ProcessShipmentRequest>
    </soap:Body>
</soap:Envelope>

这是生成的运输标签:

enter image description here

这是生成的 COD 标签:

enter image description here

希望我的回复对您有所帮助。

最好!

关于c# - Fedex WSDL C# - 设置 Invoice # 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18325400/

相关文章:

xml - 为 FedEx Web 服务创建 HTTP Post 调用

api - 如何在网站上测试 FedEx API

php - FedEx express cargo API 错误 : "Account and meter number aren' t consistent"

c# - 为什么C#不显示表格

c# - 如何在 linq 中使用 Func<Tkey,T>?

c# - 列出所有系统证书库

php - 使用 Fedex API RateService 指定 Fedex One Rate 的数组结构

c# - 为什么要在调用事件调用之前定义对事件的引用?

c# - Visual Studio 中的事件处理程序

php - 令人费解的 PHP Soap 故障