illegal characters at line 1 and col 1 in xml response in jmeterJMeter issues with span tag in Response AssertionHow to make assertions based on response data in JMeter?How to assert something using response assertion that has different text in JmeterJmeter XSD validation stopped at first errorJMeter: What is the Best Assertion Type to Validate a Single Node Value in an XML?XPath Extractor - SAXParseException - Xpath QueryValidating JSON Response using Beanshell in jmeterJMeter Assertion to verify the count of records inserted into databaseJMeter if controller not workingJMeter Reponse Assertion lower case value

Why doesn't SpaceX land boosters in Africa?

Discworld quote about an "old couple" who having said everything to each other, can finally go about living their lives

ESTA Elegible after Qatar?

Customs and immigration on a USA-UK-Sweden flight itinerary

A quine of sorts

Meaning of the word "good" in context

How to track mail undetectably?

Russian equivalents of 能骗就骗 (if you can cheat, then cheat)

What election rules and voting rights are guaranteed by the US Constitution?

Can dual citizens open crypto exchange accounts where U.S. citizens are prohibited?

Installed software from source, how to say yum not to install it from package?

"I am [the / an] owner of a bookstore"?

What prevents a US state from colonizing a smaller state?

Can US Supreme Court justices / judges be "rotated" out against their will?

Is this house-rule removing the increased effect of cantrips at higher character levels balanced?

Fully submerged water bath for stove top baking?

How useful would a hydroelectric power plant be in the post-apocalypse world?

Why would Dementors torture a Death Eater if they are loyal to Voldemort?

Is it theoretically possible to hack printer using scanner tray?

Hard for me to understand one tip written in "The as-if rule" of cppreference

I agreed to cancel a long-planned vacation (with travel costs) due to project deadlines, but now the timeline has all changed again

Can I take Amul cottage cheese from India to Netherlands?

Does a lens with a bigger max. aperture focus faster than a lens with a smaller max. aperture?

Would skyscrapers tip over if people fell sideways?



illegal characters at line 1 and col 1 in xml response in jmeter


JMeter issues with span tag in Response AssertionHow to make assertions based on response data in JMeter?How to assert something using response assertion that has different text in JmeterJmeter XSD validation stopped at first errorJMeter: What is the Best Assertion Type to Validate a Single Node Value in an XML?XPath Extractor - SAXParseException - Xpath QueryValidating JSON Response using Beanshell in jmeterJMeter Assertion to verify the count of records inserted into databaseJMeter if controller not workingJMeter Reponse Assertion lower case value













0















I am trying to validate the xml response from an REST API using JMETER. I am using xml schema assertion to validate the response using xsd.



I am getting the following error on XML Schema Assertion



Assertion error: true
Assertion failure: false
Assertion failure message: fatal: line=1 col=1 Content is not allowed in prolog.


When i see the response that i have received i see there are some illegal characters that is added at the beginning of the response xml.



enter image description here



I have tried to modify jmeter.properties file and changed the following values



jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.data_type=true
jmeter.save.saveservice.label=true
jmeter.save.saveservice.response_code=true
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.thread_name=true


Please help me in understanding how to remove the illegal characters in the response and allow the xsd validation to pass through.










