Currently, I face the difficulties that there are some lacking libraries when I consuming rest API in Ivy plugin I follow this instruction : https://answers.axonivy.com/questions/2477/how-to-register-my-code-that-runs-on-every-engine-startup When user logs in, logs out or gets time-out, I want to call rest service to do some stuff: alt text

But I get an error like this when calling rest service in the plugin: alt text

Currently, I just add some dependencies like this picture into the plugin but it doesn't work alt text

Do you have any hint or any suggestion for this problem? Thanks in advance :)

asked 03.06.2019 at 09:22

Genzer%20Hawker's gravatar image

Genzer Hawker
(suspended)
accept rate: 66%

edited 11.06.2019 at 03:47

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958

not answering your question, but I'd wrap authorization header setup in a JAX-RS feature. Then you could enable it globally in the 'Rest Clients' configuration. No explicit invocation on clients is required therefore. A sample is shown in the ConnectivityDemos: com.axonivy.connectivity.rest.client.filter.TwitterOAuthFilter

(11.06.2019 at 04:34) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image

I do not see the point in using the plain JAX-RS api to solve this issue. With such a solution you will loose all ivy features around REST api usage. Such as enhanced logging, monitoring and environment based configurations....

With Ivy.rest().client(myClientNameFromRestClientConfigurations) you should be fine.

alt text

Further samples on this approach can be found in the ConnectivityDemos. E.g. in com.axonivy.connectivity.rest.client.PersonClient

link

answered 11.06.2019 at 04:29

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958
accept rate: 70%

edited 11.06.2019 at 04:32

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×33

Asked: 03.06.2019 at 09:22

Seen: 1,576 times

Last updated: 11.06.2019 at 04:34