Web services 验证联邦快递位置搜索请求

Web services 验证联邦快递位置搜索请求,web-services,fedex,Web Services,Fedex,我们已经在ruby on rails应用程序中集成了FedExAPI 我们需要最近的下车地点。我们希望通过危险品和服务来筛选位置 我们检查了fedex locationService pdf文件,发现我们正在请求以下xml请求格式 请求 <SearchLocationsRequest xmlns="http://fedex.com/ws/locs/v3"> <UserCredential> <Key>XXXXXXXXXXXX</Key&g

我们已经在ruby on rails应用程序中集成了FedExAPI

我们需要最近的下车地点。我们希望通过危险品和服务来筛选位置

我们检查了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>

我们收到的身份验证失败消息,而相同的Credentail正在为获取费率和标签而工作。

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

小心钥匙/密码开头和结尾的奇怪字符

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

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