我编写了一个应用程序,它解析 CSV 文件、提取地址并使用 Bing Maps REST API 对其进行地理编码。我遇到的问题是,如果我多次运行同一个文件,我会得到不同的结果。在第一次试验中,第 2 行和第 6 行可能不会返回任何匹配项。在接下来的试验中,第 2 行和第 6 行将返回匹配项,而第 4 行可能不会。我使用 Fiddler 检查了 HTTP 流量。我的请求格式正确,每个响应都返回 HTTP 状态代码 200 和有效的 JSON,只有一些地址产生结果,而另一些则没有,并且特定地址的成功或失败因试验而异。任何人都可以提供任何见解吗?
更新
样品要求:
GET http://dev.virtualearth.net/REST/v1/Locations?o=json&adminDistrict=MI&locality=Shelby&postalCode=49455-1299&addressLine=72+South+State+Street&key={MyApiKey} HTTP/1.1
Host: dev.virtualearth.net
示例响应:
HTTP/1.1 200 OK
Cache-Control: no-cache
Transfer-Encoding: chunked
Content-Type: application/json
Server: Microsoft-IIS/8.0
X-BM-TraceID: 9b6cfaa0abdb47b7b7e2790900bcddce
X-BM-Srv: BL2M001304, BL2MSNVM001275, BL2MSNVM001299
X-MS-BM-WS-INFO: 0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 22 Feb 2013 15:14:30 GMT
247
{
"authenticationResultCode":"ValidCredentials",
"brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",
"copyright":"Copyright © 2013 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.",
"resourceSets":
[
{
"estimatedTotal":0,
"resources":[]
}
],
"statusCode":200,
"statusDescription":"OK",
"traceId":"9b6cfaa0abdb47b7b7e2790900bcddce|BL2M001304|02.00.83.1900|BL2MSNVM001275, BL2MSNVM001299"
}
0
我在 MSDN 论坛上的帖子:http: //social.msdn.microsoft.com/Forums/en-US/bingmapsservices/thread/c7fea1b2-f87e-40c2-a3a6-496989a338b2#b885ca9a-018a-491f-9caa-a00a515cf9a8