Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
5 replies
Subscribers
5 subscribers
Views
1890 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Integrations
Hi team, I'm calling a REST webservice using jsontodictionary plug-in.
phanibabuk
over 10 years ago
Hi team,
I'm calling a REST webservice using jsontodictionary plug-in.
jsontodictionary(
httppost(
endpoint: "EndPoint URL"
))
I'm able to get the response from the service when the service is available and also able to handle other exception scenarios. All this works when the service is up and running.
I want to handle a scenario where the service is not up(may be server down).
In this case, the request itself doesn't reach the server.
How can I handle this scenario?
If I use webservicequery, it has a property httpErrorOccured. But in case of jsondictionary, how can I handle this?
Is there any property in jsondictionary that helps me or any other way?
Please provide your inputs!!!...
OriginalPostID-114218
OriginalPostID-114218
Discussion posts and replies are publicly visible
0
Stefan Helzle
A Score Level 3
over 10 years ago
You could put the result of the HTTP post into a local variable and first check whether it contains some valid json or error messages. Then build the dictionary or return some error message or an empty dictionary.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
phanibabuk
over 10 years ago
Hi Stefan,
Within the jsontodictionary() function, I'm using httppost.
Now, how can I read the result of HTTP post in this case.
Any example/code snippet please?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stefan Helzle
A Score Level 3
over 10 years ago
Check this
forum.appian.com/.../Evaluation_Functions
Something like this should do it:
with(
local!response: httppost(...),
if(some_validation(local!response),
jsontodictionary(local!response),
returnSomethingElseHere
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
phanibabuk
over 10 years ago
Hi Stefan,
The above code is not returning any httpErrorOccurred property as the case with webServiceQuery() rule.
If the service itself is not available, it shoots an error.
Not sure what it returns and we should be able to handle that scenario.
Please provide your inputs.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stefan Helzle
A Score Level 3
over 10 years ago
What do you mean with "shoots an error"? An exception? The httppost function should return some form of raw text. You could check if the text ist empty.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel