我正在通过REST更新Fusiontable样式。
但是我发现了(500)后端错误消息的错误。同时,我通过REST在fusiontable insert/update行中获得了成功的消息。
如何调试/解决此问题。
这是我的代码:
$columnName = self::getStyleColumnPrefix($style_id);
$strokeOpacity = '1';
$fillOpacity = '1';
$kind = 'fusiontables#fromColumn';
$tableId = $this->table;
$styleId = $style_id;
$fillColorStyler = new \Google_Service_Fusiontables_StyleFunction();
$fillColorStyler->setColumnName($columnName);
$fillColorStyler->setKind($kind);
$polygonOptions = new \Google_Service_Fusiontables_PolygonStyle();
$polygonOptions->setFillColorStyler($fillColorStyler);
$polygonOptions->setStrokeOpacity($strokeOpacity);
$polygonOptions->setFillOpacity($fillOpacity);
$postBody = new \Google_Service_Fusiontables_StyleSetting();
$postBody->setPolygonOptions($polygonOptions);
// $this->service = new \Google_Service_Fusiontables_Style_Resource();
$results = $this->service->style->update($tableId, $styleId, $postBody);我在最后一行出错了
$results = $this->service->style->update($tableId,$styleId,$postBody);
堆栈跟踪
文件: D:\xampp2\htdocs\itp-benchmarking\branches\development\vendor\google\apiclient\src\Google\Http\REST.php:110消息:错误调用PUT https://www.googleapis.com/fusiontables/v2/tables/1ycoFAd3BrVZ248zXausz4kKe66Jj3fZDeKvxlBMy/styles/1:(500)后端错误堆栈跟踪:@0 D:\xampp2\htdocs\itp-benchmarking\branches\development\vendor\google\apiclient\src\Google\Http\REST.php(62):Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request),对象( Google_Http_REST::doExecute(Object(Google_Client),Object(Google_Http_Request)) @2 D:\xampp2\htdocs\itp-benchmarking\branches\development\vendor\google\apiclient\src\Google\Task\Runner.php(174):call_user_func_array(Array,数组) @3 D:\xampp2\htdocs\itp-benchmarking\branches\development\vendor\google\apiclient\src\Google\Http\REST.php(46):_ D:\xampp2\htdocs\itp-benchmarking\branches\development\vendor\google\apiclient\src\Google\Client.php(590):Google_Http_REST::execute(Object(Google_Client),_>run() @4 D:\xampp2\htdocs\itp-benchmarking\branches\development\vendor\google\apiclient\src\Google\Client.php(590):Google_Http_REST::execute(Object(Google_Client),对象( D:\xampp2\htdocs\itp-benchmarking\branches\development\vendor\google\apiclient\src\Google\Service\Resource.php(237):Google_Client->execute(Object(Google_Http_Request)) @5 D:\xampp2\htdocs\itp-benchmarking\branches\development\vendor\google\apiclient\src\Google\Service\Fusiontables.php(904):@6 D:\xampp2\htdocs\itp-benchmarking\branches\development\vendor\google\apiclient\src\Google\Service\Fusiontables.php(904):_Service_Resource->调用(‘Google_Http_Request’,数组,@7 D:\xampp2\htdocs\itp-benchmarking\branches\development\module\BenchMarking\src\BenchMarking\Model\FusionTableModel.php(494):Google_Service_Fusiontables_Style_Resource->update('1ycoFAd3BrVZ248...',1,Object(Google_Service_Fusiontables_StyleSetting)) @8 D:\xampp2\htdocs\itp-benchmarking\branches\development\module\BenchMarking\src\BenchMarking\Controller\FusionTableController.php(268):BenchMarking\Model\FusionTableModel->setStyleIdOfMeasure(1)
我使用的是google(1.1版)。
发布于 2015-10-07 09:14:27
看起来您无法同时设置colorStyler和其他属性(如strokeOpacity )。当我移除后者时,我不再收到错误。
目前它还没有文档化,API错误响应在这件事上肯定会更清楚.
https://stackoverflow.com/questions/31561077
复制相似问题