- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
When you deal with a large vendor, you never to get to negotiate anything. So, if the alternative to this was to get 1000 sheets of paper to data entry, then you take this format and be happy with it.
Admin
What if I want to put Base64 blob in my Base64 encoded blob? Phew, I think we're finally safe.
Really this is an inevitable drug interaction of two XML panaceas: XML as a messaging interface (well in this case, two messaging interfaces since there is a SOAP layer as well), and XML as a data structure - like taking snake oil for both your lumbago and your psoriasis.
Admin
I support the death penalty for people who engineer this kind of stuff.
If SOAP is so unwieldy, then why are you using it?
Admin
Did something similar once. The automated layers delt with all the mess so the developer didn't have to unless they didn't have a copy of baseinputpacket or basereturnpacket classes, which means they shouldn't be calling it in the first place.
What it looked like to me was xml in string variables, which is a little more sane. A simpler collection type would have been more suitable.
Admin
Now I remember why I stopped reading TDWTF comments: because TDWTF doesn't provide free blood pressure medicine to compensate.
<Puts gun in mouth>Admin
You made my day.
Admin
Yes and no -- yes, payload/data separate is sometimes ok to do with xml-in-xml (albeit with significant performance loss) -- but that wasn't done here. Rather it was a big-ass complete inclusion with a bogus root element (not SOAP). So there is very low chance of this making any sense whatsoever -- the only potential reason would be to work-around problems in a container that tried to parse it.
Admin
As usualy people are either oversimplifying, ignoring or merging issues. SOAP/XML can be used for both the "envelope" and the "contents". If the delivery is to be independent of the message, then contents SHOULD be encoded so as not to be processed as part of the envelope. If the delivery is to be "transparant" then everything should be in clear XML.
XML should always be validated against a strict XSD. If you opt for "transparant" then ANY change impacts EVERY layer. Sometimes (rarely) is this appropriate.
From my perspective (as a systems developer) the most fustrating thing is when data is logically multiple layers but is presented as a flat (albiet hierarchical) item.
This requires ADDITIONAL work to separate the layers so that each can be validated within the prioper domain, and do do this in a manner that is robust against malformed or malicious messages.
Admin
I really hope this guy is joking/trolling...
If it wouldn't always be XML, what possible benefit could there be to wrapping it in SOAP? Seems the obvious solution would be to make it a RESTful service and use existing mechanisms to choose what the content is, like a Content-Type header.
Then again, I tend to see SOAP as one giant WTF in the first place.
Better yet, if it wouldn't always be XML, why not return a <string> tag when it's non-XML, and just return the XML when it is XML? Or does SOAP make that difficult?
If that's really an argument, what's to stop a bug from returning an unescaped </result> anyway and ruining the SOAP syntax, and why is it more desirable for a bug to ruin the encapsulated XML than the enclosing SOAP?
Or how about we stop manually emitting XML by concatenating strings together. It's the output version of trying to parse XML with regexes. Don't we have libraries to do this?
Admin
In honor of a sidebar thread:
document.write("<scr"+"ipt type='javascript'>"); document.write("document.write('We sure do!')"); document.write("</script>");
Admin
Admin
Admin
So if this is xml, encoded in xml, is it actually xxml?
Admin
Except that now you not only have to schema validate it, you also have to parse it.
Had you done it the way it was intended, the SOAP toolkit would have gotten it into a DOM that is more representative of the data (i.e. the objects generated by the toolkit). You can then make your logic layers perform the validation so that you can accept data from any source and pass it into the business logic/controller as a concrete type.
Setting it up for a DOM means you may have to pass the DOM instance around to your logic and traverse the tree/XPATH the values you're looking for. Totally inefficient, plus everyone has to remember what XML Schema is in the DOM. You'll try to keep track of which schema is appropriate to pass into a given logic method using comments. Say goodbye to overloaded methods and good OO practices in general; you can't overload methods when all the parameters are the type of the DOM object.
If you're not doing that, then you're parsing the DOM three times - once to get it into the DOM, once to schema validate it, and once to parse it back out of the DOM into your data objects. Lame.
Admin
Initech is also the name of the company from the movie Office Space. It could just be a placeholder name. :) The fact that someone actually named their company Initech is beyond me (Company from 2002, movie from 1999).
Admin
I'm just glad that I'm not working with web services.
Admin
yo dawg we heard you like XML, so we put XML in your XML so you can agnostically transfer data while u agnostically transfer data
Admin
The real WTF - the vendor is respected.
Admin
I like how it is inside a <string> element. Sweet!
I'm dealing with a company that does almost the exact same thing. Its not that big of a deal, except that I log the SOAP envelope. And when I want to just VIEW the xml, I've got to decode it first. I suppose I could have logged the decoded results, but...
What gets me is a different company is returning all of its values in CDatas. Well actually not all of them, just some of them sometimes. Do they not know what CData is for?
Admin
This is what we have in a respectable vendor platform. xml embedded inside xml embedded inside xml...
I guess we should call it XXXml?
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"> <ReportConfiguration xmlns="http://tempuri.org/ReportConfiguration.xsd"> <ReportView diffgr:id="ReportView1" msdata:rowOrder="0" diffgr:hasChanges="inserted"> <ReportName>Search Orders</ReportName> <ViewName>TerminalDemurrageData</ViewName> <Type>LayoutView</Type> <Data><?xml version="1.0" encoding="utf-16"?> <ReportLayoutView xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <LayoutStyle>&Full Layout Style</LayoutStyle> <ViewName>SearchOrdersReportView</ViewName> <UserName>View</UserName> <LayoutData><?xml version="1.0" encoding="utf-16"?> <ArrayOfKeyValuePair xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /></LayoutData> <AutoSizeColumn>false</AutoSizeColumn> . . . . .
Admin
What's XML, and how is it useful?
Admin
Admin
With this any level of compability can be achieved:
x^nml, where n is the level of compability needed.
Captcha: Populus, an awesome game.
Admin
Then WHY are you using SOAP???
Admin
A real-world SOAP service (no I won't tell whose) returns (as declared in the WSDL) a single "string" value which is a XML document (with a custom schema that is available so you can parse it with JAXB) that contains a bunch of CDATA sections. Guess what's the contents of these CDATA sections - yes, yet other XML files (with different schemas for each CDATA section, "because they were designed by different teams"). So you have to build a lot of JAXB stubs and do some tweaking to get at the "real" XML documents...
Honestly, what are XML namespaces for...?
Admin
smells like Axis...
Admin
Most of the web services offers by my vendors work this way. Our credit card processor is only a little bit better. It has one web method named "SoapOp" and this method has every possible parameter for any operation, as well as a parameter named "operation" to tell it what to do.
UPS does the whole "XML blob in, XML blob out" thing, but at least they have a straight HTTP version of the service where this makes sense.
On the other side, our networking team is making me consider encapsulating the entire request and response of our of our services in a generic message. As soon as they found out we were doing SOAP with a vendor, they routed us through a special proxy. The proxy does SOAP validation and now we have to get another team involved for any change to the SOAP interface. The other team is very slow and expensive, so we are very tempted to simply embed our data one more layer deep.
Admin
Let me see if I'm doing this right:
Yo dawg, I heard you like XML so I put some XML in yo' XML so you can parse XML to parse some more XML.
EDIT: Curses i was beaten to it!
Admin
If you can believe it, I've actually had to deal with worse. I had to deal with a wsdl that SAID string but returned xml, a complete and normal xml document inside of a soap response. This would choke the soap engine. When I first saw the wsdl, I was like, "Uh, is this escaped or wrapped in cdata?" "Escaped," they say. Come to find out they know not what they speak. I didn't approve of their string of xml, as most of you agree after seeing this, but I was willing to deal with it. When I found out they weren't even returning a valid response I put a stop on that implementation. I shouldn't have to go and write a garbage soap implementation just because your people are incompetent.
Admin
As if they have a choice...
Reminds me when in a local pub I asked what beer they offer and they said "What do you mean what beer? We have Beer. If you want any fancy foreign beer - well nobody orders them and we don't have them". So how the **** can I offer anything you don't have???
Admin
We need the decryption key for WTF -- XML
Admin
I've XML'd your XML, pray I don't XML it further!
Admin
Well Microsoft do this too...
http://msdn.microsoft.com/en-us/library/bb277362%28v=office.12%29.aspx
Admin
Good, if we're talking XSD!
What properly robust, web scale system freaks out it gets extra data?
It's a huge pain to get someone to make a trivial change to a schema; which you need to render (elsewhere) but provides no value to the other party.
They won't change and you have to fork your rendering code.
Admin
Meh, we've got something better on the project I'm working on: a web service sending XML... in binary.
Admin
Admin
Admin
OMG! I had the same thing with a german authority. They have a custom software for their user management and every additional software they want to use, has to implement a interface to communicate with the user management.
For this they wanted me (and every software they use) to implement a webservice they can push their user/right changes to. It has two methods one without argument to ping the webservice and one with one argument: a string.
The string they pass to the webservice contains the xml. When I asked why they do this: 1. more flexible to later changes 2. more compatible to non-.NET webservices (what!!!)
Admin
I am not kidding. We use a SOAP-Service that does exactly this. twice escaped... why not triple ? no idea. maybe because of web 2.0 ? I see them change it to
in the age of web 3.0 :)
Admin
Does it say "by Remy Porter" below the title? No, it doesn't. And AFAIK nobody else does unicorns and hidden comments here.
Admin
Our product hits sterling and we don't send this crap, just a normal xml message. Not to say they are good at even receiving those messages considering the WSDL says a field can have 0 instances but they told me if I don't send an empty instance of the field their side blows up, but the messages are clear enough.
Admin
TRWTF is that XML isn't eXtensible at all, and that XML namespaces (which are supposed to enable nesting different schemas) never seem to work properly.
Admin
Now you have 2^^2 problems.
Admin
Admin
Admin
TRWTF is sending the schema with every message.
Admin
The trick, BTW, is to not use any MSXML parser before version 6.
Admin
Do you encode before?
ludus: game?
Admin
Barely a WTF. Certainly not good enough to last for 2 days.
Admin
Microsoft Sharepoint Web Service? They do this as well. Not a MSFT hater, but some thats a POS impl.