4

I'm sending GData queries to renders traffic charts for users of Instructables.com using the Java GData package. However, this exception is sometimes thrown:

[Line 1, Column 0] Invalid root element, expected (namespace uri:local name) of (http://www.w3.org/2005 Atom:feed), found (:feed

The only mention of this error I can find online is here, but I'm quite certain that our feed URL is properly formed. For example, here is a URL that we might send:

https://www.google.com/analytics/feeds/data?ids=ga:472899&metrics=ga:uniquePageviews&dimensions=ga:date&start-date=2009-10-12&end-date=2009-11-11&filters=ga:pagePath==/id/Inverted_Bookshelf/,ga:pagePath==/id/Munny-Speakers/,ga:pagePath==/id/Zippo-Trick%253a-The-Twilight-Zone/,ga:pagePath==/id/Firefox-Pranks/,ga:pagePath==/id/Guitar-Hero-LED-Mod/

Strangely, this same query will work locally, but fail on our staging server, but then work in production. And even if this query fails in one context, other queries will be fine in that same context. I know that these queries must be part of authenticated HTTP requests. Could this be the issue? I am using the same Google account (same login/password) to send the queries in each case.

4

1 に答える 1

0

エラー コードが何を伝えているかを読んでくださいfeed。Atom 名前空間に要素が必要であることが示されていますがfeed、名前空間に要素がありません。

これは、承認の失敗が原因で発生する可能性は低いです (少なくとも Google はfeed、その場合にルートが存在しないエラー ドキュメントを送信します)。feed返された要素にデフォルトの名前空間の宣言がない場合に発生する可能性が高くなります。

于 2012-10-09T16:12:23.260 に答える