Forum Discussion

dt29735's avatar
15 years ago

Redirect request not being handled properly?

I am having a problem with http posts following the redirects that are not of the same method type. What we are doing is that we have 2 war files that are communicating randomly through redirects to ensure that the user is authorized. It seems that the http post requests that redirect are not reading the response correctly to redirect. So in the test we have a post request that redirects to the appropriate get request. I have redirect set to true for the SoapUI post request but when it redirects it uses a post request instead of the needed get request. Have any ideas of how to mitigate this issue? The error I receive is this "The specified HTTP method is not allowed for the requested resource (HTTP method POST is not supported by this URL)."

I believe this is default browser functionality. Where the browser knows what request to make on a redirect based on the response of the previous request.

2 Replies

  • I am experiencing the same behavior. I send post data to an /add.do endpoint. The originating post works fine. Following the redirect, soapui tries another post to an endpoint (view.do) that is expecting a get.

    I am able to turn off redirects (properties of the step > lower left hand corner) for this and I no longer get the ugly 500 in my response window.

    ***** Log snippet *****

    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "POST /mywebapp/customers/add.do?customerTag=tag9&description=description9&name=customer9&parent=1 HTTP/1.1[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "User-Agent: SOAPUI mywebapp Client/virtualX.2[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "Content-Type: multipart/form-data; boundary="----=_Part_0_23483815.1299076411554"[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "MIME-Version: 1.0[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "Host: qa01[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "Cookie: $Version=0; JSESSIONID=74C8802F0E88D766DCCFD8EF0757A930; $Path=/mywebapp[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "Expect: 100-continue[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "Content-Length: 43[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:<< "HTTP/1.1 100 Continue[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:<< "HTTP/1.1 100 Continue[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:<< "[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "------=_Part_0_23483815.1299076411554--"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:<< "HTTP/1.1 302 Moved Temporarily[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:<< "HTTP/1.1 302 Moved Temporarily[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:<< "Date: Wed, 02 Mar 2011 14:33:30 GMT[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:<< "Location: https://qa01/mywebapp/customers/view.do?id=70[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:<< "Content-Language: en-US[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:<< "Content-Length: 0[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:<< "Connection: close[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:<< "Content-Type: text/plain; charset=UTF-8[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:<< "[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "POST /mywebapp/customers/view.do?id=70 HTTP/1.1[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "User-Agent: SOAPUI mywebapp Client/virtualX.2[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "Content-Type: multipart/form-data; boundary="----=_Part_0_23483815.1299076411554"[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "MIME-Version: 1.0[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "Expect: 100-continue[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "Content-Length: 43[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "Host: qa01[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "Cookie: $Version=0; JSESSIONID=74C8802F0E88D766DCCFD8EF0757A930; $Path=/mywebapp[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:<< "HTTP/1.1 100 Continue[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:<< "HTTP/1.1 100 Continue[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:<< "[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "------=_Part_0_23483815.1299076411554--"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:>> "[\r][\n]"
    Wed Mar 02 09:33:31 EST 2011:DEBUG:<< "HTTP/1.1 500 Internal Server Error[\r][\n]"
  • Sorry, this is not the place for soapUI support so I'll move this. Next time, please post in either the soapUI forum (for soapUI discussion) or soapUI Pro forum (for pro support from eviware).

    Regards!

    /Henrik
    eviware.com