I’m a Stupid Moron

Or am I?
Today I did something that made me step back and recall a time long long ago when I was working with SOAP on a project. See, I had to integrate a PHP application with a SOAP service and used a utility to generate all the client objects and stubs I needed, then ran into a weird problem. One of the fields in the response object contained a string… of xml. This meant I had to go and parse data manually out of that field by hand rather than having a nice object model created by the utility I used.
“Those stupid morons! Why can’t they learn to embrace the technology they’re using!”
Why did they have to go and embed xml inside a cdata tag!? Why couldn’t they just import the namespace for it (it was schema-less anyway) and include it in the SOAP body??
Anyway, what triggered this recollection? I was working on a SOAP service that returns, in addition to some information used by the application, a binary attachment that is read into a 3rd party library on the client side. Let’s say it’s a PNG or something. Anyway, we decided to try out some different image adapters on the server end and I discovered that I could change the format to SVG and not only would the 3rd party library used on the client be able to parse it… I wouldn’t even have to change ANYTHING on the client side because the 3rd party library automatically detected the type. So I switched the output to SVG and reran the client app… perfect! It worked fine. Then I looked at the raw soap packets it produced while testing it with SoapUI:
<image><!CDATA[[<?xml version="1.0"> <svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> ...]]></image>
*Facepalm*
I suppose to my credit, it’s not as if the client app itself is meant to parse the SVG data itself anyway. ![]()
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!













