2012-12-18 5 views
1

Zend GData를 사용하여 Google 문서에 문서를 업로드하고 있습니다.Google 문서 도구 API - Zend GData - 새 문서 만들기 - 400 잘못된 요청 - 문서를 변환 할 수 없음 - 간헐적 인

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 Object 
    (
     [_httpClientException:protected] => 
     [_response:protected] => Zend_Http_Response Object 
      (
       [version:protected] => 1.1 
       [code:protected] => 400 
       [message:protected] => Bad Request 
       [headers:protected] => Array 
        (
         [Content-type] => text/html; charset=UTF-8 
         [Date] => Fri, 14 Dec 2012 23:32:18 GMT 
         [Expires] => Fri, 14 Dec 2012 23:32:18 GMT 
         [Cache-control] => private, max-age=0 
         [X-content-type-options] => nosniff 
         [X-frame-options] => SAMEORIGIN 
         [X-xss-protection] => 1; mode=block 
         [Server] => GSE 
         [Connection] => close 
        ) 
       [body:protected] => Unable to convert document. 
      ) 
     [_previous:Zend_Exception:private] => 
     [message:protected] => Expected response code 200, got 400 
    Unable to convert document. 
     [string:Exception:private] => 
     [code:protected] => 0 
     [file:protected] => /usr/local/zend/share/ZendFramework/library/Zend/Gdata/App.php 
     [line:protected] => 714 
     [trace:Exception:private] => Array 
      (
       [0] => Array 
        (
         [file] => /usr/local/zend/share/ZendFramework/library/Zend/Gdata.php 
         [line] => 219 
         [function] => performHttpRequest 
         [class] => Zend_Gdata_App 
         [type] => -> 
         [args] => Array 
          (
           [0] => POST 
           [1] => https://docs.google.com/feeds/documents/private/full 
           [2] => Array 
            (
             [0] => Content-Type: multipart/related; boundary="END_OF_PART" 
             [1] => Slug: test.doc 
             [2] => Content-Type: application/msword 
             [3] => resourceId:4321 
             [x-http-method-override] => 
             [authorization] => AuthSub token="xxxxx" 
            ) 
           [3] => 
     
      
      Room for Debate (12345) 
     
           [4] => application/atom+xml 
           [5] => 
          ) 
        ) 
       [1] => Array 
        (
         [file] => /usr/local/zend/share/ZendFramework/library/Zend/Gdata/App.php 
         [line] => 905 
         [function] => performHttpRequest 
         [class] => Zend_Gdata 
         [type] => -> 
         [args] => Array 
          (
           [0] => POST 
           [1] => https://docs.google.com/feeds/documents/private/full 
           [2] => Array 
            (
             [0] => Content-Type: multipart/related; boundary="END_OF_PART" 
             [1] => Slug: test.doc 
             [2] => Content-Type: application/msword 
             [3] => resourceId:4321 
             [x-http-method-override] => 
            ) 
           [3] => 
     
      
      Room for Debate (12345) 
     
           [4] => application/atom+xml 
          ) 
        ) 
       [2] => Array 
        (
         [file] => /usr/local/zend/share/ZendFramework/library/Zend/Gdata/App.php 
         [line] => 980 
         [function] => post 
         [class] => Zend_Gdata_App 
         [type] => -> 
         [args] => Array 
          (
           [0] => 
     
      
      Room for Debate (12345) 
     
           [1] => 
           [2] => 
           [3] => 
           [4] => Array 
            (
             [0] => Content-Type: multipart/related; boundary="END_OF_PART" 
             [1] => Slug: test.doc 
             [2] => Content-Type: application/msword 
             [3] => resourceId:4321 
            ) 
          ) 
        ) 
       [3] => Array 
        (
         [file] => /var/www/GoogleFunctions.php 
         [line] => 90 
         [function] => insertEntry 
         [class] => Zend_Gdata_App 
         [type] => -> 
         [args] => Array 
          (
           [0] => 
     
      
      Room for Debate (12345) 
     
           [1] => 
           [2] => Zend_Gdata_Entry 
           [3] => Array 
            (
             [0] => Content-Type: multipart/related; boundary="END_OF_PART" 
             [1] => Slug: test.doc 
             [2] => Content-Type: application/msword 
             [3] => resourceId:4321 
            ) 
          ) 
        ) 
       [4] => Array 
        (
         [file] => /var/www/myPaper.php 
         [line] => 342 
         [function] => createNewDoc 
         [args] => Array 
          (
           [0] => Room for Debate (12345) 
           [1] => Zend_Gdata_Docs Object 
            (
             [_defaultPostUri:protected] => https://docs.google.com/feeds/documents/private/full 
             [_registeredPackages:protected] => Array 
              (
               [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 Object 
              (
               [_authSubPrivateKeyId:Zend_Gdata_HttpClient:private] => 
               [_authSubToken:Zend_Gdata_HttpClient:private] => 1/xxxxx 
               [_clientLoginToken:Zend_Gdata_HttpClient:private] => 
               [_clientLoginKey:Zend_Gdata_HttpClient:private] => 
               [_streamingRequest:protected] => 
               [config:protected] => Array 
                (
                 [maxredirects] => 0 
                 [strictredirects] => 1 
                 [useragent] => Zend_Framework_Gdata/1.11.12 
                 [timeout] => 10 
                 [adapter] => Zend_Http_Client_Adapter_Socket 
                 [httpversion] => 1.1 
                 [keepalive] => 
                 [storeresponse] => 1 
                 [strict] => 1 
                 [output_stream] => 
                 [encodecookies] => 1 
                 [rfc3986_strict] => 
                ) 
               [adapter:protected] => Zend_Http_Client_Adapter_Socket Object 
                (
                 [socket:protected] => 
                 [connected_to:protected] => Array 
                  (
                   [0] => 
                   [1] => 
                  ) 
                 [out_stream:protected] => 
                 [config:protected] => Array 
                  (
                   [persistent] => 
                   [ssltransport] => ssl 
                   [sslcert] => 
                   [sslpassphrase] => 
                   [sslusecontext] => 
                   [maxredirects] => 0 
                   [strictredirects] => 1 
                   [useragent] => Zend_Framework_Gdata/1.11.12 
                   [timeout] => 10 
                   [httpversion] => 1.1 
                   [keepalive] => 
                   [storeresponse] => 1 
                   [strict] => 1 
                   [output_stream] => 
                   [encodecookies] => 1 
                   [rfc3986_strict] => 
                  ) 

                 [method:protected] => POST 
                 [_context:protected] => Resource id #10 
                ) 
               [uri:protected] => Zend_Uri_Http Object 
                (
                 [_username:protected] => 
                 [_password:protected] => 
                 [_host:protected] => docs.google.com 
                 [_port:protected] => 443 
                 [_path:protected] => /feeds/documents/private/full 
                 [_query:protected] => 
                 [_fragment:protected] => 
                 [_regex:protected] => Array 
                  (
                   [escaped] => %[[:xdigit:]]{2} 
                   [unreserved] => [A-Za-z0-9-_.!~*'()\[\]] 
                   [segment] => (?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\]:@&=+$,;])* 
                   [path] => (?:\/(?:(?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\]:@&=+$,;])*)?)+ 
                   [uric] => (?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\];\/?:@&=+$,]) 
                  ) 

                 [_scheme:protected] => https 
                ) 
               [headers:protected] => Array 
                (
                 [user-agent] => Array 
                  (
                   [0] => User-Agent 
                   [1] => MyCompany-MyApp-1.0 Zend_Framework_Gdata/1.11.12 
                  ) 
                 [content-type] => Array 
                  (
                   [0] => Content-Type 
                   [1] => application/atom+xml 
                  ) 
                 [slug] => Array 
                  (
                   [0] => Slug 
                   [1] => test.doc 
                  ) 
                 [resourceid] => Array 
                  (
                   [0] => resourceId 
                   [1] => 4321 
                  ) 
                 [authorization] => Array 
                  (
                   [0] => authorization 
                   [1] => AuthSub token="1/xxxxx" 
                  ) 
                 [accept-encoding] => Array 
                  (
                   [0] => Accept-encoding 
                   [1] => identity 
                  ) 
                 [content-length] => Array 
                  (
                   [0] => Content-Length 
                   [1] => 273 
                  ) 
                ) 
               [method:protected] => POST 
               [paramsGet:protected] => Array 
                (
                ) 
               [paramsPost:protected] => Array 
                (
                ) 
               [enctype:protected] => application/atom+xml 
               [raw_post_data:protected] => 
     
      
      Room for Debate (12345) 
     
               [auth:protected] => 
               [files:protected] => Array 
                (
                ) 
               [body_field_order:protected] => Array 
                (
                 [service] => SCALAR 
                ) 
               [cookiejar:protected] => 
               [last_request:protected] => POST /feeds/documents/private/full HTTP/1.1 
    Host: docs.google.com 
    Connection: close 
    User-Agent: MyCompany-MyApp-1.0 Zend_Framework_Gdata/1.11.12 
    Content-Type: application/atom+xml 
    Slug: test.doc 
    resourceId: 4321 
    authorization: AuthSub token="1/xxxxx" 
    Accept-encoding: identity 
    Content-Length: 273 

    
     
      
      Room for Debate (12345) 
     
               [last_response:protected] => Zend_Http_Response Object 
                (
                 [version:protected] => 1.1 
                 [code:protected] => 400 
                 [message:protected] => Bad Request 
                 [headers:protected] => Array 
                  (
                   [Content-type] => text/html; charset=UTF-8 
                   [Date] => Fri, 14 Dec 2012 23:32:18 GMT 
                   [Expires] => Fri, 14 Dec 2012 23:32:18 GMT 
                   [Cache-control] => private, max-age=0 
                   [X-content-type-options] => nosniff 
                   [X-frame-options] => SAMEORIGIN 
                   [X-xss-protection] => 1; mode=block 
                   [Server] => GSE 
                   [Connection] => close 
                  ) 
                 [body:protected] => Unable to convert document. 
                ) 
               [redirectCounter:protected] => 0 
               [_unmaskStatus:protected] => 
               [_queryBracketsEscaped:protected] => 1 
              ) 
             [_majorProtocolVersion:protected] => 1 
             [_minorProtocolVersion:protected] => 
             [_useObjectMapping:protected] => 1 
            ) 
          ) 
        ) 
      ) 
     [previous:Exception:private] => 
    ) 

+0

이 라이브 생산 현장의 문제입니다. google-docs-api 팀의 누군가가 이에 응답하면 정말 고맙겠습니다. – MavWolverine

+0

Google에서 본 사람이 누구입니까? – MavWolverine

+0

참조 http://stackoverflow.com/questions/14288836/google-docs-drive-api-does-not-permit-a-new-document-to-be-inserted-into-a-new-g –

답변