地理编码API问题ZERO_RESULTS API响应,但在浏览器中工作 [英] Geocoding API issue ZERO_RESULTS in api response but works in browser

查看:105
本文介绍了地理编码API问题ZERO_RESULTS API响应,但在浏览器中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用地理编码API的标准许可证,并且我们发现服务响应中存在一些间歇性问题,我们从API获取ZERO_RESULTS,但是当我们在浏览器中使用相同的地址时,它的工作原理并给予我们确定状态,在那段时间内为多个地址。但过了一段时间后又开始工作了。所以我很困惑,如果今天上午9点到11点30分有停机时间。

we are using the standard license for Geocoding APIs and we observed that there are some intermittent issue with the service response, we get ZERO_RESULTS from API but when we use the same address in browser it works and gives us OK status and it happened for multiple address during that time. but after sometime it started working again. so i am confused if there was down time today between 9 AM 11:30 AM PST.

我也检查了控制台开发人员仪表板,我没有发现任何错误/由google报告的延迟。我也检查了quata,我们只使用了1.5%的每日限额。

i checked the console developer dashboard also and i didn't find any error/latency reported by google. i checked the quata also and we just used only 1.5% of daily limit.

这里是代码

private bool ValidateAddressSearch()
    {
        Stream dataRecieved = null;
        StreamReader reader = null;
        XmlDocument xDoc = null;
        bool returnVal = true;
        WebRequest request = null;
        WebResponse response = null;
        try
        {
            request = WebRequest.Create(https://maps.googleapis.com/maps/api/geocode/xml?address=Oak%20Pond%20Ln%20%20Alachua%20Gainesville%20FL%2032608%20US&sensor=false&key=OURKEY);
            request.ContentType = "text/xml";
            response = request.GetResponse();
            if (response != null)
            {
                dataRecieved = response.GetResponseStream();
                reader = new StreamReader(dataRecieved);
                string sText = reader.ReadToEnd();
                if (!string.IsNullOrEmpty(sText))
                {
                    xDoc = new XmlDocument();
                    xDoc.LoadXml(sText);
                    XmlDocumentResponse = xDoc;
                    returnVal = (xDoc != null && xDoc.HasChildNodes) ? true : false;
                }
            }
        }
        catch (Exception ex)
        {
            //Trace.Write(ex);`enter code here`
            returnVal = false;
        }
        finally
        {
            dataRecieved = null;
            reader = null;
            request = null;
            response = null;
        }
        return returnVal;
    }

这个问题在一个月内随机发生多次。

this issue happens randomly multiple times in a month.

感谢您
Alok

Thanks Alok

推荐答案

您可能已经看到这个错误: https://code.google.com/p/gmaps-api -issues / issues / detail?id = 10585

You might have been seeing this bug: https://code.google.com/p/gmaps-api-issues/issues/detail?id=10585

现在标记为已修正。

这篇关于地理编码API问题ZERO_RESULTS API响应,但在浏览器中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