首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FedEx FEDEX_ONE_RATE API航运问题

FedEx FEDEX_ONE_RATE API航运问题
EN

Stack Overflow用户
提问于 2021-06-11 14:26:25
回答 1查看 122关注 0票数 0

在此附上完整的(post man) SOAP请求

代码语言:javascript
复制
<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- with .2.4.a:从元素'SpecialServicesRequested‘开始找到无效的内容。{“http://fedex.com/ws/ship/v28":RequestedPackageLineItems}”中的一个是预期的。

EN

回答 1

Stack Overflow用户

发布于 2021-06-15 09:23:22

我只是对你的要求做了几处小小的改动,得到了成功的回应。特别地,

删除ShippingChargesPayment下面的所有空行

  • 移动SpecialServicesRequested

即:

代码语言:javascript
复制
<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>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67938782

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档