MeisinottiOccasional ContributorJoined 6 years ago5 Posts1 LikeLikes received1 SolutionView All Badges
ContributionsMost RecentMost LikesSolutionsRe: XML declaration in request disappears after property transfer So, alt least I got a way that worked for me - than you for you help! //next line parses the Properties step and gets the value of the declaration def declaration = testRunner.testCase.testSuite.getPropertyValue("prexml") log.info(declaration) //next line parses the Properties step and gets the value of the XML without the declaration def XML = context.expand('${UC1.116_init#Request}') log.info(XML) //concatenate the values together adding a <br> between them def wellFormedXML = declaration +" \n" + XML log.info(wellFormedXML) testRunner.getTestCase().getTestStepByName("UC1.116_init").getProperty('Request').setValue(wellFormedXML) Re: XML declaration in request disappears after property transfer Well, this cannot work: In my groovy I read the XML request from the following http request (UC1.116_ini). When I replace this request with ${Properties#wellFormedXML} I cannot concate the wellformed XML, because there is no XML for concatination anymore. Look at the attached picture to see the order of my steps so far! UC1.118 - the Response of this Step will bei validatet and used by ... 1.118_to_1.116_ini ... this Property Transfer Step (this Step causes the disapperance of the XML declaration in the next HTTP Request (UC1.116_ini) CompleteXML is the groovy script which is supposed complete the request of UC1.116_ini. UC1.116_ini at least is suppost to run wirh the XML declaration + XML Request Re: XML declaration in request disappears after property transfer Thank you for all your support! Unfortenately none of your suggestion helped me so far. Maybe I just have a general understanding problem and don't really understand the concept of SoapUI yet. This is my current approach: This is my Request after the troperty transfer step <prometheuss schema_version="1.0.0" fachkomponente="UC1116" fachmethode="init"><ParameterListe><Parameter name="UEBERGEORDNETERVORGANGID" value="3265"/></ParameterListe></prometheuss> This is the needed Full-Request (incl. the necessary declaration): <?xml version="1.0" encoding="ISO-8859-15"?><prometheuss schema_version="1.0.0" fachkomponente="UC1116" fachmethode="init"><ParameterListe><Parameter name="UEBERGEORDNETERVORGANGID" value="3265"/></ParameterListe></prometheuss> So this is what I tried so far: After the property transfer I inserte a groovy step with the following content: def declaration = testRunner.testCase.testSuite.getPropertyValue("prexml") log.info(declaration) // Output: <?xml version="1.0" encoding="ISO-8859-15"?> def XML = context.expand('${UC1.116_init#Request}') log.info(XML) // Output: <prometheuss schema_version="1.0.0" fachkomponente="UC1116" fachmethode="init"><ParameterListe><Parameter name="UEBERGEORDNETERVORGANGID" value="3265"/></ParameterListe></prometheuss> //concatenate the values together adding a <br> between them def wellFormedXML = declaration +" \n" + XML log.info(wellFormedXML) // Output: <?xml version="1.0" encoding="ISO-8859-15"?><prometheuss schema_version="1.0.0" fachkomponente="UC1116" fachmethode="init"><ParameterListe><Parameter name="UEBERGEORDNETERVORGANGID" value="3265"/></ParameterListe></prometheuss> So, how can I use wellFormedXML as the REQUEST in my following HTTP-Request-Step? Re: XML declaration in request disappears after property transfer Thank you for your answer! Unfortunately things are more complicated: 1. It's possible that the XML request is not well formed. Unfortunatele I cannot correct this, because I have to deal with a server which cannot handle standard XML. 2. The test step fails because the request is not even accepted by the server (because of the missing declaration) - Error 500. 3. You suggest to use an event handler to add the declaration again. But how exatly do I have to do that? Do I need a groovy skript or how can the be accomplished? Regards Marcus XML declaration in request disappears after property transfer I am using application/xml requests in http test steps. At the beginnig of each request a xml declariation is needed <?xml version="1.0" encoding="ISO-8859-15"?>. It works fine as long as I run the request stand alone. But when run a property transfer before, the xml declaration will be removed an the test step fails. What can I do? By the way - I found a similar question here. But the link to the answer does not work! Solved