Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML request missing "imsx_messageIdentifier" payload #63

Open
ranacseruet opened this issue Jul 11, 2018 · 4 comments
Open

XML request missing "imsx_messageIdentifier" payload #63

ranacseruet opened this issue Jul 11, 2018 · 4 comments

Comments

@ranacseruet
Copy link

ranacseruet commented Jul 11, 2018

We are trying this library for LTI integration in our Python/Django app and it mostly works like a charm. Great job there!

However, one issue we faced while integrating with Blackboard LMS LTI, that returns a 500 error code while syncing, though it accepts and syncs the grade as well. It most likely related to this issue: 1EdTech/basiclti-util-java#30

This is the request body looks like that we are sending from our side:

<?xml version='1.0' encoding='utf-8'?>
<imsx_POXEnvelopeRequest
    xmlns=\"http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0\">
    <imsx_POXHeader>
        <imsx_POXRequestHeaderInfo>
            <imsx_version>V1.0</imsx_version>
            <imsx_messageIdentifier/>
        </imsx_POXRequestHeaderInfo>
    </imsx_POXHeader>
    <imsx_POXBody>
        <replaceResultRequest>
            <resultRecord>
                <sourcedGUID>
                    <sourcedId>03050aac78e2ffe64d32d829c83e9d665d4d79f3bc3309bc91dbe402984eef2c:::db561a20-9c39-4f53-98f4-142bc545c032:::content:1376</sourcedId>
                </sourcedGUID>
                <result>
                    <resultScore>
                        <language>en</language>
                        <textString>1.0</textString>
                    </resultScore>
                </result>
            </resultRecord>
        </replaceResultRequest>
    </imsx_POXBody>
</imsx_POXEnvelopeRequest>

imsx_messageIdentifier does not have any valid value.

@ryanhiebert
Copy link
Member

ryanhiebert commented Jul 13, 2018

I do see that this is empty, as the error says: <imsx_messageIdentifier/>. Would you be willing to share the code that generates this XML? Also, would you perhaps have a link to pertinent docs on this field, so that I can figure out what care needs to be taken WRT this field?

@ryanhiebert
Copy link
Member

@ranacseruet : Do you think you might be able to get me a minimal example of the problem that I can use as a test case?

@ranacseruet
Copy link
Author

ranacseruet commented Jul 23, 2018

@ryanhiebert sorry about the delay, I missed the previous reply.

Code that building this element:
So, I think the library is constructing the element here:

message_identifier = etree.SubElement(header_info,

But not being updated with the proper message identifier info.

Sample Code that results to this:
We are using it like this:

outcome_request = OutcomeRequest({
    'consumer_key': lms.lti_consumer_key,
    'consumer_secret': lms.lti_secret,
    'lis_outcome_service_url':
    lms_course.lis_outcome_service_url,
    'lis_result_sourcedid': sync_auth['lis_result_sourcedid'],
})
outcome_response = outcome_request.post_replace_result(
    student_grade_map[thm_user_id],
)

Affected LMS: Blackboard. You can reproduce it by simply testing with blackboard LMS. Where blackboard will accept the grades and update it, but will return a 500 status code as part of the response.

Potential fix:
I think this changes here gives and idea how the java library was fixed: https://github.com/IMSGlobal/basiclti-util-java/pull/31/files#diff-d953de832e77b16adc0630fb675a8512R567 . Basically setting it with current timestamp or so.

Let me know if you have any more questions about this.

@ranacseruet
Copy link
Author

ranacseruet commented Aug 16, 2018

Update: we found that its possible to overwrite some attributes through constructor. So, adding this is currently solving the issue:

{
      ...
      'message_identifier': unicode(datetime.now()),
}

So, the constructor code looks like this:

outcome_request = OutcomeRequest({
    'consumer_key': lms.lti_consumer_key,
    'consumer_secret': lms.lti_secret,
    'lis_outcome_service_url':
    lms_course.lis_outcome_service_url,
    'lis_result_sourcedid': sync_auth['lis_result_sourcedid'],
    'message_identifier': unicode(datetime.now()),
})

However, as this is more like an implementation detail, developers using this library shouldn't really be aware of this and should be fixed inside the library itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants