【问题标题】:DOMDocument cannot parse XML: DOMDocument::loadXML()DOMDocument 无法解析 XML:DOMDocument::loadXML()
【发布时间】:2012-10-18 11:53:02
【问题描述】:

当我执行下面的代码时:

require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Gapps');
$client = Zend_Gdata_ClientLogin::getHttpClient("amdminuser", "adminpsw", Zend_Gdata_Gapps::AUTH_SERVICE_NAME);
$client->createUser($username, $givenName, $familyName, $password, $passwordHashFunction=null, $quota=null)    

报错:

Fatal error: Call to undefined method Zend_Gdata_HttpClient::createUser() in ....

然后我们运行安装检查程序,但它向我们显示了这个错误:

Fatal error: Uncaught exception 'Zend_Gdata_App_Exception' with message 'DOMDocument cannot parse XML: DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 1' in /web/web2/apache2/htdocs/test/per_ak/google/library/Zend/Gdata/App.php:830 Stack trace: #0 /web/web2/apache2/htdocs/test/per_ak/google/library/Zend/Gdata/App.php(789): Zend_Gdata_App::importString('importUrl('https://gdata.y...', 'Zend_Gdata_YouT...', NULL) #2 /web/web2/apache2/htdocs/test/per_ak/google/library/Zend/Gdata.php(162): 

我已经下载了http://packages.zendframework.com/releases/ZendGdata-1.12.0/ZendGdata-1.12.0.zip,在php.ini 中安装并设置了合适的include_path。但是,我不知道为什么会遇到这个问题和错误。有谁知道为什么会这样?

感谢您的帮助。

【问题讨论】:

    标签: zend-framework domdocument gdata


    【解决方案1】:

    createUser 是 Zend_Gdata_Gapps 类的一个方法。 Zend_Gdata_ClientLogin::getHttpClient 返回一个 Zend_Gdata_HttpClient 对象。

    您确定您已阅读手册吗?

    【讨论】:

    • 感谢您的快速回复。我使用了谷歌的文档。 developers.google.com/google-apps/provisioning/…
    • 当我运行安装检查程序时,为什么我会显示这个错误:致命错误:未捕获的异常 'Zend_Gdata_App_Exception' 带有消息 'DOMDocument 无法解析 XML:DOMDocument::loadXML(): Extra content at the end实体中的文档,行:/web/web2/apache2/htdocs/test/per_ak/google/library/Zend/Gdata/App.php:830 中的 1' 堆栈跟踪:#0 /web/web2/apache2/htdocs/ test/per_ak/google/library/Zend/Gdata/App.php(789): Zend_Gdata_App::importString('importUrl('gdata.y...', 'Zend_Gdata_YouT...', NULL) #2 /web/ web2/apache2/htdocs/test/per_ak/google/library/Zend/Gdata.php(162):
    猜你喜欢
    • 2011-08-03
    • 2014-05-03
    • 2021-07-09
    • 1970-01-01
    • 1970-01-01
    • 2011-01-04
    • 1970-01-01
    • 2012-06-23
    • 1970-01-01
    相关资源
    最近更新 更多