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
2 replies
Subscribers
7 subscribers
Views
1139 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I need to call webservice for create data into db need to know how to call it.
rahulr391
over 8 years ago
I need to call webservice for create data into db need to know how to call it.
signature of method is GenericSvcRespMsg Test(String id, String name, int status, String rollno)
which returns json format. "SUCCESS" if successfully create data into database.
below code is single row for test.. i have to pass list of data to webservice how do it.
load(
local!response:a!httpWrite(
method: "POST",
url: "http://..../Service.svc/Common/LookupCode/CreateCauseCat",
/* headers: a!httpHeader("X-Appian-User", loggedInUser()),*/
queryParameters: { a!httpQueryParameter("id", "XX"), a!httpQueryParameter("name", "Static Test"),
a!httpQueryParameter("status", 1), a!httpQueryParameter("rollno", ri!username)}
),
local!json:local!response,
if(
isnull(local!json),
local!json,
local!json
)
)
OriginalPostID-171068
OriginalPostID-171068
Discussion posts and replies are publicly visible
Parents
0
rawich
over 8 years ago
@rahulr391, a!httpWrite() is a special kind of function called Writer Function, which means you'll have to use it with bind() function. The a!httpWrite() function itself will not return any value you're looking for. It can only return an object of type Writer.
If you look at the example here: https://forum.appian.com/suite/help/7.10/Connector_Functions.html#a!httpWrite.28.29 you'll notice that you'll have to find other way to get a value back from the system you called. Writer function can generate an error, which will be displayed as SAIL error to end user.
With these limitations, we usually have to go back to the use case and see if a Writer function solution is still a good fit.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
rawich
over 8 years ago
@rahulr391, a!httpWrite() is a special kind of function called Writer Function, which means you'll have to use it with bind() function. The a!httpWrite() function itself will not return any value you're looking for. It can only return an object of type Writer.
If you look at the example here: https://forum.appian.com/suite/help/7.10/Connector_Functions.html#a!httpWrite.28.29 you'll notice that you'll have to find other way to get a value back from the system you called. Writer function can generate an error, which will be displayed as SAIL error to end user.
With these limitations, we usually have to go back to the use case and see if a Writer function solution is still a good fit.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data