#!/usr/bin/perl use CGI qw/:standard :netscape/; use POSIX qw/strftime/; print "Content-type: text/html\n\n"; $page = param(page) || substr(path_info(),1) || 1; @data = split(/\n===/s, join("",)); ($title, $body) = ($data[$page] =~ /(.*?) ===(.*)/s); print < DevCon: $title EOH print "\n"; print "\n\n"; __DATA__ === === Keynote === <<< ! Web Services DevCon ~~ >>> === Keynote === <<< ! RSS namespaces ~~ >>> === Keynote === <<< ! Interop is all ~~ >>> === WhoAmI === Projects * [http://alphaworks.ibm.com/aw.nsf/bios/bsf IBM] * [http://www.php.net/credits.php PHP] * [http://jakarta.apache.org/credits/whoweare.html Jakarta] * [http://xml.apache.org/soap/contributors.html SOAP] * [http://xml.apache.org/whoweare.html XML] * [http://www.apache.org/foundation/board/ Apache] * [http://www.ecma.ch/ecma1/MEMENTO/TC39-G3.HTM ECMA] * [http://www.activestate.com/Corporate/People/Tech_Board.html#sam ActiveState] * [http://xml.apache.org/axis/who.html Axis] === WhoAmI === Blogs * [http://www.intertwingly.net/blog/ Blosxom] * [http://radio.weblogs.com/0101679/ Radio] * [http://www.oreillynet.com/weblogs/author/242 O'Reilly] === My goal === <<< ! Fundamentally change the way you look at SOAP ~~ >>> === Ground Rules === * More prose * Less code === Basic === [: 10 print "Hello World!" :] === C === [: #include main() { printf("Hello World!\n"); } :] === C++ === [: #include main() { cout << "Hello World!" << endl; } :] === Java === [: class HelloWorld { public static void main(String args[]) { System.out.print("Hello World "); } } :] === c# === [: class HelloWorld { public static void Main(string[] args) { System.Console.WriteLine("Hello World!"); } } :] === asmx === [: <%@ WebService Language="c#" Class="HelloWorld" %> using System.Web.Services; using System.Web.Services.Protocols; [SoapRpcService] public class HelloWorld { [WebMethod, SoapRpcMethod] public string greeting() { return "Hello World!"; } } :] === jws === [: public class HelloWorld { public String greeting() { return "Hello World!"; } } :] === Agenda === * Show how you probably learned SOAP * Show how SOAP should be taught * Apply this knowledge * Explore the implications * Conclusions === Question === How did you learn HTML? === Question === How did you learn HTML? # Reading the spec? === Question === How did you learn HTML? # Reading the spec? # Formal education? === Question === How did you learn HTML? # Reading the spec? # Formal education? # From a book? === Question === How did you learn HTML? # Reading the spec? # Formal education? # From a book? # View source? === HTML === Simple example: [: Hello World! :] === SOAP === Simple example: [:
:] === Google/SOAP === [: 00000000000000000000000000000000 absurd obfuscation 0 10 true false latin1 latin1 :] === Google/XML-RPC === [: googleGateway.search absurd obfuscation 0 10 0 latin1 latin1 00000000000000000000000000000000 :] === Agenda === <<< ! Applying this knowledge ~~ >>> === RSS Validator === Mark Pilgrim and I have been working on an RSS validator. * Written in Python * SAX based * Standalone or CGI * SOAP front end === Fault Template === [: %(code)s %(string)s %(traceback)s :] === Response Template === [: %(body)s :] === CGI (Python) === [: def applyTemplate(templateFile, params={}): template = open(os.path.join('templates', templateFile)) result = template.read() % params template.close() return result print 'Content-type: text/xml' print try: # validate events, rawdata = rssvalid.validate(sys.stdin) # format as xml from rssvalid.formatter.text_xml import Formatter output = Formatter((events, rawdata)) # output print applyTemplate('soap.tmpl', {'body':"\n".join(output)}) except: import traceback tb = ''.join(apply(traceback.format_exception, sys.exc_info())) from rssvalid.formatter.text_xml import xmlEncode print applyTemplate('fault.tmpl', {'code':sys.exc_info()[0], 'string':sys.exc_info()[1], 'traceback':xmlEncode(tb)}) :] === Agenda === <<< ! Implications ~~ >>> === What is architecture? === ~ [../outlet.png] === Observation === If you ever are in a position where you can control both ends of the wire... === Observation === If you ever are in a position where you can control both ends of the wire... There are much better protocols than SOAP === Observation === If you ever are in a position where you can control both ends of the wire... There are much better protocols than SOAP * Compactness === Observation === If you ever are in a position where you can control both ends of the wire... There are much better protocols than SOAP * Compactness * Fidelity === Moral === === Moral === ! Interop is all === Interop === What is the level that interop acts at? === Interop === What is the level that interop acts at? * What you think you sent? === Interop === What is the level that interop acts at? * What you think you sent? * What the other end actually received? === Moral === ! Don't program inside out === Moral === Don't program inside out: * Don't start with your implementation and selectively expose your internals * Start by deciding what goes over the wire === Interop === Interop means more than producing conforming messages and being able to consume everything you produce === Interop === Interop means more than producing conforming messages and being able to consume everything you produce Examples: * INF vs Infinity * four values for boolean === Interop === Interop means more than producing conforming messages and being able to consume everything you produce Examples: * INF vs Infinity * four values for boolean ** one can say that the spec is silly === Interop === Interop means more than producing conforming messages and being able to consume everything you produce Examples: * INF vs Infinity * four values for boolean ** one can say that the spec is silly, but not that the spec is unclear === Problems === Most of early interop problems were not in serialization and deserialization. Instead they were in the areas of: * SOAPAction * Namespaces * Parameter Names === Problems === Most of early interop problems were not in serialization and deserialization. Instead they were in the areas of: * SOAPAction * Namespaces * Parameter Names Solution: WSDL === WSDL === Web Services Description Language * service - collection of bound ports * binding - concrete operations * portType - abstract operations * message - individual message * types - schema === Schema === XML Schema is a good start... but... === Schema === XML Schema is a good start... but: * It is underspecified in a number of areas * It is missing exactly four things === Schema === Underspecified aspect of schema: date * Fractional seconds ** Microsoft: 7 digits of precision ** Apache: 3 digits of precision ** Schema: "any number of digits" * Missing timezones ** Microsoft: local time zone ** Apache: UTC (a.k.a. GMT) ** Schema: unspecified can't be correlated * Are timezones significant? === Schema === Four things missing from schema === Schema === Four things missing from schema * Array * Graph === Schema === Four things missing from schema * Array * Graph * Map (hash table, dictionary) * DataSet (ADO, recordset, diffgram) === Moral === ! Just say NO! to ADO! === Metacrap === Putting the torch to seven straw-men of the meta-utopia # People lie # People are lazy # People are stupid # Mission: Impossible -- know thyself # Schemas aren't neutral # Metrics influence results # There's more than one way to describe something [http://www.well.com/~doctorow/metacrap.htm] === Evolve === Three rules for evolvable systems # Only solutions that produce partial results when partially implemented can succeed. # What is, is wrong. # Evolution is cleverer than you are [http://www.shirky.com/writings/evolve.html] === Extensibility === Applied to SOAP Messages: * Namespaces * Named parameter association * Ignore what you don't understand * Provide reasonable defaults === Diversion: ReST === ReST: Representational State Transfer * Defines how one simply accesses (GET, PUT) an object (a.k.a., a resource) via a URI === Diversion: ReST === ReST: Representational State Transfer * Defines how one simply accesses (GET, PUT) an object (a.k.a., a resource) via a URI * Does NOT define how one represents state === Diversion: ReST === SOAP: Simple Object Access Protocol * Defines how one represents and transfers states === Diversion: ReST === SOAP: Simple Object Access Protocol * Defines how one represents and transfers states * Does NOT define how one accesses objects === Diversion: ReST === Did you know that amazon.com's front page has a query which is... === Diversion: ReST === Did you know that amazon.com's front page has a query which is (GASP!) implemented using HTTP POST? === Diversion: ReST === Did you know that amazon.com's front page has a query which is (GASP!) implemented using HTTP POST? * [http://www.xml.com/pub/a/2002/04/24/google.html?page=3 What would Frodo do?] === Diversion: ReST === Did you know that amazon.com's front page has a query which is (GASP!) implemented using HTTP POST? * [http://www.xml.com/pub/a/2002/04/24/google.html?page=3 What would Frodo do?] * Why, "gather together a fellowship of like-minded Hobbits, Dwarves, Elves and men and go on a quest to educate the world about the limitations of [such] interfaces.", of course! === Diversion: ReST === The output of a query is a HTML page with a table * Today's "green screen" ** Perl and Python scrapers * Separate content and presentation ** Self describing ** Schema on demand === Diversion: ReST === The output of a query is a HTML page with a table * Today's "green screen" ** Perl and Python scrapers * Separate content and presentation ** Self describing ** Schema on demand We've just described SOAP === Futures === * Send messages, not requests * Broadcast / asynchronous processing * Data based routing === Summary === * Don't program inside out * View source * If you pick SOAP, do so for interop === Summary === * Don't program inside out * View source * If you pick SOAP, do so for interop * Just say NO! to ADO! === Further reading === [http://www.intertwingly.net/blog/ http://www.intertwingly.net/blog/index.html] * [What Object Does SOAP Access? http://www.intertwingly.net/stories/2002/01/25/whatObjectDoesSoapAccess.html] * [Quest for SOAP Interoperability http://www.intertwingly.net/stories/2002/02/01/toInfinityAndBeyondTheQuestForSoapInteroperability.html] * [Neuro Transmitters http://www.intertwingly.net/stories/2002/04/05/neurotransmitters.html] * [Expect More http://www.intertwingly.net/stories/2002/07/29/expectMore.html] === My goal === <<< ! Fundamentally change the way you look at SOAP ~~ >>>