【问题标题】:FedEx FEDEX_ONE_RATE API shipping issueFedEx FEDEX_ONE_RATE API 运输问题
【发布时间】:2021-06-11 14:26:25
【问题描述】:

这里附上了完整的(邮递员)SOAP 请求

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:m0="http://fedex.com/ws/ship/v28">
       <SOAP-ENV:Body>
          <ProcessShipmentRequest xmlns="http://fedex.com/ws/ship/v28">
             <WebAuthenticationDetail>
                  <UserCredential>
                   <Key>xxxxxxx</Key>
                   <Password>xxxxxxxxxxx</Password>
                </UserCredential>
             </WebAuthenticationDetail>
             <ClientDetail>
                <AccountNumber>xxxxxxxxxxx</AccountNumber>
                <MeterNumber>xxxxxxxxxxx</MeterNumber>
             </ClientDetail>
             <TransactionDetail>
                <CustomerTransactionId>Customer Order Id:1700000112</CustomerTransactionId>
             </TransactionDetail>
             <Version>
                <ServiceId>ship</ServiceId>
                <Major>28</Major>
                <Intermediate>0</Intermediate>
                <Minor>0</Minor>
             </Version>
             <RequestedShipment>
             <SpecialServicesRequested>
        <SpecialServiceTypes>FEDEX_2_DAY</SpecialServiceTypes>
        <SpecialServiceTypes>EVENT_NOTIFICATION</SpecialServiceTypes>
        <EventNotificationDetail>
            <AggregationType>PER_SHIPMENT</AggregationType>
            <PersonalMessage>Personal message</PersonalMessage>
            <EventNotifications>
                <Role>RECIPIENT</Role>
                <Events>ON_SHIPMENT</Events>
                <NotificationDetail>
                    <NotificationType>EMAIL</NotificationType>
                    <EmailDetail>
                        <EmailAddress>john@fedex.com</EmailAddress>
                        <Name>John Smith</Name>
                    </EmailDetail>
                    <Localization>
                        <LanguageCode>EN</LanguageCode>
                    </Localization>
                </NotificationDetail>
                <FormatSpecification>
                    <Type>HTML</Type>
                </FormatSpecification>
            </EventNotifications>
        </EventNotificationDetail>
    </SpecialServicesRequested>
    
             <ShipTimestamp>2021-06-11T05:24:19+00:00</ShipTimestamp>
                <DropoffType>REGULAR_PICKUP</DropoffType>
                <ServiceType>GROUND_HOME_DELIVERY</ServiceType>
                <PackagingType>YOUR_PACKAGING</PackagingType>
                <Shipper>
                         <Contact>
                        <PersonName></PersonName>
                        <CompanyName>SpaWorks</CompanyName>
                        <PhoneNumber>602.992.3888</PhoneNumber>
                        <EMailAddress>sales@spaworks.net</EMailAddress>
                   </Contact>
                   <Address>
                   <StreetLines>2514 East Mohawk Lane Suite 105</StreetLines>
                   <City>Phoenix</City>
                   <StateOrProvinceCode>AZ</StateOrProvinceCode>
                   <PostalCode>85050</PostalCode>
                   <CountryCode>US</CountryCode>
                   <Residential>false</Residential>
                   </Address>
                </Shipper>
                <Recipient>
                <Contact>
                <PersonName>John Willam</PersonName>
                <CompanyName></CompanyName>
                <PhoneNumber>9879879874</PhoneNumber>
                <EMailAddress>recipient@gmail.com</EMailAddress>
                </Contact>
                   <Address>
                   <StreetLines>1282 Camden Place </StreetLines>
                   <StreetLines></StreetLines>
                   <City>Charleston</City>
                   <StateOrProvinceCode>SC</StateOrProvinceCode>
                   <PostalCode>29424</PostalCode>
                   <CountryCode>US</CountryCode>
                   <Residential>true</Residential>
                   </Address>
                </Recipient>
                <ShippingChargesPayment>
                <PaymentType>SENDER</PaymentType>
                <Payor>
                   <ResponsibleParty>
                      <AccountNumber>xxxxxxxxx</AccountNumber>
                      <Tins>
                         <TinType>BUSINESS_STATE</TinType>
                         <Number>213456</Number>
                      </Tins>
                      <Contact>
                         <ContactId>12345</ContactId>
                         <PersonName>SpaWorks</PersonName>
                      </Contact>
                  </ResponsibleParty>
                </Payor>
             </ShippingChargesPayment>
                <CustomsClearanceDetail>
                   <DutiesPayment>
                      <PaymentType>SENDER</PaymentType>
                     <Payor>
                      <ResponsibleParty>
                         <AccountNumber>xxxxxxxx</AccountNumber>
                         <Tins>
                            <TinType>BUSINESS_STATE</TinType>
                           <Number>213456</Number>
                         </Tins>
                         <Contact>
                            <ContactId>12345</ContactId>
                            <PersonName>Input Your Information</PersonName>
                         </Contact>
                      </ResponsibleParty>
                   </Payor>
                   </DutiesPayment>
    
                </CustomsClearanceDetail>
                <LabelSpecification>
                   <LabelFormatType>COMMON2D</LabelFormatType>
                   <ImageType>PNG</ImageType>
                   <LabelStockType>PAPER_4X6</LabelStockType>
                </LabelSpecification>
                <ShippingDocumentSpecification>
                   <ShippingDocumentTypes>COMMERCIAL_INVOICE</ShippingDocumentTypes>
                   <CommercialInvoiceDetail>
                      <Format>
                         <ImageType>PDF</ImageType>
                         <StockType>PAPER_LETTER</StockType>
                         <ProvideInstructions>1</ProvideInstructions>
                      </Format>
                   </CommercialInvoiceDetail>
                </ShippingDocumentSpecification>
                
                <PackageCount>1</PackageCount>
                <RequestedPackageLineItems>
                   <SequenceNumber>1</SequenceNumber>
                   <Weight>
                      <Units>LB</Units>
                      <Value>2.00</Value>
                   </Weight>
    
                   <Dimensions>
                              <Length>6</Length>
                              <Width>6</Width>
                              <Height>12</Height>
                              <Units>IN</Units>
                            </Dimensions>
                </RequestedPackageLineItems>
             </RequestedShipment>
          </ProcessShipmentRequest>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