share|improve this question


























    0















    I am trying to validate the xml response from an REST API using JMETER. I am using xml schema assertion to validate the response using xsd.



    I am getting the following error on XML Schema Assertion



    Assertion error: true
    Assertion failure: false
    Assertion failure message: fatal: line=1 col=1 Content is not allowed in prolog.


    When i see the response that i have received i see there are some illegal characters that is added at the beginning of the response xml.



    enter image description here



    I have tried to modify jmeter.properties file and changed the following values



    jmeter.save.saveservice.output_format=xml
    jmeter.save.saveservice.data_type=true
    jmeter.save.saveservice.label=true
    jmeter.save.saveservice.response_code=true
    jmeter.save.saveservice.successful=true
    jmeter.save.saveservice.thread_name=true


    Please help me in understanding how to remove the illegal characters in the response and allow the xsd validation to pass through.










    share|improve this question
























      0












      0








      0








      I am trying to validate the xml response from an REST API using JMETER. I am using xml schema assertion to validate the response using xsd.



      I am getting the following error on XML Schema Assertion



      Assertion error: true
      Assertion failure: false
      Assertion failure message: fatal: line=1 col=1 Content is not allowed in prolog.


      When i see the response that i have received i see there are some illegal characters that is added at the beginning of the response xml.



      enter image description here



      I have tried to modify jmeter.properties file and changed the following values



      jmeter.save.saveservice.output_format=xml
      jmeter.save.saveservice.data_type=true
      jmeter.save.saveservice.label=true
      jmeter.save.saveservice.response_code=true
      jmeter.save.saveservice.successful=true
      jmeter.save.saveservice.thread_name=true


      Please help me in understanding how to remove the illegal characters in the response and allow the xsd validation to pass through.










      share|improve this question














      I am trying to validate the xml response from an REST API using JMETER. I am using xml schema assertion to validate the response using xsd.



      I am getting the following error on XML Schema Assertion



      Assertion error: true
      Assertion failure: false
      Assertion failure message: fatal: line=1 col=1 Content is not allowed in prolog.


      When i see the response that i have received i see there are some illegal characters that is added at the beginning of the response xml.



      enter image description here



      I have tried to modify jmeter.properties file and changed the following values



      jmeter.save.saveservice.output_format=xml
      jmeter.save.saveservice.data_type=true
      jmeter.save.saveservice.label=true
      jmeter.save.saveservice.response_code=true
      jmeter.save.saveservice.successful=true
      jmeter.save.saveservice.thread_name=true


      Please help me in understanding how to remove the illegal characters in the response and allow the xsd validation to pass through.







      jmeter






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 25 at 15:41









      VinayakVinayak

      83 bronze badges




      83 bronze badges




















          1 Answer
          1






          active

          oldest

          votes


















          1














          These characters indicate Byte Order Mark so you can use BOMInputStream from the JSR223 PostProcessor in order to remove them from the response and replace the response data with "sanitized" XML.



          1. Add JSR223 PostProcessor as a child of the HTTP Request sampler where you want to remove this BOM


          2. Put the following code into "Script" area:



            def is = new ByteArrayInputStream(prev.getResponseData())
            def bOMInputStream = new org.apache.commons.io.input.BOMInputStream(is)
            def bom = bOMInputStream.getBOM()
            def charsetName = bom == null ? 'UTF-8' : bom.getCharsetName()
            def reader = new InputStreamReader(new BufferedInputStream(bOMInputStream), charsetName)
            prev.setResponseData(org.apache.commons.io.IOUtils.toByteArray(reader, 'UTF-8'))


          3. That's it, your assertion shouldn't be failing anymore.

          More information on Groovy scripting in JMeter: Apache Groovy - Why and How You Should Use It






          share|improve this answer























          • Thank you @Dmitri, this worked like a charm.. :)

            – Vinayak
            Mar 26 at 6:15










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55341470%2fillegal-characters-at-line-1-and-col-1-in-xml-response-in-jmeter%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          These characters indicate Byte Order Mark so you can use BOMInputStream from the JSR223 PostProcessor in order to remove them from the response and replace the response data with "sanitized" XML.



          1. Add JSR223 PostProcessor as a child of the HTTP Request sampler where you want to remove this BOM


          2. Put the following code into "Script" area:



            def is = new ByteArrayInputStream(prev.getResponseData())
            def bOMInputStream = new org.apache.commons.io.input.BOMInputStream(is)
            def bom = bOMInputStream.getBOM()
            def charsetName = bom == null ? 'UTF-8' : bom.getCharsetName()
            def reader = new InputStreamReader(new BufferedInputStream(bOMInputStream), charsetName)
            prev.setResponseData(org.apache.commons.io.IOUtils.toByteArray(reader, 'UTF-8'))


          3. That's it, your assertion shouldn't be failing anymore.

          More information on Groovy scripting in JMeter: Apache Groovy - Why and How You Should Use It






          share|improve this answer























          • Thank you @Dmitri, this worked like a charm.. :)

            – Vinayak
            Mar 26 at 6:15















          1














          These characters indicate Byte Order Mark so you can use BOMInputStream from the JSR223 PostProcessor in order to remove them from the response and replace the response data with "sanitized" XML.



          1. Add JSR223 PostProcessor as a child of the HTTP Request sampler where you want to remove this BOM


          2. Put the following code into "Script" area:



            def is = new ByteArrayInputStream(prev.getResponseData())
            def bOMInputStream = new org.apache.commons.io.input.BOMInputStream(is)
            def bom = bOMInputStream.getBOM()
            def charsetName = bom == null ? 'UTF-8' : bom.getCharsetName()
            def reader = new InputStreamReader(new BufferedInputStream(bOMInputStream), charsetName)
            prev.setResponseData(org.apache.commons.io.IOUtils.toByteArray(reader, 'UTF-8'))


          3. That's it, your assertion shouldn't be failing anymore.

          More information on Groovy scripting in JMeter: Apache Groovy - Why and How You Should Use It






          share|improve this answer























          • Thank you @Dmitri, this worked like a charm.. :)

            – Vinayak
            Mar 26 at 6:15













          1












          1








          1







          These characters indicate Byte Order Mark so you can use BOMInputStream from the JSR223 PostProcessor in order to remove them from the response and replace the response data with "sanitized" XML.



          1. Add JSR223 PostProcessor as a child of the HTTP Request sampler where you want to remove this BOM


          2. Put the following code into "Script" area:



            def is = new ByteArrayInputStream(prev.getResponseData())
            def bOMInputStream = new org.apache.commons.io.input.BOMInputStream(is)
            def bom = bOMInputStream.getBOM()
            def charsetName = bom == null ? 'UTF-8' : bom.getCharsetName()
            def reader = new InputStreamReader(new BufferedInputStream(bOMInputStream), charsetName)
            prev.setResponseData(org.apache.commons.io.IOUtils.toByteArray(reader, 'UTF-8'))


          3. That's it, your assertion shouldn't be failing anymore.

          More information on Groovy scripting in JMeter: Apache Groovy - Why and How You Should Use It






          share|improve this answer













          These characters indicate Byte Order Mark so you can use BOMInputStream from the JSR223 PostProcessor in order to remove them from the response and replace the response data with "sanitized" XML.



          1. Add JSR223 PostProcessor as a child of the HTTP Request sampler where you want to remove this BOM


          2. Put the following code into "Script" area:



            def is = new ByteArrayInputStream(prev.getResponseData())
            def bOMInputStream = new org.apache.commons.io.input.BOMInputStream(is)
            def bom = bOMInputStream.getBOM()
            def charsetName = bom == null ? 'UTF-8' : bom.getCharsetName()
            def reader = new InputStreamReader(new BufferedInputStream(bOMInputStream), charsetName)
            prev.setResponseData(org.apache.commons.io.IOUtils.toByteArray(reader, 'UTF-8'))


          3. That's it, your assertion shouldn't be failing anymore.

          More information on Groovy scripting in JMeter: Apache Groovy - Why and How You Should Use It







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 25 at 16:04









          Dmitri TDmitri T

          78.3k3 gold badges41 silver badges70 bronze badges




          78.3k3 gold badges41 silver badges70 bronze badges












          • Thank you @Dmitri, this worked like a charm.. :)

            – Vinayak
            Mar 26 at 6:15

















          • Thank you @Dmitri, this worked like a charm.. :)

            – Vinayak
            Mar 26 at 6:15
















          Thank you @Dmitri, this worked like a charm.. :)

          – Vinayak
          Mar 26 at 6:15





          Thank you @Dmitri, this worked like a charm.. :)

          – Vinayak
          Mar 26 at 6:15






          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55341470%2fillegal-characters-at-line-1-and-col-1-in-xml-response-in-jmeter%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript