rusticisoftware / scormcloud-api-v2-client-net Goto Github PK
View Code? Open in Web Editor NEWSwagger Generated C# Client for SCORM Cloud API v2
License: Apache License 2.0
Swagger Generated C# Client for SCORM Cloud API v2
License: Apache License 2.0
Hey there. So I've been trying to finish getting our site moved over to the APIv2 stuff using this library with our .NET site. I had everything mapped over and working and was just about to prepare to move the changes to our production environment but today I encountered this error (when calling PingAppIdWithHttpInfo() or any other APIv2 method):
The request was aborted: Could not create SSL/TLS secure channel.
At first I thought maybe I had fudged up something (still possible) but after speaking w/tech support guys at Rustici (they are awesome btw) I learned that they just rolled their planned TLS setting changes yesterday:
We rolled out long overdue updates to our TLS settings for SCORM Cloud yesterday morning.
While it's still possible the issue lies somewhere on my end I do think it's somewhat possible (likely?) that this library on github is not working with the new TLS setting change at SCORM Cloud. I conclude this because:
I am going to try to find the issue myself but admittedly I am not super familiar w/all the moving parts of this APIv2 library so I'm not sure how fast/successful I'll be at finding it. Could someone weigh in on this and let me know if there is indeed a possible issue w/the APIv2 library and the new TLS setting - or if not if anyone has any other theories on my things have all of a sudden stopped working for me in my test environment using the APIv2?.
Thank you.
We're looking into using ScormCloud as our Scorm solution for our education center. Our software has recently been updated to .Net 5.0.
When trying to run tests to see if and scormcloud is compatible I already end up running into problems with the sample on the main page.
Specifically the line:
StringResultSchema tokenResult = applicationManagementApi.CreateToken(tokenRequest);
Throws the following exception:
System.MissingMethodException: 'Method not found: 'RestSharp.IRestRequest RestSharp.RestRequest.AddFile(System.String, System.Action`1<System.IO.Stream>, System.String, System.String)'.'
Hi all,
We are having an issue where attempts to upload a 300mb Scorm File via CreateUploadAndImportCourseJob
is resulting in an OutOfMemoryException
. We don't want to increase the available memory to 4gb, would it be possible for you to update this library so that it doesn't use so much memory handling large files? Do you have any recommendations on what we should do? Below is the results of our investigation...
Below is a screenshot of the exception call stack
Previously when we were using the V1 package, we did not have this issue, however when we upgraded to the V2 package it started happening.
Testing Locally everything is ok because my computer has enough memory and I don't have restrictions on Visual Studio's usage of it (you can see in this screenshot the Process Memory is climbing to nearly 4gb), but in production the available memory has a limit of 1gb, so we're getting the exception...
Looking at the implementation of ParameterToFile,
public FileParameter ParameterToFile(string name, Stream stream)
{
if (stream is FileStream)
return FileParameter.Create(name, ReadAsBytes(stream), Path.GetFileName(((FileStream)stream).Name));
else
return FileParameter.Create(name, ReadAsBytes(stream), "no_file_name_provided");
}
currently seems that this implementation of Create is being used, public static FileParameter Create(string name, byte[] data, string filename, string? contentType = null, FileParameterOptions? options = null)
, if this other overload is used public static FileParameter Create(string name, Func<Stream> getFile, string fileName, string? contentType = null, FileParameterOptions? options = null)
it might be less memory intensive?
Thanks for your time, hopefully I've included all the relevant information and it's clear! Please reach out if any confusion
Cheers!
Tagging @raymondht and @chezka-arevalo cause they are also following this 🙏
Hey, guys.
Previously, with APIv1, I would initialize things via something like the below code. However w/the APIv2 there seem to be more "init" things going on which may just require more lines of code per call (for permission schema, token generation etc). I will be trying to figure out the best way on my own as I go but if anyone has any examples or best-practice suggestions on how to initialize the APIv2 library before each call please let me know or point me to them. Thank you in advance.
// Base init stuff
ScormCloud.Configuration = new RusticiSoftware.HostedEngine.Client.Configuration(
scormCloudURL,
scormCloudAppID,
scormSecurityKey,
scormCloudOrigin);
// My API method call(s)
ScormCloud.DebugService.CloudPing();
Hello,
Is there any plan to switch to System.Text.Json as the underlying serlialization/deserialization library?
Or at least have an options to choose between them?
Marcin
Hi, when including a cssurl in the LaunchLinkRequestSchema on buildRegistrationLaunchLink the returned launchlink doesn’t include the cssurl and the launched e-learning is missing it.
Is this a bug or by design?
Thanks
Andy
Is there a way to get/read the MessageSchema response from calls? For example, putLearnerTags according to the Scorm Cloud APIv2 documentation should return JSON w/MessageSchema result but in this .NET library PutLearnerTags returns void. Thank you in advance!
LearnerApi apiInstance = new LearnerApi();
apiInstance = new LearnerApi();
apiInstance.PutLearnerTags(userEmail, tagsForUser);
RestSharp did another major update and i'm guessing this is breaking the ScormCloud NuGet package
System.TypeInitializationException: The type initializer for 'Com.RusticiSoftware.Cloud.V2.Client.Configuration' threw an exception.
---> System.MissingMethodException: Method not found: 'Void RestSharp.RestClient.set_BaseUrl(System.Uri)'.
at Com.RusticiSoftware.Cloud.V2.Client.Configuration.set_BasePath(String value)
at Com.RusticiSoftware.Cloud.V2.Client.Configuration..ctor()
at Com.RusticiSoftware.Cloud.V2.Client.GlobalConfiguration..ctor()
at Com.RusticiSoftware.Cloud.V2.Client.Configuration..cctor()
Hi all,
Similar question to: #6
Previously when we were using https://github.com/RusticiSoftware/SCORMCloud_NetLibrary, to deal with multiple app ids it was recommended we new up the Configuration to pass to a new instance of ScormEngineService every time.
Configuration cfg =
new RusticiSoftware.HostedEngine.Client.Configuration(
"https://cloud.scorm.com/EngineWebServices",
"your app id",
"your secret key",
"your origin string");
ScormEngineService service = new ScormEngineService(cfg);
Is the guidance on dealing with Multiple App Ids still the same? That is, newing up a Configuration class every time and passing that to a new instance of CourseApi?
I get that we can now configure the values at startup but given we have multiple app Ids if I want to configure it with every new request to our service, what's the best practice / recommendations for this?
Thanks for your time hopefully my question is clear.
It appears that PutRegistrationTags() may be doing a smart append vs a full replace even though the API v2 docs that "any tags currently on this registration will be overwritten with the new array of tags.". Can you confirm? FWIW I prefer this over a "full overwrite" since the latter would require multiple API calls to get, then set.
My code:
apiInstance = new RegistrationApi();
TagListSchema newTags = new TagListSchema();
newTags.tags = new string[] { "tag_NEW" };
apiInstance.PutRegistrationTags(myRegId, myTagListSchema);
Tags before above code: "tag1","tag2"
Tags after above code: "tag1","tag2","tag_NEW"
According to the API v2 docs the above code should result in: "tag_NEW"
BTW - It seems PutCourseTags() is behaving this way as well.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.