Calling the Web API from a Plugin  Topic is solved

Discussions relating to the REST API of Jiwa 7.

Calling the Web API from a Plugin  Topic is solved

Postby SBarnes » Wed Nov 21, 2018 5:25 pm

I discovered an issue today that occurs if you use the web api from a plugin and that is you need to include the output for the DTOs that comes from the Web API such as

Code: Select all
    [Route("/Services/Restart", "GET")]
    [ApiResponse(Description="Not authorised", StatusCode=403)]
    [ApiResponse(Description="Not authenticated", StatusCode=401)]
    [ApiResponse(Description="Restart request sent OK", StatusCode=204)]
    public partial class RestartRequest
    {
    }   


Otherwise you get "Index (zero based) must be greater than or equal to zero and less than the size of the argument list." which is because ServiceStack can't work out the route as the JiwaFinancials.Jiwa.JiwaServiceModel names space does not define the route this is done in the plugin and only appears in the generated code. This error happens for any route that can't be worked out. The first annotation of the route is what is needed.

Whilst I have resolved this I am posting this here in case someone else runs into the problem.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1618
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Return to REST API

Who is online

Users browsing this forum: No registered users and 2 guests