|
Title: how to test stateful services Post by: Joe Gillon on July 01, 2007, 08:36:23 pm I can't find any mention of testing stateful services. I make a project, get the wsdl, try to connect/login request, which works, but all subsequent requests get 'no connection'. Had to write the services statefully, would be nice to use this to test them.
Title: Re: how to test stateful services Post by: omatzura on July 01, 2007, 08:46:13 pm Hi!
usually, the first response returns some kind of identifier for the session-state, either as a HTTP Header or some kind of ID the response message. The ID must then be included in all subsequent requests so the server can associate the client with its state.. This is definetely possible with soapUI, but I can't say exactly how the service you are testing handles this.. is there some kind of SessionID being returned to your first request as mentioned above? regards! /Ole eviware.com Title: Re: how to test stateful services Post by: Steven on July 23, 2007, 05:53:28 pm The server returns a set-cookie header with the JSESSIONID.
The client is supposed to return the JSESSIONID in a http header, which I have not seen either with soapUI. It would be nice if that worked (cookie handler functionality). Title: Re: how to test stateful services Post by: omatzura on July 23, 2007, 06:49:14 pm Hi,
You can enable cookie-based Session-State handling for a TestCase in the TestCase Options dialog, which should work in your case.. (let me know otherwise!) best regards, /Ole eviware.com Title: Re: how to test stateful services Post by: jkam on January 30, 2008, 06:36:43 pm Hi,
I found this older topic, dealing with a similar issue to mine. I'm using SoapUI 2.0 Beta and I need to test a stateful service. As Ole suggests above, I looked in the Test Case Options dialog. I checked 'Maintain HTTP Session' but that doesn't seem to copy cookies received in one response to the next request. I too have a Set-Cookie: JSESSIONID=xxx in my first response, and if I copy this value to an HTTP header in the second request manually the session behaviour works fine. Is there another way of having SoapUI copy these cookie values automatically? Thanks John Title: Re: how to test stateful services Post by: omatzura on January 30, 2008, 10:06:03 pm Hi John,
hmm.. if the both requests go to the same host/service, then the "Maintain HTTP State" option should work.. can you check this? Otherwise you will need to create a groovy-script between the two request that reads the response cookie of the first response and sets the corresponding request cookie in the following request. regards, /Ole eviware.com Title: Re: how to test stateful services Post by: lakshmi on June 29, 2008, 11:02:32 am Hi,
I am also in a similar situation where in i have to test stateful services. I have also enabled the option in the Test suite to maintain Http session. It all works fine when i manually copy and paste the Set Cookie =XXX id into the request header of another request after login. The sequence of steps that i have is 1 login :request step 2 set session : groovy script 3 do XYZ : request step if i use the script as given in the example as in step2 (set session : groovy script) like def state = context.getProperty( com.eviware.soapui.model.testsuite.TestRunContext.HTTP_STATE_PROPERTY ) i am getting the value of the state as null. I am unable to proceed further because of this.Please let me know if i am wrong any where.Kindly help me fix this groovy script so that i can capture the session id of login method and add it in the subsequent requests in the groovy script. Appreciate any help in this regard. Thanks, Lakshmi Title: Re: how to test stateful services Post by: omatzura on August 04, 2008, 01:22:00 pm Hi Lakshmi,
sorry for the long delay.. are you still in need of help here? regards! /Ole eviware.com |