Forum Discussion
Hi there,
To answer your questions.
- The API calls work in SOAP UI (application suggested to use by the vendor instead of postman because of issues with how the cookies do not authenticate correctly in Postman). The call works without issue in SOAP UI. I have attached a screen shot. In addition the GET call is successful in SL but I’m only having issue with the POST call.
Not sure why you are copying and joining back?
I used the copy and join because I thought I needed the json formatter for the request body. Should I be able to include the request body in a mapper and not need to include a json formatter?
I removed the json generator and inputed the firstname and lastanme into the mapper and get the same error
Are you sure you are constructing the correct Cookie value? What API is this?
Yes I am constructing it based off how it is successful in SOAP UI and it is a POST call. There are two header values i am parsing out that are sucessful in the GET call. However using the same logic they are unsuccessful in the POST call.
"headers": {transfer-encoding:chunked, content-type:application/json, server:Jetty(8.1.19.v20160209), date:Wed, 09 Aug 2017 22:19:26 GMT, cache-control:no-cache}
“transfer-encoding”: “chunked”
“content-type”: “application/json”
“server”: “Jetty(8.1.19.v20160209)”
“date”: “Wed, 09 Aug 2017 22:19:26 GMT”
“cache-control”: “no-cache”
"statusLine": {protoVersion:HTTP/1.1, statusCode:200, reasonPhrase:OK}
“protoVersion”: “HTTP/1.1”
“statusCode”: 200
“reasonPhrase”: “OK”
"original": {Token:XSRF-TOKEN="89d9SyfstQrAUVP5YpCT2DXM67vuP/5SdhYXFsPsU7s=", SessionID:mv77df1cijnssyyzqn1f1wip, JSESSIONID:null}
“Token”: “XSRF-TOKEN=“89d9SyfstQrAUVP5YpCT2DXM67vuP/5SdhYXFsPsU7s=””
“SessionID”: “mv77df1cijnssyyzqn1f1wip”
“JSESSIONID”: null,
"entity": {euid:1000501093}
“euid”: “1000501093”
- nganapathiraju9 years agoFormer Employee
Yes I have repeated in SOAPUI and it is successful.
I have raised an internal thread and waiting for feedback.
- nganapathiraju9 years agoFormer Employee
Thanks @tstack
It is now successful.
Few things to note:
HTTP calls are very finicky about syntax and well formation of the attributes.
There needs to be a space after the semi-colon in the cookie header:
‘JSESSIONID=’ + $SessionID + '; ’ + $Token
Also, the X-XSRF-TOKEN header should have just the token value and not ‘XSRF-TOKEN=“…”’. I extracted the token like so:
$Token.match(/=“(.*)”$/)[1]
see the query variable how it is formed.
query: ‘{“FirstName”:"’+$FirstName+‘", “LastName”: "’+$LastName+‘"}’
Attached is my pipeline.
NG_Join_Search1_2017_08_10.slp (8.5 KB)