REST API Plugin v7.2.1.32 is not working properly  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

REST API Plugin v7.2.1.32 is not working properly

Postby sameermoin » Fri Jan 20, 2023 7:05 am

Hi Everyone,


I am using REST API Plugin v7.2.1.32 with the default webhook event. The problem I am facing is it's not sending messages to the webhook subscriber, it is just queuing the messages with status 0, but when I restart the REST API service it pushes all the messages but again when a new message is triggered it starts queueing the message, so for every message I need to restart REST API service.

I tried this version on two different Jiwa instances and both caused the same issue.

The same configuration with the v7.2.1.27 is working fine, as I am using some custom webhook events, it requires some modification to use the Webhook method on the different plugins.

On version 27 I am getting "The 'Content-Type' header must be modified using the appropriate property or method. Parameter name: name"

Here are my Configurations:

rest api plugin.jpg


I also attached the v32 plugin
Attachments
Plugin REST API.xml
(1.71 MiB) Downloaded 34 times
sameermoin
Regular Contributor
Regular Contributor
 
Posts: 75
Joined: Wed Jun 15, 2022 4:02 am
Topics Solved: 1

Re: REST API Plugin v7.2.1.32 is not working properly

Postby SBarnes » Fri Jan 20, 2023 10:36 am

By the sounds of it your problem may possibly be that calls to the api are not reaching the api and fall back code in the business logic is adding the entries to the message table.

You could probably check this using postman or by putting a System.Diagnostics.Debugger.Launch call in the appropriate place in the rest api plugin so you can see what is happening, or alternately turn on debug mode and have a look at the request logs created and see if hook post calls are getting there.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: REST API Plugin v7.2.1.32 is not working properly

Postby Mike.Sheen » Fri Jan 20, 2023 11:03 am

Also putting localhost in your webhooks host url limits webhooks to only work when originating from the same machine as the REST API.

Is your REST API Running on port 8090? What's the .exe.config file look like?
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: REST API Plugin v7.2.1.32 is not working properly

Postby sameermoin » Fri Jan 20, 2023 4:29 pm

The screenshot I attached is from my local machine. Everything is the same except the WebhooksHostURL. On the other machines, it contains HTTPS custom domain URLs.

The latest version is also working but only when I restart the service again and again. The configuration seems good because its works with the older versions. The problem is occurring only on version 32

I tried on both the self-hosted API service method and the IIS method.

Here are the API config file settings. I just renamed the values.

Code: Select all
<appSettings>
    <add key="ServerName" value="ABC.CLOUD\SQL,1433" />
    <add key="JiwaUsername" value="JiwaAPI" />
    <add key="DatabaseName" value="JiwaDemo" />
    <add key="JiwaPassword" value="8M23G924" />
    <add key="URLBase" value="https://abc.com" />
    <add key="ClientSettingsProvider.ServiceUri" value="" />
    <add key="webpages:Version" value="3.0.0.0" />
    <add key="webpages:Enabled" value="false" />
</appSettings>
sameermoin
Regular Contributor
Regular Contributor
 
Posts: 75
Joined: Wed Jun 15, 2022 4:02 am
Topics Solved: 1

Re: REST API Plugin v7.2.1.32 is not working properly

Postby Mike.Sheen » Fri Jan 20, 2023 4:35 pm

sameermoin wrote:The latest version is also working but only when I restart the service again and again


This tells me that the REST API is not reachable on the URL configured in the WebHooksHostURL in the system settings.

Clients will try to POST to that URL, and if it fails they fall back to a SQL insert to the table SY_WebHookMessage. When the service starts, this table is read and pending webhooks are then attempted to be sent.

Your clients are failing to POST to the WebHooksHostURL.

Try using Postman or similar a POST to /Webhooks/Events/ - what response do you get back? Make sure to use the URL in your WebHooksHostURL system setting.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: REST API Plugin v7.2.1.32 is not working properly

Postby SBarnes » Fri Jan 20, 2023 4:37 pm

Turn on the debug system setting on the rest api plugin itself, restart the api and have a look at the request logs once you you have changed something that should cause a hook to fire.

If there is nothing in the request logs for it then something in the environment is blocking it like a firewall.

Likewise you can try using postman to send data to the route.

Unfortunately we won't be able to diagnose what is going on in your environment from settings alone.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: REST API Plugin v7.2.1.32 is not working properly

Postby sameermoin » Fri Jan 20, 2023 4:42 pm

Mike.Sheen wrote:Try using Postman or similar a POST to /Webhooks/Events/ - what response do you get back? Make sure to use the URL in your WebHooksHostURL system setting.



This route returns a list of webhook events.
postman.jpg
sameermoin
Regular Contributor
Regular Contributor
 
Posts: 75
Joined: Wed Jun 15, 2022 4:02 am
Topics Solved: 1

Re: REST API Plugin v7.2.1.32 is not working properly

Postby SBarnes » Fri Jan 20, 2023 4:44 pm

Post not get send to it data like the business logic does.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: REST API Plugin v7.2.1.32 is not working properly

Postby Mike.Sheen » Fri Jan 20, 2023 4:46 pm

sameermoin wrote:This route returns a list of webhook events.


No kidding.

Now read what I posted.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: REST API Plugin v7.2.1.32 is not working properly

Postby Mike.Sheen » Fri Jan 20, 2023 5:12 pm

I've updated our docs page with a diagram which may make this clearer.

untitled_page.png

The WebHooksHostURL system setting should be a valid URL accessible by all Jiwa clients. If this URL is not reachable, webhooks will not be sent to subscribers until the REST API service is restarted.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Next

Return to Technical and or Programming

Who is online

Users browsing this forum: Google [Bot] and 28 guests