Forum Discussion

Wirecard_Techno's avatar
14 years ago

SoapUI and special characters from XML 1.1

Hi,
during testing a SOAP interface, which returns XML 1.1 responses, I've run into an issue, when receiving a response,
which contains a special character:
<m0:[i]ExtPSFields[/i]>MC48_42=212&#x10;MC48_63=MCC0142560320</m0:ExtPSFields>


A message window in the XML tab of the Response window contains
line -1: error: Invalid character entity reference: &#x10;
line 12: Invalid character entity reference: &#x10;


All Assertions created for this request fail, and therefore the whole request fails.
The response starts with
<?xml version="1.1" encoding="UTF-8"?>

so this special character entity is a valid content for this response, but my test fails.

Although this is unexpected behaviour I was able to work around this issue by creating a SubmitListener.afterSubmit script,
which puts the character entity reference into a CDATA section:
<m0:ExtPSFields>MC48_42=212<![CDATA[&#x10;]]>MC48_63=MCC0142700320</m0:ExtPSFields>

Now the request is getting the same response, which is modified a bit,
and the Assertions work as expected (i.e. all Assertions pass).
I'm able to extract the contents of the response element ExtPSFields (besides other data) using a Groovy script test step.
Interesting enough this extracted contents does not(!) contain my modifications
(i.e. not CDATA section, just the special charater entity).

In the next test step I use the extracted data a content for an element in a new request sent to the same SOAP interface.
The request is rejected.
Ok, it's probably the same issue (i.e. using a special character entity reference),
so I add
<?xml version="1.1" encoding="UTF-8"?>

as the first line in the XML tab of my request definition.
And voila! The request is accepted and processed as expected.

BUT!
after closing the test step window with this request definition or even switching to the Form tab of the test step
this added line is lost, not saved, gone to nowhere.
Which means, every time I want to run this test case I have to edit this test step again and again.

Do I miss something here? Any rules I have to follow using XML 1.1 requests/responses?
Any hints would be welcome.

Kind Regards,
Andreas Deicke

Senior Quality Engineer
Wirecard Technologies AG
No RepliesBe the first to reply