Google.Apis.Requests.RequestError Backend Error [500] Errors [ Message[Backend Error] Location[ - ] Reason[backendError] Domain[global] ]

前提是你 提交于 2020-01-06 14:44:33

问题


What am trying is to fetch the locations using google coordinate api. The code snippet I used is as follows,

            String serviceAccountEmail = "mail.gserviceaccount.com";

            var certificate = new X509Certificate2(Server.MapPath("../CertStore/cert.p12"), "notasecret", X509KeyStorageFlags.Exportable);

            ServiceAccountCredential credential = new ServiceAccountCredential(
               new ServiceAccountCredential.Initializer(serviceAccountEmail)
               {
                   Scopes = new[] { CoordinateService.Scope.Coordinate }
               }.FromCertificate(certificate));

            // Create the service.
            var service = new CoordinateService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = credential,
                ApplicationName = "sample",
            });
            var list = service.Location.List("teamId", "workermail", 1000).Execute();

But am getting an exception as follows,

A first chance exception of type 'Google.GoogleApiException' occurred in Google.Apis.dll A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll A first chance exception of type 'System.Threading.ThreadAbortException' occurred in Google.Apis.dll Evaluation requires a thread to run temporarily. Use the Watch window to perform the evaluation.

stack trace

Source Error:

Line 395: ApplicationName = "sample",

Line 396: });

Line 397: var list = service.Location.List("teamId", "workermail", 1000).Execute();

Line 398:
Line 399:

Am doing anything wrong here?..

Thanks,

Anish.

来源:https://stackoverflow.com/questions/26633299/google-apis-requests-requesterror-backend-error-500-errors-messagebackend-e

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!