I need to call webservice for create data into db need to know how to call it.

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

  • @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.
  • Adding to what Rawich said. Httpwrite and all expressions that return writer object can only be used using bind(). And the actual writing only happens when user interacts. Like, clicking a link/button.