这是我得到的错误

ProcessShipmentRequest 验证失败错误:cvc-complex-type.2.4.a:发现从元素“SpecialServicesRequested”开始的无效内容。 '{"http://fedex.com/ws/ship/v28":RequestedPackageLineItems}' 之一是预期的。

【问题讨论】:

    标签: xml api soap fedex


    【解决方案1】:

    我刚刚对您的请求进行了一些小改动,并得到了成功的响应。特别是,

    • 删除所有空行
    • SpecialServicesRequested移到ShippingChargesPayment下方

    即:

    <ProcessShipmentRequest xmlns="http://fedex.com/ws/ship/v28">
      <WebAuthenticationDetail>
        <UserCredential>
          <Key>xxxxxxx</Key>
          <Password>xxxxxxxxxxx</Password>
        </UserCredential>
      </WebAuthenticationDetail>
      <ClientDetail>
        <AccountNumber>xxxxxxxxxxx</AccountNumber>
        <MeterNumber>xxxxxxxxxxx</MeterNumber>
      </ClientDetail>
      <TransactionDetail>
        <CustomerTransactionId>Customer Order Id:1700000112</CustomerTransactionId>
      </TransactionDetail>
      <Version>
        <ServiceId>ship</ServiceId>
        <Major>28</Major>
        <Intermediate>0</Intermediate>
        <Minor>0</Minor>
      </Version>
      <RequestedShipment>
        <ShipTimestamp>2021-06-11T05:24:19+00:00</ShipTimestamp>
        <DropoffType>REGULAR_PICKUP</DropoffType>
        <ServiceType>GROUND_HOME_DELIVERY</ServiceType>
        <PackagingType>YOUR_PACKAGING</PackagingType>
        <Shipper>
          <Contact>
            <PersonName></PersonName>
            <CompanyName>SpaWorks</CompanyName>
            <PhoneNumber>602.992.3888</PhoneNumber>
            <EMailAddress>sales@spaworks.net</EMailAddress>
          </Contact>
          <Address>
            <StreetLines>2514 East Mohawk Lane Suite 105</StreetLines>
            <City>Phoenix</City>
            <StateOrProvinceCode>AZ</StateOrProvinceCode>
            <PostalCode>85050</PostalCode>
            <CountryCode>US</CountryCode>
            <Residential>false</Residential>
          </Address>
        </Shipper>
        <Recipient>
          <Contact>
            <PersonName>John Willam</PersonName>
            <CompanyName></CompanyName>
            <PhoneNumber>9879879874</PhoneNumber>
            <EMailAddress>recipient@gmail.com</EMailAddress>
          </Contact>
          <Address>
            <StreetLines>1282 Camden Place </StreetLines>
            <StreetLines></StreetLines>
            <City>Charleston</City>
            <StateOrProvinceCode>SC</StateOrProvinceCode>
            <PostalCode>29424</PostalCode>
            <CountryCode>US</CountryCode>
            <Residential>true</Residential>
          </Address>
        </Recipient>
        <ShippingChargesPayment>
          <PaymentType>SENDER</PaymentType>
          <Payor>
            <ResponsibleParty>
              <AccountNumber>xxxxxxxxx</AccountNumber>
              <Tins>
                <TinType>BUSINESS_STATE</TinType>
                <Number>213456</Number>
              </Tins>
              <Contact>
                <ContactId>12345</ContactId>
                <PersonName>SpaWorks</PersonName>
              </Contact>
            </ResponsibleParty>
          </Payor>
        </ShippingChargesPayment>
        <SpecialServicesRequested>
          <SpecialServiceTypes>FEDEX_2_DAY</SpecialServiceTypes>
          <SpecialServiceTypes>EVENT_NOTIFICATION</SpecialServiceTypes>
          <EventNotificationDetail>
            <AggregationType>PER_SHIPMENT</AggregationType>
            <PersonalMessage>Personal message</PersonalMessage>
            <EventNotifications>
              <Role>RECIPIENT</Role>
              <Events>ON_SHIPMENT</Events>
              <NotificationDetail>
                <NotificationType>EMAIL</NotificationType>
                <EmailDetail>
                  <EmailAddress>john@fedex.com</EmailAddress>
                  <Name>John Smith</Name>
                </EmailDetail>
                <Localization>
                  <LanguageCode>EN</LanguageCode>
                </Localization>
              </NotificationDetail>
              <FormatSpecification>
                <Type>HTML</Type>
              </FormatSpecification>
            </EventNotifications>
          </EventNotificationDetail>
        </SpecialServicesRequested>
        <CustomsClearanceDetail>
          <DutiesPayment>
            <PaymentType>SENDER</PaymentType>
            <Payor>
              <ResponsibleParty>
                <AccountNumber>xxxxxxxx</AccountNumber>
                <Tins>
                  <TinType>BUSINESS_STATE</TinType>
                  <Number>213456</Number>
                </Tins>
                <Contact>
                  <ContactId>12345</ContactId>
                  <PersonName>Input Your Information</PersonName>
                </Contact>
              </ResponsibleParty>
            </Payor>
          </DutiesPayment>
        </CustomsClearanceDetail>
        <LabelSpecification>
          <LabelFormatType>COMMON2D</LabelFormatType>
          <ImageType>PNG</ImageType>
          <LabelStockType>PAPER_4X6</LabelStockType>
        </LabelSpecification>
        <ShippingDocumentSpecification>
          <ShippingDocumentTypes>COMMERCIAL_INVOICE</ShippingDocumentTypes>
          <CommercialInvoiceDetail>
            <Format>
              <ImageType>PDF</ImageType>
              <StockType>PAPER_LETTER</StockType>
              <ProvideInstructions>1</ProvideInstructions>
            </Format>
          </CommercialInvoiceDetail>
        </ShippingDocumentSpecification>
        <PackageCount>1</PackageCount>
        <RequestedPackageLineItems>
          <SequenceNumber>1</SequenceNumber>
          <Weight>
            <Units>LB</Units>
            <Value>2.00</Value>
          </Weight>
          <Dimensions>
            <Length>6</Length>
            <Width>6</Width>
            <Height>12</Height>
            <Units>IN</Units>
          </Dimensions>
        </RequestedPackageLineItems>
      </RequestedShipment>
    </ProcessShipmentRequest>
    

    【讨论】:

      猜你喜欢
      • 2012-02-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-18
      • 1970-01-01
      • 1970-01-01
      • 2016-01-30
      • 2015-05-26
      相关资源
      最近更新 更多