Forum Discussion

BA_Service_Haus's avatar
BA_Service_Haus
Regular Contributor
13 years ago

soapUI Mock: Encodings are removed from schema files

Hi,

when I created and ran a mock in soapUI Pro (4.6.0), I found that soapUI is changing the schema files.
It removes the encoding (UTF8), so I got problems with some special german characters (like ä, ö or ü).

This is, what the file started with before it was loaded to soapUI:

<?xml version="1.0" encoding="UTF-8"?>


This is, what soapUI returned in the mock:
<?xml version="1.0"?>


Why is this done?
Will this be fixed in one of the next versions?

Best regards
Nico

Btw: The encoding of the WSDL-File wasn't removed by soapUI.

6 Replies

  • Hi!

    We've tried to look into this, but need some more information to get a full understanding of what's causing problems for you.
    Could you provide a step-by-step instruction how to reproduce this issue?
    It would also be great if you could provide a sample WSDL and schema to be used when reproducing this.


    --
    Regards

    Erik
    SmartBear Sweden
  • BA_Service_Haus's avatar
    BA_Service_Haus
    Regular Contributor
    Hi Erik,

    right now I opened a ticket to send you the wsdl and schema files.
    Please do the following:
    - Create a new soapUI project (using these files)
    - create a mock service out of the interface
    - open a browser and navigate to the wsdl => you will see that the encoding is still defined in the 1st line
    - now open any of the imported schema files (node name "import") => now you will see, that the encoding is missing in the first line

    When parsing these schema files using an apache library (I guess it migth be Xmlschema-1.4.7.jar), we get a validation error.

    We don't get this error, when exporting the mock (Deploy as War) and run it on an WeblogicServer.
    There not only the encoding is missing, but also the xml-version (so in fact the whole 1st line is removed).

    Best regards
    Nico
  • Hello Nico,

    I've created a project in SoapUI using your wsdl files in the ticket you created.


    - open a browser and navigate to the wsdl => you will see that the encoding is still defined in the 1st line
    - now open any of the imported schema files (node name "import") => now you will see, that the encoding is missing in the first line


    Encodings are not associated with schema or wsdl files. It is used in the xml file.

    If you add the xml header manually <?xml version="1.0" encoding="UTF-8"?> to the response in the mock service, upon running the mock service you will see the xml header. Also the response will display the german characters correctly. I will attach the project with my modification in the ticket and send it to you.


    Regards,
    Marcus
    SmartBear Support
  • BA_Service_Haus's avatar
    BA_Service_Haus
    Regular Contributor
    Hi Marcus,

    thank you for your response.

    What do you mean with
    Encodings are not associated with schema or wsdl files. It is used in the xml file.


    An xsd-Files and wsdl-files are xml-File, aren't they?
    So my problem isn't the encoding of mock responses but the encoding of xsd files, as we cannot parse it (admittedly, this is a very special requirement). I just wonder, why the first line of the xsd-Files are changed by soapUI (see my first post).

    Best regards
    Nico
  • Hi,

    I just replied on the ticket. The encoding attribute is not present when viewing the schemas through the SoapUI GUI, but the file is locally left in tact. SoapUI does not make changes to the schema.


    Regards,
    Marcus
    SmartBear Support