Forum Discussion

scudsucker's avatar
scudsucker
New Contributor
7 years ago

Auth Headers on PUT with body disappear

Hi.

 

I am reasonably new to SOAPUI. I am running SOAPUI 5.3.0 on Windows 8.1

I need to setup an automated integration test that requires a RabbitMQ instance. RabbitMQ helpfully includes an HTTP API, so it seems that SOAPUI could help with creating a new VHost, User and Queue via HTTP requests. I could then run the tests that actually test my app, and again use SOAPUI for HTTP requests to cleanup.

RabbitMQ requires Basic Authentication. I have added the correct username and password to the "ServiceViewer", and can successfully run PUT and DELETE methods, which include the Authorization header - as long as there is no body. For DELETE this is fine.

But for PUT with a JSON body, I see a message saying "Software caused connection abort: recv failed".

This is all running against a local copy of RabbitMQ, so I am not too concerned about the passwords etc showing up.

Step 1: I added Auth Headers in the "Service Viewer" window:


Step 2: A successful PUT request with an empty body:


.. and the RAW view, showing the Auth header

 

Step 3 - A PUT request with a JSON body, and the "Software caused connection abort: recv failed" message


The RAW view shows that the Auth header is missing:

 

I can remove the JSON body, and I get an expected RabbitMQ error response:


and, once again, the in the RAW view, the header is there:


I have run each of these requests via the Chrome "RESTlet Client" extension, which is a small scale REST API test app, with no issues at all. This tells me that the issue is either with my setup in SOAPUI or with SOAPUI itself. I am hoping for the former.

Does anyone have any suggestions?

FWIW RabbitMQ HTTP API docs: https://cdn.rawgit.com/rabbitmq/rabbitmq-management/rabbitmq_v3_6_12/priv/www/api/index.html

PS, I am located in a timezone quite far from the US (GMT+2) so I will most likely not be able to reply immediately, however I will always respond when I can.

3 Replies

  • PaulMS's avatar
    PaulMS
    Super Contributor

    It looks like other headers after Content-Type are also missing in the request Content-Length, Host, etc.

    Could you try creating a new request for the method and copy the JSON data?

     

    In the service viewer did you assign the Endpoint details to all requests and test requests?

    And in the request editor Auth tab did you add Basic authorization type?

    https://www.soapui.org/soap-and-wsdl/authenticating-soap-requests.html

    • scudsucker's avatar
      scudsucker
      New Contributor

      Hi,

       

      Thanks for the suggestions. Yes, there are other headers missing. I am sure they are removed in the same place as the Auth header.

      > Could you try creating a new request for the method and copy the JSON data?

       

      Yes

       

      I have several PUT methods in my solution, all of which exhibit the same behaviour. Steps 2 & 3 show a PUT request that does not require a body. It works. Step 3, pics 3 & 4 show a request that *should* have a body being sent without one; with expected result. I did in each case what you asked, before I posted, though I guess I did not post those results.

      So - a new request for the method, creatively named "CreateUser_2" with the same problem:

       

       

      > In the service viewer did you assign the Endpoint details to all requests and test requests?


      I'm not sure what this means - I thought that adding the Service Endpoints for my "base url" would cover all URLs based on that value:




      The Auth Header is added to all requests by adding this (aside from the PUT requests as discussed). I should surely not have to list every single endpoint I want the Auth Header added to?


      > And in the request editor Auth tab did you add Basic authorization type?

      No, the idea is that it should be automatically added at a higher level, ie, to all requests, not at the individual level. I want all requests to carry the Auth headers

       



      I've moved on and used Wiremock to do the calls I need; I was hoping that I could use SOAP because ultimately the tests belong to the QA team; their test suite is written with SOAPUI but this bug was a deal-breaker for me (I am a developer)