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
7 subscribers
Views
2141 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Can anyone tell how httpget function works with xpath query? Please find code as
pallavis
over 10 years ago
Can anyone tell how httpget function works with xpath query? Please find code as below :
httpget(
endpoint:"http://<server-name>/resource/?xpath=/Person[FirstName='Smith']&attributes=FirstName",
paramNames:{},
paramValues:{},
headerNames :{"Content-Type"},
headerValues:{"application/json"},
user: <user_value>,
password:<password_value>
)
This gives error as Interface Definition: Error evaluating function 'httpget' : Invalid uri 'http://<server-name>/resource/?xpath=/Person[FirstName='Smith']&attributes=FirstName': Invalid query.
Also how to pass query parameters using paramNames and paramValues? We also tried below code but no success.
httpget(
endpoint:"http://<server-name>/resource/?xpath=/Person&attributes=FirstName",
paramNames:{"FirstName"},
paramValues:{"Smith"},
headerNames :{"Content-Type"},
headerValues:{"application/json"},
user: <user_value>,
password:<password_value>
)
OriginalPostID-143921
OriginalPostID-143921
Discussion posts and replies are publicly visible
0
PhilB
A Score Level 1
over 10 years ago
I would guess your second example should be something like the below:
httpget(
endpoint:"http://<server-name>/resource/",
paramNames:{"xpath","attributes"},
paramValues:{"/Person[FirstName='Smith']","FirstName"},
headerNames :{"Content-Type"},
headerValues:{"application/json"},
user: <user_value>,
password:<password_value>
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
pallavis
over 10 years ago
thanks phil....this is working....want to know how to get multiple attributes e.g i want to get firstname, lastname etc...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 10 years ago
I guess that would depend on the format the endpoint requires; I'd imagine it would be something like "FirstName,LastName" for the attributes parameter but you'll need to check the web service documentation.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
pallavis
over 10 years ago
ok thanks....i passed atrributes as "DisplayName/FirstName/LastName"...and its working !!!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 10 years ago
Great! :)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel