Zend GData を使用してドキュメントを Google ドキュメントにアップロードしています。
コードは正常に動作しますが、たまに例外が発生します。
400 Bad Request - Unable to convert document.
これは断続的な問題です。したがって、コードは問題ではないと思います。
try {
$test=$sharedocs->insertEntry($dataShare, $uri, 'Zend_Gdata_Entry',$header);
} catch (Exception $e ) {
echo $e->getMessage();
exit();
}
ここに例外があります
Zend_Gdata_App_HttpException オブジェクト
(
[_httpClientException:保護] =>
[_response:protected] => Zend_Http_Response オブジェクト
(
[バージョン:保護] => 1.1
[コード:保護] => 400
[メッセージ:保護] => 不正なリクエスト
[headers:protected] => 配列
(
[コンテンツタイプ] => text/html; 文字セット=UTF-8
[日付] => 2012 年 12 月 14 日金曜日 23:32:18 GMT
[有効期限] => 2012 年 12 月 14 日金曜日 23:32:18 GMT
[キャッシュ制御] => プライベート、最大年齢 = 0
[X-content-type-options] => nosniff
[X-frame-options] => SAMEORIGIN
[X-xss-保護] => 1; モード=ブロック
[サーバー] => GSE
[接続] => 閉じる
)
[body:protected] => ドキュメントを変換できません。
)
[_previous:Zend_Exception:private] =>
[message:protected] => 応答コード 200 が予想され、400 を取得
ドキュメントを変換できません。
[文字列:例外:プライベート] =>
[コード:保護] => 0
[ファイル:保護] => /usr/local/zend/share/ZendFramework/library/Zend/Gdata/App.php
[行:保護] => 714
[trace:Exception:private] => 配列
(
[0] => 配列
(
[ファイル] => /usr/local/zend/share/ZendFramework/library/Zend/Gdata.php
[行] => 219
[関数] => performHttpRequest
[クラス] => Zend_Gdata_App
[タイプ] => ->
[args] => 配列
(
[0] => 投稿
[1] => https://docs.google.com/feeds/documents/private/full
[2] => 配列
(
[0] => Content-Type: マルチパート/関連。境界="END_OF_PART"
[1] => スラッグ: test.doc
[2] => コンテンツ タイプ: アプリケーション/msword
[3] => リソース ID:4321
[x-http-メソッドオーバーライド] =>
[認可] => AuthSub トークン="xxxxx"
)
[3] =>
議論の余地 (12345)
[4] => アプリケーション/atom+xml
[5] =>
)
)
[1] => 配列
(
[ファイル] => /usr/local/zend/share/ZendFramework/library/Zend/Gdata/App.php
[行] => 905
[関数] => performHttpRequest
[クラス] => Zend_Gdata
[タイプ] => ->
[args] => 配列
(
[0] => 投稿
[1] => https://docs.google.com/feeds/documents/private/full
[2] => 配列
(
[0] => Content-Type: マルチパート/関連。境界="END_OF_PART"
[1] => スラッグ: test.doc
[2] => コンテンツ タイプ: アプリケーション/msword
[3] => リソース ID:4321
[x-http-メソッドオーバーライド] =>
)
[3] =>
議論の余地 (12345)
[4] => アプリケーション/atom+xml
)
)
[2] => 配列
(
[ファイル] => /usr/local/zend/share/ZendFramework/library/Zend/Gdata/App.php
[行] => 980
[関数] => ポスト
[クラス] => Zend_Gdata_App
[タイプ] => ->
[args] => 配列
(
[0] =>
議論の余地 (12345)
[1] =>
[2] =>
[3] =>
[4] => 配列
(
[0] => Content-Type: マルチパート/関連。境界="END_OF_PART"
[1] => スラッグ: test.doc
[2] => コンテンツ タイプ: アプリケーション/msword
[3] => リソース ID:4321
)
)
)
[3] => 配列
(
[ファイル] => /var/www/GoogleFunctions.php
[行] => 90
[関数] => insertEntry
[クラス] => Zend_Gdata_App
[タイプ] => ->
[args] => 配列
(
[0] =>
議論の余地 (12345)
[1] =>
[2] => Zend_Gdata_Entry
[3] => 配列
(
[0] => Content-Type: マルチパート/関連。境界="END_OF_PART"
[1] => スラッグ: test.doc
[2] => コンテンツ タイプ: アプリケーション/msword
[3] => リソース ID:4321
)
)
)
[4] => 配列
(
[ファイル] => /var/www/myPaper.php
[行] => 342
[関数] => createNewDoc
[args] => 配列
(
[0] => 議論の余地 (12345)
[1] => Zend_Gdata_Docs オブジェクト
(
[_defaultPostUri:protected] => https://docs.google.com/feeds/documents/private/full
[_registeredPackages:protected] => 配列
(
[0] => Zend_Gdata_Docs
[1] => Zend_Gdata_Kind
[2] => Zend_Gdata_Extension
[3] => Zend_Gdata
[4] => Zend_Gdata_App_Extension
[5] => Zend_Gdata_App
)
[_httpClient:protected] => Zend_Gdata_HttpClient オブジェクト
(
[_authSubPrivateKeyId:Zend_Gdata_HttpClient:private] =>
[_authSubToken:Zend_Gdata_HttpClient:private] => 1/xxxxx
[_clientLoginToken:Zend_Gdata_HttpClient:private] =>
[_clientLoginKey:Zend_Gdata_HttpClient:private] =>
[_streamingRequest:保護] =>
[config:protected] => 配列
(
[最大リダイレクト] => 0
[厳密なリダイレクト] => 1
[ユーザーエージェント] => Zend_Framework_Gdata/1.11.12
[タイムアウト] => 10
[アダプター] => Zend_Http_Client_Adapter_Socket
[httpバージョン] => 1.1
[キープアライブ] =>
[ストア応答] => 1
[厳格] => 1
[出力ストリーム] =>
[encodecookies] => 1
[rfc3986_strict] =>
)
[adapter:protected] => Zend_Http_Client_Adapter_Socket オブジェクト
(
[ソケット:保護] =>
[connected_to:protected] => 配列
(
[0] =>
[1] =>
)
[out_stream:保護] =>
[config:protected] => アレイ
(
[しつこい] =>
[ssltransport] => ssl
[sslcert] =>
[sslパスフレーズ] =>
[sslusecontext] =>
[最大リダイレクト] => 0
[厳密なリダイレクト] => 1
[ユーザーエージェント] => Zend_Framework_Gdata/1.11.12
[タイムアウト] => 10
[httpバージョン] => 1.1
[キープアライブ] =>
[ストア応答] => 1
[厳格] => 1
[出力ストリーム] =>
[encodecookies] => 1
[rfc3986_strict] =>
)
[メソッド:保護] => POST
[_context:protected] => リソース ID #10
)
[uri:protected] => Zend_Uri_Http オブジェクト
(
[_username:保護] =>
[_パスワード:保護] =>
[_host:protected] => docs.google.com
[_port:保護] => 443
[_path:protected] => /feeds/documents/private/full
[_query:保護] =>
[_fragment:保護] =>
[_regex:protected] => 配列
(
[エスケープ] => %[[:xdigit:]]{2}
[未予約] => [A-Za-z0-9-_.!~*'()\[\]]
[セグメント] => (?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\]:@&=+$,;] )*
[パス] => (?:\/(?:(?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\]: @&=+$,;])*)?)+
[uric] => (?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\];\/?:@&=+ $,])
)
[_scheme:protected] => https
)
[headers:protected] => 配列
(
[ユーザーエージェント] => 配列
(
[0] => ユーザーエージェント
[1] => MyCompany-MyApp-1.0 Zend_Framework_Gdata/1.11.12
)
[コンテンツタイプ] => 配列
(
[0] => コンテンツ タイプ
[1] => アプリケーション/atom+xml
)
[スラッグ] => 配列
(
[0] => ナメクジ
[1] => test.doc
)
[リソース ID] => 配列
(
[0] => リソース ID
[1] => 4321
)
[認可] => 配列
(
[0] => 承認
[1] => AuthSub トークン="1/xxxxx"
)
[accept-encoding] => 配列
(
[0] => Accept-encoding
[1] => アイデンティティ
)
[内容の長さ] => 配列
(
[0] => コンテンツの長さ
[1] => 273
)
)
[メソッド:保護] => POST
[paramsGet:protected] => 配列
(
)
[paramsPost:protected] => 配列
(
)
[enctype:protected] => アプリケーション/atom+xml
[raw_post_data:保護] =>
議論の余地 (12345)
[認証:保護] =>
[files:protected] => 配列
(
)
[body_field_order:protected] => 配列
(
[サービス] => SCALAR
)
[cookiejar:保護] =>
[last_request:protected] => POST /feeds/documents/private/full HTTP/1.1
ホスト: docs.google.com
接続: 閉じる
ユーザーエージェント: MyCompany-MyApp-1.0 Zend_Framework_Gdata/1.11.12
コンテンツタイプ: application/atom+xml
スラッグ: test.doc
リソース ID: 4321
承認: AuthSub トークン="1/xxxxx"
Accept-encoding: ID
コンテンツの長さ: 273
議論の余地 (12345)
[last_response:protected] => Zend_Http_Response オブジェクト
(
[バージョン:保護] => 1.1
[コード:保護] => 400
[メッセージ:保護] => 不正なリクエスト
[headers:protected] => 配列
(
[コンテンツタイプ] => text/html; 文字セット=UTF-8
[日付] => 2012 年 12 月 14 日金曜日 23:32:18 GMT
[有効期限] => 2012 年 12 月 14 日金曜日 23:32:18 GMT
[キャッシュ制御] => プライベート、最大年齢 = 0
[X-content-type-options] => nosniff
[X-frame-options] => SAMEORIGIN
[X-xss-保護] => 1; モード=ブロック
[サーバー] => GSE
[接続] => 閉じる
)
[body:protected] => ドキュメントを変換できません。
)
[redirectCounter:保護] => 0
[_unmaskStatus:保護] =>
[_queryBracketsEscaped:保護] => 1
)
[_majorProtocolVersion:保護] => 1
[_minorProtocolVersion:保護] =>
[_useObjectMapping:保護] => 1
)
)
)
)
[前:例外:非公開] =>
)