Mustapha Belmokhtar
Mustapha Belmokhtar

Reputation: 1219

SoapUI doesn't print multi-byte characters correctly

I have a java web service that I want to invoke using soapUI.

I want that SOAPUI shows the character correctly for example in a SOAP response I get the below response :

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Server</faultcode>
         <faultstring>Internal server Error </faultstring>
         <detail>
            <MYENDPOINT_NAME xmlns="MY_XMLNS">
               <ns2:code>INTROUVABLE</ns2:code>
               <ns2:message>Le fichier n□a pas été trouvé</ns2:message>
            </MYENDPOINT_NAME>
         </detail>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>

I want it to be like :

  <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Server</faultcode>
         <faultstring>500 Internal server Error </faultstring>
         <detail>
            <MY_ENDPOINT_NAME xmlns="MY_XMLNS">
               <ns2:code>INTROUVABLE</ns2:code>
               <ns2:message>Le fichier n’a pas été trouvé</ns2:message>
            </MY_ENDPOINT_NAME>
         </detail>
      </soap:Fault>
   </soap:Body>
</soap:Envelope> 

I tried to specify the charset in SOAP requests using UTF-8 and in the launching script using

-Dfile.encoding=UTF-8, but it still outputs the same result.

NB. the 500 Internal server Error is a normal functional behaviour in this case.

Upvotes: 1

Views: 2074

Answers (1)

Rao
Rao

Reputation: 21379

Couple of things.

  • Change the file.encoding value to UTF-8 in the SOAPUI_HOME/bin/soapui.bat. Make sure you have a backup of the file before making any changes.
  • In the SoapUI, Menu -> File -> Preferences -> UI Settings, Click the check box for Native L&F. Save the preferences. You many find more preferences here in the documentation.

Now close the SoapUI tool.

Open the command prompt; Go to %SOAPUI_HOME%\bin directory. Run soapui.bat

Suggestion: If you donot want to do that all the times, put SOAPUI_HOME/bin in PATH environment variable. Next time, soapui.bat should work from command prompt (irrespective of where you are present)

EDIT:

Another angle is to look at the application / server perspective. See if the application is configured to use file.encoding as UTF-8. If not, try configuring the application and retry.

Upvotes: 2

Related Questions