{"id":52,"date":"2015-04-10T19:22:15","date_gmt":"2015-04-11T00:22:15","guid":{"rendered":"https:\/\/www.staging.javanator.org\/?p=52"},"modified":"2016-07-04T15:27:05","modified_gmt":"2016-07-04T20:27:05","slug":"pretty-printing-in-soapui","status":"publish","type":"post","link":"https:\/\/www.staging.javanator.org\/?p=52","title":{"rendered":"Pretty Printing in SOAPUI"},"content":{"rendered":"<p>By default, SOAPUI will pretty-print responses it receives back from web services calls.  This is all well and good; makes things simpler to interpret for humans.  Unfortunately, it also uses the pretty-printed XML to evaluate any XPATH assertions on your test steps.  This means that if the responses contain leading and\/or trailing spaces, they are removed.  Thus, <\/p>\n<pre><requestId> 25    <\/requestId><\/pre>\n<p> becomes <\/p>\n<pre><requestId>25<\/requestId><\/pre>\n<p>.  By itself, this is not a problem.  In fact, it&#8217;s convenient.  It&#8217;s easier to assert that <\/p>\n<pre>\/\/requestId='25'<\/pre>\n<p> than <\/p>\n<pre>normalize-space(\/\/requestId)='25'<\/pre>\n<p>.  Regrettably, SOAPUI does <em>not<\/em> do this when evaluating the responses in load tests.  Create a load test based on a test case with lots of SOAP test steps with assertions that work perfectly well run as a single test case and now you find most of the assertions are broken.  Especially if the relevant DBAs are still living in the ancient world and never use <code>varchar<\/code> because they&#8217;re convinced <code>char<\/code> is dramatically more efficient.<\/p>\n<p>The short story:  Test SOAPUI test cases with pretty printing off at some point.  Apply the XPath function <code>normalize-space<\/code> where needed to deal with leading\/trailing spaces.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, SOAPUI will pretty-print responses it receives back from web services calls. This is all well and good; makes things simpler to interpret for humans. Unfortunately, it also uses the pretty-printed XML to evaluate any XPATH assertions on your test steps. This means that if the responses contain leading and\/or trailing spaces, they are &hellip; <a href=\"https:\/\/www.staging.javanator.org\/?p=52\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Pretty Printing in SOAPUI&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-52","post","type-post","status-publish","format-standard","hentry","category-soap"],"_links":{"self":[{"href":"https:\/\/www.staging.javanator.org\/index.php?rest_route=\/wp\/v2\/posts\/52","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.staging.javanator.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.staging.javanator.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.staging.javanator.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.staging.javanator.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=52"}],"version-history":[{"count":4,"href":"https:\/\/www.staging.javanator.org\/index.php?rest_route=\/wp\/v2\/posts\/52\/revisions"}],"predecessor-version":[{"id":56,"href":"https:\/\/www.staging.javanator.org\/index.php?rest_route=\/wp\/v2\/posts\/52\/revisions\/56"}],"wp:attachment":[{"href":"https:\/\/www.staging.javanator.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=52"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.staging.javanator.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=52"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.staging.javanator.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}