• Restsharp missing method exception

  • Do you want to create a native client or integrate with third party applications: webservices are the solution.
Do you want to create a native client or integrate with third party applications: webservices are the solution.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #41121  by snowman
 
Hello,

I try to add a file using the OpenKM C# Rest API 2.1.
I just set up a project in VS2013, found out that I had to add RestSharp (v105.2.3.0 by NuGet) and now get a "Missing method" exception on calling createDocument():
Code: Select all
An unhandled exception of type 'System.MissingMethodException' occurred in OKMRest.dll
Additional information: Method not found: "RestSharp.IRestRequest RestSharp.IRestRequest.AddFile(System.String, Byte[], System.String)".
Is this library actively maintained?
Are there any tutorials or examples on the API?
Is there documentation of the methods and there usage?

My code is:
Code: Select all
class Program
    {
        static void Main(string[] args)
        {
            String host = "http://10.10.7.11:8080/OpenKM";
            String user = "okmAdmin";
            String password = "admin";
            var okm=OKMWebservicesFactory.newInstance(host, user, password);
            using (var fileStream = new FileStream(@"testmail.eml", FileMode.Open, FileAccess.Read))
            {
                okm.createDocument("/test/testmail.eml", fileStream);
            }
        }
    }
Best regards,
Snowman
 #41125  by jllort
 
If you are user of community version you should take a look here http://docs.openkm.com/kcenter/view/sdk4net-1.1.1/
And yes, the sdk libraries are actively maintained ( corrections and upgrades ). You have a changelog here http://docs.openkm.com/kcenter/view/sdk4net/

You should downgrade the RestSharp.dll library, read http://docs.openkm.com/kcenter/view/sdk ... ments.html we have still not upgraded to version 105 ( seems from version 104 to 105 the library has been changed enought to do not be full compatible - without changes - from previous version ). We do not like to be following the library changes each time it happens, our strategy is do this kind of updates one time per year, we prefer a controlled version what we know is going right for us, and one time per year upgrade to latest library version and then check again. We think this strategy introduces less bugs than be updated each time a library decides to releasing a new version.
 #41127  by snowman
 
Hello,

thank you. It works now, I understand that only v1.1.1 is available for the community edition?
I hoped to find a way to get a .eml file imported as mail into the file area.
It looks like createDocumentSimple() behaves differently than the manual file import in the web client. I have not found a method to import a mail.
Unfortunately, I am not proficient with Java so I want to find a way to automatically mirror my imap sever with its directory structure into openkm.

Best
 #41141  by jllort
 
This week we have added a method in rest service ( also in community ) for importing eml and msg files ( what are converted as mails into openkm ). That was needed because we are changing MS Office Addin ( from soap to rest ). We still have not officially released it, probably will be during the next January.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.