【问题标题】:Validate Fedex Location Search Request验证 Fedex 位置搜索请求
【发布时间】:2016-02-24 08:48:31
【问题描述】:

我们已将 Fedex API 集成到 ruby​​ on rails 应用程序中。

我们需要最近的下车地点。我们想按 DANGEROUS_GOODS_SERVICES 过滤位置。

我们检查了fedex locationService pdf 文件,发现我们正在请求以下 xml 请求格式。

请求

  <SearchLocationsRequest xmlns="http://fedex.com/ws/locs/v3">
  <UserCredential>
    <Key>XXXXXXXXXXXX</Key>
    <Password>XXXXXXXXXXXXXX</Password>
  </UserCredential>
  <WebAuthenticationDetail/>
  <ClientDetail>
    <AccountNumber>XXXXXXXXXX</AccountNumber>
    <MeterNumber>XXXXXXXXX</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>

回应

{"SearchLocationsReply"=>{"HighestSeverity"=>"ERROR", "Notifications"=>{"Severity"=>"ERROR", "Source"=>"prof", "Code"=>"1000", "Message"=>"Authentication Failed"}, "Version"=>{"ServiceId"=>"locs", "Major"=>"1", "Intermediate"=>"0", "Minor"=>"0"}}}

我们收到的身份验证失败消息,而相同的凭据正在用于获取费率和标签。

【问题讨论】:

    标签: web-services fedex


    【解决方案1】:

    我遇到了和你一样的问题,几个小时后我发现问题是从fedex电子邮件确认中复制了一些不可见的字符。在文本编辑器中可以看到它们:

    注意密钥/密码开头和结尾的奇怪字符。

    去掉这些字符后问题就解决了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-18
      • 1970-01-01
      相关资源
      最近更新 更多