php - Google longrunning 操作无法将绑定映射到任何 Uri 模板
问题描述
我尝试实现此示例 https://cloud.google.com/vision/docs/pdf#vision-pdf-detection-gcs-php以从 .pdf 文件中获取一些信息,但是当脚本生成时出现此错误脚本等待谷歌响应时的“长轮询操作”
我试图从扫描的 pdf 中获取一些信息
这是控制台中显示的错误
PS D:\www\google\Text_ORC> php pdf_detect.php
Make Request.
Waiting for operation to finish.
PHP Fatal error: Uncaught Google\ApiCore\ValidationException: Could not map bindings for google.longrunning.Operations/GetOperation to any Uri template.
Bindings: Array
(
[name] => projects/riconoscimento-bolletta/operations/192575c87c35529b
)
UriTemplates: Array
(
[0] => /v1/{name=operations/*}
[1] => /v1/{name=locations/*/operations/*}
)
in D:\www\google\Text_ORC\vendor\google\gax\src\RequestBuilder.php:117
Stack trace:
#0 D:\www\google\Text_ORC\vendor\google\gax\src\Transport\RestTransport.php(109): Google\ApiCore\RequestBuilder->build('google.longrunn...', Object(Google\LongRunning\GetOperationRequest), Array)
#1 D:\www\google\Text_ORC\vendor\google\gax\src\GapicClientTrait.php(478): Google\ApiCore\Transport\RestTransport->startUnaryCall(Object(Google\ApiCore\Call), Array)
#2 D:\www\google\Text_ORC\vendor\google\gax\src\Middleware\CredentialsWrapperMiddleware.php(61): Google\ApiCore\LongRunning\Gapic\OperationsGapicClient->Google\ApiCore\{closure}(Object(Google\ApiCore\Call), Array)
#3 D:\www\google\Text_ORC\ in D:\www\google\Text_ORC\vendor\google\gax\src\RequestBuilder.php on line 117
Fatal error: Uncaught Google\ApiCore\ValidationException: Could not map bindings for google.longrunning.Operations/GetOperation to any Uri template.
Bindings: Array
(
[name] => projects/riconoscimento-bolletta/operations/192575c87c35529b
)
UriTemplates: Array
(
[0] => /v1/{name=operations/*}
[1] => /v1/{name=locations/*/operations/*}
)
in D:\www\google\Text_ORC\vendor\google\gax\src\RequestBuilder.php:117
Stack trace:
#0 D:\www\google\Text_ORC\vendor\google\gax\src\Transport\RestTransport.php(109): Google\ApiCore\RequestBuilder->build('google.longrunn...', Object(Google\LongRunning\GetOperationRequest), Array)
#1 D:\www\google\Text_ORC\vendor\google\gax\src\GapicClientTrait.php(478): Google\ApiCore\Transport\RestTransport->startUnaryCall(Object(Google\ApiCore\Call), Array)
#2 D:\www\google\Text_ORC\vendor\google\gax\src\Middleware\CredentialsWrapperMiddleware.php(61): Google\ApiCore\LongRunning\Gapic\OperationsGapicClient->Google\ApiCore\{closure}(Object(Google\ApiCore\Call), Array)
#3 D:\www\google\Text_ORC\ in D:\www\google\Text_ORC\vendor\google\gax\src\RequestBuilder.php on line 117
我的脚本中的代码与示例中的代码相同谢谢
解决方案
联系 Google 支持后,在 gitHub 项目上打开了一个问题,很快该错误将得到解决。这是问题链接:
推荐阅读
- node.js - 在 tizen 上使用节点 js 创建 Web 应用程序
- python - 在 python 中处理 .csv
- php - 在 PHP 中创建动态产品页面
- swift - SWIFTUI 警告 imagePickerController 几乎匹配 - 仅在现有的 swift 项目文件中发生
- terraform - Terraform 查找跨子网可用的 IP 地址
- css - PythonAnywhere 上的 MIME 类型错误 Django/React 项目
- recaptcha - Google reCAPTCHA V2 错误:我们检测到您的网站未验证 reCAPTCHA 解决方案。这是在您的设备上正确使用 reCAPTCHA 所必需的
- sql - 如何复制所有记录并在OracleDB中的同一张表中添加一些更改
- c# - 如何将此实体框架查询转换为 SQL Server 查询
- python-3.x - 如何做到这一点,以便当我按下鼠标时,其中的代码不会变慢?Python