Forum Discussion

bmgriner's avatar
bmgriner
Frequent Contributor
14 years ago

Raw Request Not True

I had an issue where a cookie was being sent despite my setting it to a bad value. When I looked at the raw view it shows what I expect, but when I looked in the http log I saw a different request being sent out.

Raw Request
POST [MY_SERVER]/[MY_LOCAL_URI] HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Cookie: badcookie

paramater=badvalue


This is what I see in the http log:
Wed May 16 11:28:22 MST 2012:DEBUG:>> "POST [MY_LOCAL_URI] HTTP/1.1[\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:>> "Accept-Encoding: gzip,deflate[\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:>> "Content-Type: application/x-www-form-urlencoded[\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:>> "Accept: application/json[\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:>> "Cookie: badcookie[\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:>> "Content-Length: 22[\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:>> "Host: [MY_HOST]:[MY_PORT][\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:>> "Connection: Keep-Alive[\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:>> "User-Agent: Apache-HttpClient/4.1.1 (java 1.5)[\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:>> "Cookie: MCDS=****[\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:>> "Cookie2: $Version=1[\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:>> "[\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:>> "parameter=badvalue"
Wed May 16 11:28:22 MST 2012:DEBUG:<< "HTTP/1.1 403 Forbidden[\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:<< "Server: Apache-Coyote/1.1[\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:<< "Content-Type: application/json;charset=UTF-8[\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:<< "Content-Length: 242[\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:<< "Date: Wed, 16 May 2012 18:28:22 GMT[\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:<< "[\r][\n]"
Wed May 16 11:28:22 MST 2012:DEBUG:<< "[MY_RESPONSE]"


Am I missing something here? Why are we sending multiple cookies when I only specified one?

I noticed that if I changed the Cookie value from badcookie to MCDS=badcookie, that the request was correct.

You guys aren't acting like a browser and retaining and resending Cookies are you?

3 Replies

  • bmgriner's avatar
    bmgriner
    Frequent Contributor
    Found another thread that helped me get around this.

    http://www.eviware.com/forum/viewtopic.php?t=13170

    Basically, the things I need to know are:

    • Is SoapUI going to act like a browser and continue to send cached Cookies in every request or do I have more control over exactly which cookies get sent?

    • Is that caching in the context of a single test case, a test suite, or the entire project?

    • Can you fix the bug where the raw request does not show exactly what is getting sent across the wire?

    • Will you provide a way to manage cookies in a UI?
  • bmgriner's avatar
    bmgriner
    Frequent Contributor
    I just realized why I can't have these cookies sent in every request. When I run my test cases in parallel, I can remove the cookies for a test case, but often before I even run the test step that requires the cookies be removed, another test step from another test case has put cookies back in. If SoapUI wants to cache and resend Cookies acting more like a browser, that is fine, but they must do it atomic to a single test case.
  • Hi,

    there is a bug in 4.5.0 that resends cookies across all requests sent by soapUI - the latest nightly build fixes this; cookies should only be resent in requests of a TestCase with the "Maintain HTTP Session" option turned on in the TestCase Options dialog.

    Regarding the Raw request view not showing all HTTP Headers - this is another known issue that is in our backlog.

    regards,

    /Ole
    SmartBear Software