What's new in Customer Journeys?

Connect and learn more!
Service call in Groovy Script — Cloud Customer Connect
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Service call in Groovy Script

Accepted answer
74
Views
3
Comments
edited Nov 26, 2018 6:19AM in Visual Builder 3 comments

Summary

Having issues calling a service call in a groovy script.

Content

There was a nice blog showing how to do this in an old version:

https://blogs.oracle.com/pdit-cas/how-to-call-any-rest-api-from-vbcs-groovy-code

But this doesn't seem to work anymore.

I've defined a REST service  with one POST endpoint. 

I try calling it based on the service name:

def VBSocketUpdateService = newService("VBSocketUpdate")
def callBody = '{ "label": "UpdateSampleData" }'
def callResponse = VBSocketUpdateService.post(callBody)

But I get an error:

Exception in expression "SampleData" trigger "BeforeUpdate_Rule_0" : oracle.adf.model.connection.rest.exception.RestConnectionException Service not found
at "SampleData" trigger "BeforeUpdate_Rule_0" line 11

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!