PHP Soap 函数出现“没有这样的操作”即使在函数列表中

发布于 2024-12-03 20:11:43 字数 2520 浏览 2 评论 0原文

尝试从 PHP 中工作的 wsdl 获取 SOAP 调用。查询 WebCT 轴服务器 wsdl,我得到它具有以下功能:

Array
(
    [0] => SessionVO login(string $user, string $password, string $learningContextID)
    [1] => void logout(SessionVO $session)
    [2] => ArrayOf_xsd_long getLearningContextIDs(SessionVO $session)
    [3] => ArrayOf_xsd_long getTemplateIDs(SessionVO $session, long $learningContextID)
    [4] => ArrayOf_xsd_string getRoleIDs(SessionVO $session, long $learningContextID)
    [5] => LearningCtxtVO getLearningContext(SessionVO $session, long $learningContextID)
    [6] => ArrayOfLearningCtxtVO getLearningContextList()
    [7] => RoleVO getRoleDefinition(SessionVO $session, string $roleID)
    [8] => ArrayOfRoleVO getRoles(SessionVO $session, long $learningContextID)
    [9] => ArrayOfSourcedIDVO getLearningGroupsByIMSId(SessionVO $session, SourcedIDVO $imsid)
    [10] => ArrayOfSourcedIDVO getLearningGroupsByLCId(SessionVO $session, long $lcid)
    [11] => ArrayOfSourcedIDVO getLearningGroupMembers(SessionVO $session, long $lcid)
    [12] => TemplateVO getTemplate(SessionVO $session, long $learningObjectID)
    [13] => long getLearningContextIdByPath(SessionVO $session, string $path)
    [14] => long getLearningContextIdBySourcedId(string $source, string $id)
    [15] => string getReleaseVersion()
    [16] => boolean isCompatibleWith(string $version)
    [17] => ArrayOf_xsd_long getInstructorPersonIDs(SessionVO $session, long $lcid)
    [18] => long getParent(SessionVO $session, long $lcid)
    [19] => ArrayOf_xsd_long getChildren(SessionVO $session, long $lcid)
)

但是,当我执行以下函数时,我得到“没有这样的操作'getLearningGroupsByIMSId'”的错误:

function getAllMembers($contextID = -1) {
        try {
            $learingContext = $this->context->getLearningContext($this->session,$contextID);
            print_r($learingContext);
            $groups = $this->context->getLearningGroupsByIMSId($this->session,$learingContext->sourcedID);
            print_r($groups);
            foreach($groups as $group) {
                $members = $this->context->getLearningGroupMembers($this->session,$group->sourcedID->myID);
                print_r($members);
            }
        } catch(Exception $e) {
            print_r($e);
            return false;
        }
        return $members;
    }

任何关于为什么它可能无法识别该功能的想法即使它出现在功能列表中?除了该函数和 getLearningGroupsByLCId 之外,所有其他函数似乎都可以工作 - 两者都给出相同的错误。

Attempting to get SOAP calls from a wsdl working within PHP. Querying an WebCT axis server wsdl and I get back that it has the following functions:

Array
(
    [0] => SessionVO login(string $user, string $password, string $learningContextID)
    [1] => void logout(SessionVO $session)
    [2] => ArrayOf_xsd_long getLearningContextIDs(SessionVO $session)
    [3] => ArrayOf_xsd_long getTemplateIDs(SessionVO $session, long $learningContextID)
    [4] => ArrayOf_xsd_string getRoleIDs(SessionVO $session, long $learningContextID)
    [5] => LearningCtxtVO getLearningContext(SessionVO $session, long $learningContextID)
    [6] => ArrayOfLearningCtxtVO getLearningContextList()
    [7] => RoleVO getRoleDefinition(SessionVO $session, string $roleID)
    [8] => ArrayOfRoleVO getRoles(SessionVO $session, long $learningContextID)
    [9] => ArrayOfSourcedIDVO getLearningGroupsByIMSId(SessionVO $session, SourcedIDVO $imsid)
    [10] => ArrayOfSourcedIDVO getLearningGroupsByLCId(SessionVO $session, long $lcid)
    [11] => ArrayOfSourcedIDVO getLearningGroupMembers(SessionVO $session, long $lcid)
    [12] => TemplateVO getTemplate(SessionVO $session, long $learningObjectID)
    [13] => long getLearningContextIdByPath(SessionVO $session, string $path)
    [14] => long getLearningContextIdBySourcedId(string $source, string $id)
    [15] => string getReleaseVersion()
    [16] => boolean isCompatibleWith(string $version)
    [17] => ArrayOf_xsd_long getInstructorPersonIDs(SessionVO $session, long $lcid)
    [18] => long getParent(SessionVO $session, long $lcid)
    [19] => ArrayOf_xsd_long getChildren(SessionVO $session, long $lcid)
)

However when I execute the following function I get back an error of "No such operation 'getLearningGroupsByIMSId'":

function getAllMembers($contextID = -1) {
        try {
            $learingContext = $this->context->getLearningContext($this->session,$contextID);
            print_r($learingContext);
            $groups = $this->context->getLearningGroupsByIMSId($this->session,$learingContext->sourcedID);
            print_r($groups);
            foreach($groups as $group) {
                $members = $this->context->getLearningGroupMembers($this->session,$group->sourcedID->myID);
                print_r($members);
            }
        } catch(Exception $e) {
            print_r($e);
            return false;
        }
        return $members;
    }

Any ideas of why it might not be recognizing that function even though it shows up on the function list? All the other functions seem to work other than that and getLearningGroupsByLCId - both give the same error.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文