Web Services 联邦快递位置搜索请求

m2xkgtsf  于 2023-01-17  发布在  其他
关注(0)|答案(1)|浏览(155)

我们已经在ruby on rails应用程序中集成了Fedex API。
我们需要最近的卸货地点。我们要按DANGEROUS_GOODS_SERVICES筛选地点。
我们已经检查了联邦快递locationService pdf文件,发现了我们请求的以下xml请求格式。

请求

<SearchLocationsRequest xmlns="http://fedex.com/ws/locs/v3"> [^]
  <UserCredential>
    <Key>xxxxxxxxxxxx</Key>
    <Password>xxxxxxxxxxxxx</Password>
  </UserCredential>
  <WebAuthenticationDetail/>
  <ClientDetail>
    <AccountNumber>xxxxxxxxx</AccountNumber>
    <MeterNumber>xxxxxxxxxxx</MeterNumber>
    <Region>us</Region>
  </ClientDetail>
  <Version>
    <ServiceId>locs</ServiceId>
    <Major>1</Major>
    <Intermediate>0</Intermediate>
    <Minor>0</Minor>
  </Version>
  <EffectiveDate>2016-04-13</EffectiveDate>
  <LocationsSearchCriterion>ADDRESS</LocationsSearchCriterion>
  <Address>
    <StreetLines>811 E 1950 N</StreetLines>
    <City>Spanish Fork</City>
    <StateOrProvinceCode/>
    <PostalCode>84660</PostalCode>
    <UrbanizationCode/>
    <CountryCode>US</CountryCode>
    <Residential>0</Residential>
  </Address>
  <PhoneNumber/>
  <GeographicCoordinates/>
  <MultipleMatchesAction>RETURN_ALL</MultipleMatchesAction>
  <SortDetail>
    <Criterion>DISTANCE</Criterion>
    <Order>LOWEST_TO_HIGHEST</Order>
  </SortDetail>
  <Constraints>
    <RadiusDistance>
      <Value>10.0</Value>
      <Units>KM</Units>
    </RadiusDistance>
  </Constraints>
</SearchLocationsRequest>

我们没有收到任何关于危险品的回复。任何解决方案。

rslzwgfq

rslzwgfq1#

将搜索半径从10.0 KM增加到20.0 KM左右,因为在原始半径内似乎没有有效位置。此外,还有Constraints. RequiredLocationAttributes,您可以在其中专门定义"DANGEROUS_GOODS_SERVICES",以便仅查看支持该属性的位置。

    • 请求**
<q0:SearchLocationsRequest>
      <q0:WebAuthenticationDetail>
        <q0:UserCredential>
          <q0:Key>removed</q0:Key>
          <q0:Password>removed</q0:Password>
        </q0:UserCredential>
      </q0:WebAuthenticationDetail>
      <q0:ClientDetail>
        <q0:AccountNumber>removed</q0:AccountNumber>
        <q0:MeterNumber>removed</q0:MeterNumber>
        <q0:Region>US</q0:Region>
      </q0:ClientDetail>
      <q0:Version>
        <q0:ServiceId>locs</q0:ServiceId>
        <q0:Major>3</q0:Major>
        <q0:Intermediate>0</q0:Intermediate>
        <q0:Minor>0</q0:Minor>
      </q0:Version>
      <q0:EffectiveDate>2016-04-13</q0:EffectiveDate>
      <q0:LocationsSearchCriterion>ADDRESS</q0:LocationsSearchCriterion>
      <q0:Address>
        <q0:StreetLines>811 E 1950 N</q0:StreetLines>
        <q0:City>Spanish Fork</q0:City>
        <q0:StateOrProvinceCode/>
        <q0:PostalCode>84660</q0:PostalCode>
        <q0:UrbanizationCode/>
        <q0:CountryCode>US</q0:CountryCode>
        <q0:Residential>true</q0:Residential>
      </q0:Address>
      <q0:PhoneNumber/>
      <q0:GeographicCoordinates/>
      <q0:MultipleMatchesAction>RETURN_ALL</q0:MultipleMatchesAction>
      <q0:SortDetail>
        <q0:Criterion>DISTANCE</q0:Criterion>
        <q0:Order>LOWEST_TO_HIGHEST</q0:Order>
      </q0:SortDetail>
      <q0:Constraints>
        <q0:RadiusDistance>
          <q0:Value>20.0</q0:Value>
          <q0:Units>KM</q0:Units>
        </q0:RadiusDistance>
        <q0:RequiredLocationAttributes>DANGEROUS_GOODS_SERVICES</q0:RequiredLocationAttributes>
      </q0:Constraints>
    </q0:SearchLocationsRequest>

相关问题