Page 1 of 1

SR13 API issue

PostPosted: Fri Sep 02, 2022 12:55 pm
by neil.interactit
Hey guys,

I have run into an issue that has me stumped.

There were some API connectivity issues, so per viewtopic.php?f=32&t=1672&p=7294, we updated to SR13 along with the API plugin updates. All good! Everything worked.

As this was a minor update the client had Jiwa LIVE updated directly, so afterward asked for Jiwa TEST to be updated. I took a new copy of the (updated) LIVE database and replaced the TEST database with it.

I have confirmed the TEST API server is running SR13, have locally run Jiwa to recompile the plugins (in case that helps), and have restarted the (self-hosted) API service.

The test API is now responding with:
Code: Select all
System.MissingMethodException: Method not found: 'System.Collections.Generic.IDictionary`2<System.String,JiwaFinancials.Jiwa.JiwaApplication.Manager> JiwaFinancials.Jiwa.JiwaServiceModel.RESTAPIPlugin.get_JiwaSessionDictionary()'.
   at AnglicareRestApiCustomRoutes.JiwaExtensions.GetManager(Service Service)
   at AnglicareRestApiCustomRoutes.CustomServices.Post(SalesOrderLinesRequest request)
   at lambda_method(Closure , Object , Object )
   at ServiceStack.Host.ServiceRunner`1.<ExecuteAsync>d__13.MoveNext()

I dug deeper, and internally was able to expose the offending AnglicareRestApiCustomRoutes plugin code line:
Code: Select all
    public class CustomServices : Service
    {
        [Authenticate]
        public SalesOrderLinesResponse Post(SalesOrderLinesRequest request)
        {
            var manager = this.GetManager();

AnglicareRestApiCustomRoutes is a custom plugin copied/adapted from the supplied custom API example plugin.

So to restate - LIVE is working fine, but TEST, essentially a copy of LIVE, is not working.

Any help appreciated!

Cheers,
Neil

Re: SR13 API issue  Topic is solved

PostPosted: Fri Sep 02, 2022 2:31 pm
by Mike.Sheen
neil.interactit wrote:LIVE is working fine, but TEST, essentially a copy of LIVE, is not working.


If that is true, then you probably just need to:
1. Stop the API service
2. Delete the contents of the ProgramData\Jiwa Financials\Jiwa 7\7.2.1 folder
3. Start the API service

This will force a recompile of all plugins, so the service start might take a little longer.

neil.interactit wrote:have locally run Jiwa to recompile the plugins (in case that helps)


That would, if the API service is using the same Windows user account as what you logged in as - I suspect in this case that's not the case - but deleting the folder as I indicated above will remove all doubt as the plugins for all users and all databases gets wiped clean.

Re: SR13 API issue

PostPosted: Fri Sep 02, 2022 3:47 pm
by neil.interactit
Sweet! Nail on the head! Thanks Mike.