Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do I set character encoding in SOAPUI Preferences

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

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

like image 433
user310291 Avatar asked Mar 02 '16 12:03

user310291


People also ask

How do you comment multiple lines in SoapUI?

Actually there is a shortcut: Ctrl + / will comment and uncomment the selected text.

How do I disable the start page in SoapUI?

In particular, the "SoapUI Start Page" window can never be closed. Clicking the X at top-right simply clears the contents from the window. The menu item: Desktop -> Close All also appears to have no effect most of the time.


3 Answers

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. enter image description here

like image 182
TouDick Avatar answered Oct 21 '22 20:10

TouDick


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

like image 10
Rao Avatar answered Oct 21 '22 19:10

Rao


I know this is an old question but the accepted answer doesn't work for me, I'm in Windows10, in my case I update the SoapUI-5.6.0\bin\SoapUI-5.6.0.vmoptions file, add a new JVM arguments:

-Dfile.encoding=UTF-8

Then restart the SOAP-UI, the response can return the correct content(e.g. with some special characters like ®)

like image 3
Terrence Wei Avatar answered Oct 21 '22 20:10

Terrence Wei