The Artima Developer Community
Sponsored Link

.NET Buzz Forum
XML can so easily be abused...

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Duncan Mackenzie

Posts: 689
Nickname: duncanma
Registered: Aug, 2003

Duncan Mackenzie is the Visual Basic Content Strategist at msdn.microsoft.com
XML can so easily be abused... Posted: Oct 22, 2003 2:14 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Duncan Mackenzie.
Original Post: XML can so easily be abused...
Feed Title: Code/Tea/Etc...
Feed URL: /msdnerror.htm?aspxerrorpath=/duncanma/rss.aspx
Feed Description: Duncan is the Visual Basic Content Strategist at MSDN, the editor of the Visual Basic Developer Center (http://msdn.microsoft.com/vbasic), and the author of the "Coding 4 Fun" column on MSDN (http://msdn.microsoft.com/vbasic/using/columns/code4fun/default.aspx). While typically Visual Basic focused, his blogs sometimes wanders off of the technical path and into various musing of his troubled mind.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Duncan Mackenzie
Latest Posts From Code/Tea/Etc...

Advertisement
I am getting really tired of seeing web services (or RSS feeds, or .NET methods, or anything else) with large blocks of complex, structured data that is exposed as "String".

You call the web service, you get back this big string, which you then load into an XMLDocument and off you go (or XPath Navigator, etc...) ... but if they had just defined the real structure in the first place, I wouldn't have to do anything... I'd have a nice "weather" structure or "employee" object inside an "employees" collection... now, I can certainly massage/convert/deserialize their XML (well, I know it is XML, their wsdl says "String") into a nice object collection, but why should I have to!?! They went to all of the work to produce formatted, structured XML output, why type it is as String?

Ach, maybe I'm missing something here, but I'm starting to get grumpy. I remember trying to show off an easy web service connection when I was at a booth at a convention so I randomly picked a web service listed on xmethods.com, and I picked the wrong one... now, don't get me wrong... it worked fine, but I had to parse XML to get the temperature which made my simple demo a little more complicated than I wanted!

What I wanted was;

Dim myTemp as GlobalWeather.TemperatureResponse = GlobalWeather.GetTemperature("Redmond","United States")
MsgBox(myTemp.Current)
(note, don't try that, it won't work... I'm just dreaming...)

There are plenty of web services (on xmethods and elsewhere) that work the right way (in my mind at least), but I keep running into ones that don't.... or .NET assemblies that accept a String as a parameter, that is actually a String containing an XML document... instead of a properly defined structure... even though the XML you pass in has to conform to a very exact specification... why would anyone do that? Well some people tell me it is for flexibility, but I doubt it often works out for them.

Tonight I started thinking of adding weather information to my music system (hey, it might seem odd, but it is up on the TV screen... might as well show some useful info) but I didn't want to scrape some web site, possibly breaking their terms of use and/or annoying them, so I went looking for a weather site that offered a feed or a web service and I found www.rssweather.com. Wow, that should just rock, right? Bugger. The weather info is dumped in as a HTML block in the body of each feed item... which probably works great in SharpReader, but why oh why couldn't they have included it in both a HTML format and as structured XML? RSS is extensible, they could have added their own namespace ... bah. Guess I'll keep looking.

Note that some web services should be string in, string out... like this cool looking RTF To HTML service I saw on xmethods...

[Listening to: Clint Eastwood - Gorillaz - Big Shiny Tunes 6 (03:45)]

Read: XML can so easily be abused...

Topic: DotNetNuke Previous Topic   Next Topic Topic: New and Notable 14

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use