简体   繁体   English

Android:调用https://maps.googleapis.com/maps/api/geocode/xml时获取HTTP 403禁止

[英]Android: Getting HTTP 403 Forbidden upon calling https://maps.googleapis.com/maps/api/geocode/xml

I've developed an Android Application since 2012. Since now I've made use of the free web service api v3 for geocoding without an API key so that we have a limit of 2,500 request per IP and not for KEY without problems: 自2012年以来,我已经开发了Android应用程序。从那时起,我就使用了免费的网络服务api v3进行了无API密钥的地理编码,因此我们每个IP的请求限制为2500个,而对KEY的限制是没有问题的:

https://maps.googleapis.com/maps/api/geocode/xml https://maps.googleapis.com/maps/api/geocode/xml

All has worked fine until this period when sometimes some of my users soffers of error 403 - Forbidden during this web server call. 到此期间一切正常为止,此时我的某些用户有时会出现错误403-在此Web服务器调用期间被禁止。

Has Google Changed something for the use of his webservices? Google对其使用的Web服务进行了更改吗?

Eventually I could use the Geocoder class of the Android Framework. 最终,我可以使用Android Framework的Geocoder类。

But I've still another webservice that i call: 但是我还有另一个Web服务,我称之为:

https://maps.googleapis.com/maps/api/directions/xml https://maps.googleapis.com/maps/api/directions/xml

Could also this webservice suffer of the 403 error? 此网络服务还可能会遭受403错误吗? Up to now I don't know because if I get 403 error in geocode I won't call the direction webservice. 到目前为止,我还不知道,因为如果我在地址解析中遇到403错误,就不会调用网络服务方向。

Here's a little information you may want to look over... You can find more about this here . 这是您可能需要查看的一些信息...您可以在此处找到更多有关此的信息

HTTP 403 response HTTP 403响应

Requests to the web services may also receive a HTTP 403 (Forbidden) error. 对Web服务的请求也可能会收到HTTP 403(禁止)错误。 In most cases, this is due to an invalid URL signature. 在大多数情况下,这是由于无效的URL签名引起的。 To verify this, remove the client and signature parameters and try again: 要验证这一点,请删除客户端和签名参数,然后重试:

If the response is HTTP 200 (OK), the signature was the problem. 如果响应是HTTP 200(确定),则签名是问题所在。 This is not related to usage limits; 这与使用限制无关; see Troubleshooting authentication issues in the Web Services chapter of the Google Maps API for Work documentation for details. 有关详细信息,请参见Google Maps API for Work文档的Web服务一章中的身份验证问题疑难解答。 If the response is still a HTTP 403 (Forbidden) error, the signature was not necessarily the problem, it may be related to usage limits instead. 如果响应仍然是HTTP 403(禁止)错误,则签名不一定是问题,它可能与使用限制有关。 This typically means your access to the web service has been blocked on the grounds that your application has been exceeding usage limits for too long or otherwise abused the web service. 这通常意味着您对Web服务的访问已被阻止,原因是您的应用程序超出了使用限制时间太长或滥用了Web服务。 Please contact Google Enterprise Support if you encounter this issue. 如果遇到此问题,请联系Google Enterprise支持。 Requests to all web services require URL signatures. 对所有Web服务的请求都需要URL签名。 Requests will also be rejected with a HTTP 403 (Forbidden) error when including the client parameter but missing the signature parameter, or vice versa. 当包含客户端参数但缺少签名参数时,请求也会被拒绝,并显示HTTP 403(禁止)错误,反之亦然。

Problems 问题

You can exceed the Google Maps API Web Services usage limits by: 您可以通过以下方式超出Google Maps API Web服务的使用限制:

Sending too many requests per day. 每天发送太多请求。 Sending requests too fast, ie too many requests per second. 发送请求太快,即每秒太多请求。 Sending requests too fast for too long or otherwise abusing the web service. 发送请求的时间太长太长时间,否则将滥用Web服务。 Exceeding other usage limits, eg points per request in the Elevation API. 超出其他使用限制,例如Elevation API中每个请求的点数。

Solutions 解决方案

The above problems can be address by combining two approaches: 通过组合两种方法可以解决上述问题:

Lowering usage, by optimizing applications to use the web services more efficiently. 通过优化应用程序以更有效地使用Web服务来降低使用率。 Increasing usage limits, when possible, by purchasing additional allowance for your Google Maps API for Work license. 在可能的情况下,通过购买Google Maps API for Work许可的额外津贴来提高使用限制。 This article will focus on ways of optimizing applications to use the web services more efficiently. 本文将重点介绍优化应用程序以更有效地使用Web服务的方式。

Here's another good link that may just help as well. 这是另一个很好的链接,也可能会有所帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试在Android上连接到https://maps.googleapis.com时获取SSLHandshakeException - Getting SSLHandshakeException when trying to connect to https://maps.googleapis.com on android Android TimeoutException连接到maps.googleapis.com - Android TimeoutException connecting to maps.googleapis.com Java Applet:连接到“ maps.googleapis.com”-拒绝访问(“ java.net.SocketPermission”) - Java applet: connect to “maps.googleapis.com” - access denied (“java.net.SocketPermission”) com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden - com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden Google Admob API - Java 客户端 - com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden - Google Admob API - Java client - com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden 调用“ https://fcm.googleapis.com/fcm/send”时,Firebase云消息传递出现内部服务器错误 - Firebase cloud messaging getting internal server error when calling “https://fcm.googleapis.com/fcm/send” Caused by: com.google.api.client.http.HttpResponseException: 400 Bad Request POST https://oauth2.googleapis.com/token - Caused by: com.google.api.client.http.HttpResponseException: 400 Bad Request POST https://oauth2.googleapis.com/token 无法在xml文件中使用com.google.android.maps - unable to use com.google.android.maps in the xml file HTTP Post 到 API 返回 403 FORBIDDEN - HTTP Post to API return 403 FORBIDDEN 无法获取“https://google.bintray.com/.../maven-metadata.xml”。 从服务器收到状态代码 403:禁止访问 - Could not GET 'https://google.bintray.com/.../maven-metadata.xml'. Received status code 403 from server: Forbidden
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM