Reputation: 3680
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>
Upvotes: 2
Views: 12801
Reputation: 11
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:
name=sessionid
, style=template
, level=resource
. now it is empty in all related test requests${users#Response#$.session_id}
where 'users' is the name of endpoint resource, 'session_id' is the name of parameter inside responseUpvotes: 1
Reputation: 3680
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 !! :)
Upvotes: 0