13 years ago
CData Displayed Incorrectly
When testing a web service response, I encountered some strange behavior. There are two parts to this issue...
1) Displaying text in wrapped in CDATA that is not truly wrapped in CDATA: For whatever reason I found that if I had text that contained 3 or more nodes (<html><b><i></i></b></html>) that it would automatically be wrapped in CDATA by SoapUI. Needless to say, this is misleading when you are trying to code an object that serializes an XMLCDataSection that is not working properly. Anything less than 3 nodes, would have the "<" parsed into "<" - which is they way it ought to be if the response does not have the text wrapped in CDATA.
Probably more importantly:
2) When actually passing text wrapped in CDATA, SoapUI uses the same rules above when displaying the data. If it has 3 nodes, it wraps it in CDATA, if it has less than that, it doesn't wrap it in CDATA. Why this is such an issue is if you are attempting to test that the response is actually capable of passing HTML without being parsed, you cannot test it using SoapUI! The only reason I found this is because I decided to bypass SoapUI and check the response using Internet Explorer (seriously), which is fine when running locally, but not when running off a remote server, so I found that XML Spy is able to process CDATA correctly. I am able to trace the correct xml through the code all the way until it reaches SoapUI, and SoapUI is just doing its own thing to the data.
I don't wish to use XML Spy, can this be fixed in SOAPUI? If not issue #1, at least issue #2?
1) Displaying text in wrapped in CDATA that is not truly wrapped in CDATA: For whatever reason I found that if I had text that contained 3 or more nodes (<html><b><i></i></b></html>) that it would automatically be wrapped in CDATA by SoapUI. Needless to say, this is misleading when you are trying to code an object that serializes an XMLCDataSection that is not working properly. Anything less than 3 nodes, would have the "<" parsed into "<" - which is they way it ought to be if the response does not have the text wrapped in CDATA.
Probably more importantly:
2) When actually passing text wrapped in CDATA, SoapUI uses the same rules above when displaying the data. If it has 3 nodes, it wraps it in CDATA, if it has less than that, it doesn't wrap it in CDATA. Why this is such an issue is if you are attempting to test that the response is actually capable of passing HTML without being parsed, you cannot test it using SoapUI! The only reason I found this is because I decided to bypass SoapUI and check the response using Internet Explorer (seriously), which is fine when running locally, but not when running off a remote server, so I found that XML Spy is able to process CDATA correctly. I am able to trace the correct xml through the code all the way until it reaches SoapUI, and SoapUI is just doing its own thing to the data.
I don't wish to use XML Spy, can this be fixed in SOAPUI? If not issue #1, at least issue #2?