Forum Discussion

BA_Service_Haus's avatar
BA_Service_Haus
Regular Contributor
12 years ago

Unintended remove of white spaces

Hi everyone,

there seems to be an "unintended" remove of white spaces in soapUI.

1) When running a request with values enclosed by white spaces (e.g. <value> abcd </value>) the leading and tailing white spaces seem to be removed by soapUI automatically.
We usually running testcases via "testrunner.bat", which logs all requests and responses of the executed testcase. And within this logs all value enclosing white spaces are removed.

2) The same behaviour can be seen for self created mock-responses. Enclosing white spaces are removed there too, when calling them. But on the GUI (using XML-View of the mock response) they can still be found. When calling this mock operations the white spaces are not shown in the mock response.

3) When inserting a white space enclosed value into (e.g.) a mock via "XML" view, it cannot be seen in "outline" or "form" view. As long as it is not edited in "outline" or "form" the white spaces still stay there when switching to "XML" view.
But after editing the value in "outline" or "form" view, the white spaces are removed in "XML" view

4) When adding leading or tailing white spaces in "outline" or "form" view, they spaces are removed after editing was finished.

In my opinion this is a big error as it changes relevant test values.

Is there a possibility to switch this "feature" off? Is there a workaround?

Best regards
Nico

10 Replies

  • BA_Service_Haus's avatar
    BA_Service_Haus
    Regular Contributor
    Hi Ole,

    thanks for your quick reply.

    Because of some security reasons I don't want to attach the example project here. Can you please tell me a eMail adress where I can send it to?

    To your questions:
    - Yes, usually I apply some WS-Security configurations (esp. SAML). But the behaviour I experienced can always be reproduced by using mocks.

    I also have some additional info to my point 1) of my first post:
    It seems that the correct value (including white spaces) is send to the service. I could see that results were computed correctly.
    But when I check the soapUI logging (remember, we always use "testrunner.bat" to start our cases and use the log option "-a") the white spaces within the logged requests are no longer there. So this seems to be a problem of logging only.

    e.g.:
    We send:

    <n3:titel> a </n3:titel>

    But this is logged as request

    <n3:titel>a</n3:titel>


    Best regards
    Nico
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Nico,

    In regard to the Outline and Form editors - this is how they work and there is unfortunately no possibility to turn this off - I will add a feature request internally for us to investigate..

    Regarding the standard XML view - I do get leading and trailing whitespaces preserved inside elements (verified in the Raw view) - have you perhaps applied WS-Security configurations to the requests that might be causing this? Could you attach a stripped-down project with just one request containing whitespaces which we could use to verify!?

    thanks

    /Ole
    SmartBear Software
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Nico,

    ok thanks for reporting this - we will get back to you when we have had time to look into it..

    regards,

    /Ole
    SmartBear Software
  • BA_Service_Haus's avatar
    BA_Service_Haus
    Regular Contributor
    Hi Ole,

    thanks for your hints.
    It really helped to switch of "pretty print".

    But let me ask you one more thing:
    There is a "pretty print" setting in the TestRequest Properties and one in the Preferences section (global).
    I noticed that the TestRequest setting changes if the preference/global setting was changed.

    But once I changed the TestRequest setting manually it is no longer bound to the changes in the preference section.
    Is there any possibility to make the TestRequest setting following the global setting again?

    Best regards
    Nico
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Nico,

    hmm... good point - probably it is "locked" to the request-level setting once you configure that - the request would need a separate "Global" setting to honor that instead - I'll add a bug-report/feature-request...

    thanks!

    /Ole
    SmartBear Software
  • BA_Service_Haus's avatar
    BA_Service_Haus
    Regular Contributor
    Hi Ole,

    sorry, but I have to come back to this issue now.
    As I said, switching off "pretty print" helps me to solve my problem, but only for responses.

    This is, what I do:
    - call the testrunner.bat to execute a testcase
    - read the log file of testcase execution to check, that the request has been sent
    - but leading and tailing white spaces where removed here

    Again, this is not a problem of the request. If I open the soapUI project, the white spaces are still there.
    But the testrunner.bat logging doesn't contain them.

    Is it possible to fix this?

    Best regards
    Nico
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    You are right. The logs used when running "testrunner.bat -a [...]" are always pretty printed, and thus the white spaces are removed.
    You could log the requests using a Groovy Script on the SubmitListener.afterSubmit event handler to get the behavior you desire.


    --
    Regards

    Erik
    SmartBear Sweden