RusticiSoftware / SCORMCloud_NetLibrary

A C# library to assist in the integration of the SCORM Cloud service into .Net 2.0+ applications.
http://scorm.com/scorm-solved/scorm-cloud/develop-a-scorm-cloud-app/
Other
11 stars 22 forks source link

Fix XML parsing for getCourseDetail #35

Closed cambiaresearch closed 6 years ago

cambiaresearch commented 6 years ago

The method ScormCloud.CourseService.GetCourseDetail was returning a CourseDetail object with many empty fields that should not have been. There were a couple of issues in the code with parsing the XML returned from the service call. First, XmlDocument.GetElementsByTagName was being used incorrectly. The element name used was "versions" or "tags" when it should have been "version" and "tag" to get the individual elements rather than their parent element. Then several element values were not being obtained correctly because they appeared to not account for the CDATA element. It seems these issues could have arisen after changes to the structure of the XML response.