How to use ServiceTask to make REST call?

cancel
Showing results for 
Search instead for 
Did you mean: 
Active Member

How to use ServiceTask to make REST call?

Hi !!

I need help ASAP

I want to implement ServiceTask using expression and variable that holds the URL. So if the variable changes, the URL changes and can be used in the ServiceTask to do the REST call.

Can someone help me with examples, if possible?

Thanks for the help !!

 

 

4 Replies
Highlighted
Active Member II

Re: How to use ServiceTask to make REST call?

Hi,

You can use a Script task instead and implement the REST call in Groovy. There are examples out there:

https://www.baeldung.com/groovy-web-services

https://stackoverflow.com/questions/25692515/groovy-built-in-rest-http-client 

http://rest.elkstein.org/2008/02/using-rest-in-groovy.html

Hope this helps.

Highlighted
Senior Member II

Re: How to use ServiceTask to make REST call?

Hi,

You can use JavaDelegate and make rest call from that.

By Default Rest Call component is there so you can use that also.

Thanks & Regard,
Sanjay
Highlighted
Active Member

Re: How to use ServiceTask to make REST call?

Hi @jose_leon_coupa 

Thanks for giving examples to use Script task. It's helped. 

Highlighted
Active Member

Re: How to use ServiceTask to make REST call?

Hi @sanjaybandhniya

Actually I was trying to find a way other than Java but thank you for the inputs as I will keep that in the bucket.