我们已在一个ruby on rails应用程序中集成了Fedex API。
我们需要最近的下车地点。我们希望通过DANGEROUS_GOODS_SERVICES过滤位置。
我们检查了fedex 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>
我们没有得到任何危险品的回复。 任何解决方案。
答案 0 :(得分:0)
将搜索范围从10.0公里增加到20.0公里,因为原始半径范围内没有有效位置。此外,还有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>