2013-08-20 388 views
4

我在C#中使用Fedex的WSDL來生成COD貨運標籤。在Fedex運輸標籤上,運輸標籤和COD退貨標籤上都有一個「發票#」字符串。我想在請求中將我的orderid設置爲Fedex,以便我的orderid顯示爲發票#。Fedex WSDL C# - 設置發票#值

我不明白如何在Fedex的wsdl請求中設置Invoice#。有人做過這個嗎?

回答

3

在其中放置訂單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>[email protected]</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>[email protected]</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>[email protected]</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

我希望我的回覆對你有所幫助。

最好!

+0

你的回覆必須幫助他;) – celerno

+1

非常感謝你的幫助。你向我展示了我必須做的事情。我在使用fedex的wsdl的測試應用程序中使用了以下內容。 CustomerReference cr = new CustomerReference(); cr.CustomerReferenceType = CustomerReferenceType.INVOICE_NUMBER; cr.Value =「invoice123」; request.RequestedShipment.RequestedPackageLineItems [0] .CustomerReferences = new CustomerReference [1]; request.RequestedShipment.RequestedPackageLineItems [0] .CustomerReferences [0] = cr; –