Where do I set character encoding in SOAPUI Preferences

后端 未结 3 1495
执笔经年
执笔经年 2020-12-09 15:07

I can\'t seem to find any character encoding options in SoapUI preferences.

I want to mock xml response in iso-8859-1 encoding

相关标签:
3条回答
  • 2020-12-09 15:56

    To set up an encoding for request/response you have to mark it in Navigator. Then in the view under the navigator go to "Request/Response properties" choose encoding and set i.e. to UTF-8 or iso-8859-1.

    0 讨论(0)
  • 2020-12-09 16:08

    You may choose either of the following approach.

    Changing the defualt encoding

    1. Go to SOAPUI_HOME/bin.
    2. Open soapui.bat/.sh, depending on your platform.
    3. You should be able find JAVA_OPTS, then you can add there below line in a new line set JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding="iso-8859-1" on windows
      export JAVA_OPTS=$JAVA_OPTS -Dfile.encoding="iso-8859-1" on unix
    4. Save the file, start SoapUI.

    It should take default encoding as iso-8859-1.

    Alternatively, message specific:

    Otherwise, you may use message specific character encoding using http headersfor that specific one in the following way:

    Set a new header for request / response.
    Header Key/name:Content-Type
    Header Value :text/xml; charset=iso-8859-1

    0 讨论(0)
  • 2020-12-09 16:13

    if you have windows
    1- Open NotePad++ as a admin
    Go to path C:\Program Files (x86)\SmartBear\SoapUI-5.3.0\bin open soapui.bat and search for

    set JAVA_OPTS=%JAVA_OPTS% -Djava.library.path="%SOAPUI_HOME%\"
    set JAVA_OPTS=%JAVA_OPTS% -Dwsi.dir="%SOAPUI_HOME%..\wsi-test-tools"
    *****set JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding="iso-8859-1"*****
    

    Add the last line above set JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding="iso-8859-1" by taking the ***** out.

    Save and restart SOAPUI

    0 讨论(0)
提交回复
热议问题