How to send sessionID from soapui as a request
Solution 1
Found the solution,
Design your login method which will accept certain inputs and will return the sessionID as a string
Hit that login method from SOAP-UI and you will get the sessionID in your response
Use "Property Transfer" option in soap-ui and transfer the received sessionID to all other requests
Helpful Link : soapui.org/Functional-Testing/transferring-property-values.html
Simple !! :)
Solution 2
Let's say, if you get sessionid in first request's response, and the next request should go here http://{{original endpoint}}/{{SESSION_ID}})
, this definitely works:
- go to request (not the test request inside test case) where session id should be put into
- add a parameter on 'request' tab
-
name=sessionid
,style=template
,level=resource
. now it is empty in all related test requests - go to test request, 'request' tab
- put the path to sessionid value from previous request into 'value' field of sessionid parameter. for example, it is like
${users#Response#$.session_id}
where 'users' is the name of endpoint resource, 'session_id' is the name of parameter inside response
Arun
Disclaimer: Opinions expressed are solely my own and do not express the views or opinions of my employer.
Updated on June 04, 2022Comments
-
Arun almost 2 years
I am testing a webservice method which accepts session-id as a parameter.
While testing the same method via SoapUI with a dummy sessionID-Parameter, the server is rejecting the request as it is expecting proper session-id.
How can I solve this? Is there any way where SoapUI can bind the session-id before sending the request?
Please advice me. Thanks
Below is the sample-request which is triggered from SOAP-UI:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.local.com"> <soapenv:Header/> <soapenv:Body> <ser:getMultiple> <!--Optional:--> <ser:sessionId>1000AJHEFG0987</ser:sessionId> <!--Optional:--> <ser:lessonId>95101</ser:lessonId> <!--Optional:--> <ser:quantity>1</ser:quantity> <!--Optional:--> <ser:impressionRow>1</ser:impressionRow> </ser:getParametersMultiple> </soapenv:Body> </soapenv:Envelope>
-
Lemon over 10 yearsWhere is this Property Transfer option?
-
Arun over 10 yearsPlease google for it . This link might be useful to you soapui.org/Functional-Testing/transferring-property-values.html