• (cs) in reply to XMLord
    Anonymous:
    Alex Papadimoulis:

    I challenge some one to make a joke about integrating XML with some existing technology that someone hasn't already (or, is in the process of) actually implementing.


    <font size="2">
    It won't take long before someone will come up with this:
    XXML - eXtensible XML. It will look like this:

    <tag></tag>
        <attribute name="Tag"></attribute>
        <value></value>
            ...
        <value></value>


    Ha!</font>

    I would like to see this implemented purely so I can run some XML through it 10 times and laugh.
  • Hartmut Holzgraefe (unregistered)

    Well, besides the obvious XML bloat the really WTF for me is that
    it is returning 'void' and not specifying any exceptions it might throw either ...
    is this method so advanced that it can't possibly fail? ;)

  • puttz (unregistered) in reply to XMLord
    Anonymous:
    Alex Papadimoulis:

    I challenge some one to make a joke about integrating XML with some existing technology that someone hasn't already (or, is in the process of) actually implementing.


    <font size="2">
    It won't take long before someone will come up with this:
    XXML - eXtensible XML. It will look like this:

    <tag></tag>
        <attribute name="Tag"></attribute>
        <value></value>
            ...
        <value></value>


    Ha!</font>

    This sort of XML-in-XML has unfortunately already been invented, more or less, by Apple with their shiny new XML property-lists. -_-;

    The forum software apparently doesn't want me to paste anything, so I'll just link to Apple's documentation with an example.

  • (cs) in reply to Salta Mada

    Salta Mada:
    Anonymous:
    Nothing is wrong w/ web services.  You can use XML-RPC, SOAP, Rest.  The key is to use an abstraction layer that makes everything seem local.  I could imagine SmtpMail.Send(email); being backed by something from the above.


    Actually, XML-RPC and SOAP are WTFs.

    Why do people say stuff like this without backing it up? 

    Let me try:

    Actually, yo mama is a WTF!

  • Runtime Error (unregistered) in reply to puttz
    Anonymous:
    Anonymous:
    Alex Papadimoulis:

    I challenge some one to make a joke about integrating XML with some existing technology that someone hasn't already (or, is in the process of) actually implementing.


    <font size="2">
    It won't take long before someone will come up with this:
    XXML - eXtensible XML. It will look like this:

    <tag></tag>
        <attribute name="Tag"></attribute>
        <value></value>
            ...
        <value></value>


    Ha!</font>

    This sort of XML-in-XML has unfortunately already been invented, more or less, by Apple with their shiny new XML property-lists. -_-;

    The forum software apparently doesn't want me to paste anything, so I'll just link to Apple's documentation with an example.




    This is exactly why people shouldn't make jokes on here anymore.


  • (cs)

    I bet the webservice crashes if you send a "malformed XML" and of course, whoever created it, will blame it on the developers that don't know how to use it! is so simple!

  • (cs)

    Of all the people on this board, Alex, I thought you would be the last to compare code to data - VB to XML.

    Code (like VB) describes how methods are implemented.
    Data (like XML) describes how methods are to be used.

    If they had implemented a "sendmail" method in XSL, that would be a WTF.

  • egh (unregistered) in reply to Bus Raker
    Bus Raker:

    I wonder what the guys who invented SMTP think about this....

     

    Jonathan Postel would be spinning in his grave.

  • (cs) in reply to zip
    zip:

    Salta Mada:

    Actually, XML-RPC and SOAP are WTFs.

    Why do people say stuff like this without backing it up? 



    I'll back it up for him. Here's a trivial XML-RPC method call (body only):

    <methodCall>
     <methodName>colorCode</methodName>
     <params>
       <param>
        <array><data>
         <value><double>1.0</double></value>
         <value><double>0.8</double></value>
         <value><double>0.0</double></value>
        </data></array>
       </param>
     </params>
    </methodCall>

    and here's how a sane programmer would write it:

    colorCode([1.0, 0.8, 0.0]);

    Not only it's far shorter than the XML even after compressing the XML, but I can write a recursive-descent parser for that in... what... 60-100 LOC, depending on the language? Certainly less than the SAX code required for decoding the first version.

    Though I should compare it to the complexity of a minimal and not fully compliant XML parser, in order to be completely fair...

  • (cs) in reply to Whiskey Tango Foxtrot? Over.
    Anonymous:
    Bus Raker:

    I wonder what the guys who invented SMTP think about this....

     

    Actually, XML *would* be a decent way to send emails. I mean, emails are just text anyway, right? I can see it now... XMTP, the eXtensible Mail Transfer Protocol!!!  :ducks:



    I've used email as a carrier for a distributed service. Basically, piping email through a /etc/smrsh script to process XML/CSV data contained therein. Each such message had a subject containing the transaction ID of the email message, and the script sent an email in return to acknowledge receipt. If the sending server had a message unacknowledged after 4 hours, it would resend the message.

    This gives (nearly) all the advantages of SOAP/web services, but with the added advantage that a temporary network outage, or a sudden heavy burst of traffic/updates gets handled smoothly, without beating up any servers, and without data loss. (sendmail is awfully good at what it does!)
  • Ged (unregistered)

    One could easily write a wrapper or interface function for that stupid thing, one that actually takes the data as normal parameters, wraps it into xml and then passes it to the xml mailer. Who ever said the function must be used as-is...

  • (cs) in reply to Ged

    A wrapper for a wrapper for sending an email.

    When does it end?

  • Kinkhead (unregistered) in reply to e.thermal
    e.thermal:
    Anonymous:
    e.thermal:

    Did they want to limit which mahines could send email?  By forcing all the other apps to send their email through this one app they could channel the email generation and force all email to come from one enterprise server instead of many scattered around the enterprise.  This would allow them to leave the SMTP server stump removed for all servers except the one that hosted the webservice and then could configure their mail servers to only relay for that one address.

    See my comment below about outgoing SMTP servers that queue.

    Having queues on SMTP servers still wouldn't deal with the problem that some network administrators impose in which only designated servers can run SMTP software, either send or receive on port 25.  Through port filtering and IP sec many machines I have seen are locked down corporately and cannot no matter what communicate on very many ports, outside of port 80.   So I have seen better although similar solutions to this to solve the problems that corporate IT groups impose.



    I see. Port 25 is blocked, because we don't want just anybody to be able to send email with arbitrary From: addresses, but we'll provide a nifty new XML/HTTP service to allow just anybody to send email with arbitrary From: addresses. Brillant!

  • koning_robot (unregistered) in reply to Kinkhead

    The stupid thing about XMTP is that SMTP is already ~=eXteNSiBLe=~.

  • GmH (unregistered) in reply to Anonymaly
    Anonymous:
    Alex Papadimoulis:

    I challenge some one to make a joke about integrating XML with some existing technology that someone hasn't already (or, is in the process of) actually implementing.

    The best I came up with was defining an image format (like JPEG, GIF, etc) in XML. And then some one pointed me to SVG. Hoo boy.

    Ooooh... that's asking for a world of hurt.  How about "Secure Shell through XML?" or perhaps ANSI or RIP Graphics using an XML transport layer.

    Perhaps even the XML Human Genome project?  (On a side note, since we already have it decoded, who's going to write the emulator?)



    How about XTCP? :)

    <tcp> <header> <source-port>52123</source-port> <destination-port>80</destination-port> <sequence-number>123456</sequence-number> <ack-number>987654</ack-number> <control-flags> <urgent>0</urgent> <push>0</push> <reset>0</reset> <syn>0</syn> <finish>0</finish> </control-flags> <window-size>9216</window> <checksum>1234</checksum> <urgent-pointer>0</urgent-pointer> <options></options> </header> <data encoding="base64"> R0VUIC8gSFRUUC8xLjAKSG9zdDogd3d3LmV4YW1wbGUuY29tOjgwClVzZXItQWdlbnQ6IE1v emlsbGEvNC4wIChjb21wYXRpYmxlOyBNU0lFIDYuMDsgV2luTlQgNS4xKQpBY2NlcHQ6ICoK Cg== </data> </tcp>

  • (cs) in reply to GmH

    Re XTCP: If you use Ethereal you can export a capture file as XML.

  • Rowan (unregistered) in reply to XMLord
    Anonymous:
    Alex Papadimoulis:

    I challenge some one to make a joke about integrating XML with some existing technology that someone hasn't already (or, is in the process of) actually implementing.


    <font size="2">
    It won't take long before someone will come up with this:
    XXML - eXtensible XML. It will look like this:

    <tag></tag>
        <attribute name="Tag"></attribute>
        <value></value>
            ...
        <value></value>


    Ha!</font>


    Looks like XSDL to me...
  • Rhialto (unregistered)

    And... this makes the more and more common but very annoying mistake of confusing an "email" with an "email address" (the Email attribute). People don't ask for someone's house, why should they ask for their email?

  • (cs) in reply to Xarium
    Xarium:
    Of all the people on this board, Alex, I thought you would be the last to compare code to data - VB to XML.

    Code (like VB) describes how methods are implemented.
    Data (like XML) describes how methods are to be used.

    If they had implemented a "sendmail" method in XSL, that would be a WTF.

    Issue is that the boundaries here are damn blurry, code is data too, and data is also code.

    In different situations, your code is data to your compiler, or your interpreter, or your VM.

    But even in a single place, Lisp code is also Lisp data, and Lisp data is Lisp code as well.

  • RLCA (unregistered)

    I gotta say, I couldn't call the original code a WTF without knowing more about the framework they're using, and the environment in which it's running. It would be a WTF for a small app running on a Windows PC, but what about an enterprise app containing servers in zones that don't allow direct communication outside over SMTP?

    Also, sending an email can be a blocking task that takes a significant amount of time. Maybe the framework makes the service available as an asynchronous task? I've used frameworks that did this. You don't want a couple of simultaneous email sends taking up a bunch of your valuable threads. Instead, you make it an asynchronous service, backed by a queue.

    As for the XML part, what if there are clients written in many different languages, on PCs, mainframes, etc that wish to perform this task? It may be perfectly acceptable to make the service abailable through XML over HTTP. Pretty much every client can invoke that, rather than depending on the clients being able to use COM, RMI or something similar.

    The code may be a WTF, but I think the biggest WTF is the way people are jumping all over what might very well be perfectly reasonable, and in fact could be perfect for the environment in which it works.

  • scriptkiddie (unregistered) in reply to noname today

    here's the output of a swf to xml converter:

          &lt;DefineBits objectID="2"&gt;
            &lt;data&gt;
              &lt;data&gt;/9j/4AAQSkZJRgABAQAAAQABAAD/wAARCAH0APoDAS... [ad infinitum]

    You guessed it. a bitmap in xml!

    (now will the "community server" mash up my post???)

  • Alan (unregistered)
    $ grep XML /dev/bollocks | head -10 | sed -e 's!\(.*\)!<bollocks value="\1" />!'
    <bollocks value="totally juice up acknowledged XML" />
    <bollocks value="horizontally transform lights-out XML" />
    <bollocks value="horizontally refactor legacy XML" />
    <bollocks value="expeditiously penetrate B2C XML" />
    <bollocks value="focus on distributed XML" />
    <bollocks value="definitively exploit B2C proprietary XML" />
    <bollocks value="systematically scale enterprise XML" />
    <bollocks value="generatively put on the back burner connected-economy XML" />
    <bollocks value="incrementally drive cohesive XML" />
    <bollocks value="optimally co-locate outbound dot-com XML" />
    

    See? easy....

  • (cs)

    I don't see the problem here. If you have an application that sends out a lot of different e-mails and you want this to be easily managed, it is not a bad idea to save the e-mail data externally (xml for example).

    Lot better than having to change the logic and recompile just to change a body or to header in some specific email...

  • (cs)

    The point about Web Services is that they provide a standardised mechanism by which methods can be discovered and invoked on remote systems. Typically you'll use a toolkit to generate the required proxy code to communicate with the required methods - the toolkit should be able to find out everything it needs to know about the methods from the (normally system generated) WSDL. As WSDL makes use of the XSD namespaces, the object graphs required to transmit and recieve data from the remote methods can be defined in detail so that the programmer making use of the remote method knows exactly what data is required in which types.

    The WTF here is not the 'sending-an-email-via-XML' idea (although it's fairly stupid); no, it's the fact that the method only has one input. Now, even though the author of the method is expecting an XML document (which in itself is insane), that's not what's been defined - the input is any old String.

    What should have been done here is to define a class or a struct to model the data being passed to the method (email address, name, from address and so on), and have that as the parameter. The WSDL can the accurately model the requirements for the method, and the framework can handle the mapping of the input data. Remember that a Web Service does not imply XML communication - that's only if you're using SOAP as the transport mechanism; you could just as easily be using HttpPost or HttpGet as transports.

  • (cs)

    XML is like violence, if it doen't fix your problem you're not using enough of it.

  • (cs)

    I hope the framework has got a helper class generating the XML string for the WebService, that implements this interface:
    public interface MailHelper
    {
    void From(String sender);
    void To(String receiver);
    void Cc(String copy);
    void Bcc(String blindCopy);
    void Subject(String subject);
    void Body(String mailText);
    String GenerateXml();
    }

    Now you can call the WebService like this:
    MailHelper helper = ...;
    helper.From(sender);
    ...
    serviceWrapper.SendEmailMessage(helper.GenerateXml());

  • SheWhoCannotBeBotheredLoggingIn (unregistered) in reply to Xenoveritas
    Anonymous:
    <plus><number value="1"><if><greater-than><variable name="a"><number value="1">(And, no, it was not supposed to be useful for anything. Just extremely ugly and extremely verbose.)


    Is that what God said after inventing politicians?
    </number></variable></greater-than></if>
    </number></plus>
  • (cs) in reply to scriptkiddie
    Anonymous:
    here's the output of a swf to xml converter:

          <DefineBits objectID="2">
            <data>
              <data>/9j/4AAQSkZJRgABAQAAAQABAAD/wAARCAH0APoDAS... [ad infinitum]

    You guessed it. a bitmap in xml!

    (now will the "community server" mash up my post???)

    So how is this different to, say, sending a binary attachment via SMTP - you do realise that attachments are converted to character strings (Base64 or UUEncode) whenever you send an email? Remeber that SMTP was only designed to handle ASCII characters (that's 7 bits not 8). Have a look at http://email.about.com/cs/standards/a/base64_encoding.htm for more information.

  • (cs)

    <font size="2">

    Alex Papadimoulis:
    </font>

    <font size="2">I was thinking exactly the same thing: what the heck is going on there!?! Thankfully, this same arduous task is easily accomplished with a dash of XML and the ever helpful Initech.EnterpriseFramework.WebServices.EmailWebService ...</font>

    <font size="2">///

    /// Sends an email message contained within an XML parameter. /// /// /// </font>

    <param name="emailXmlString">

    <font size="2">/// A string containing the XML of the email message. See remarks /// for the format of the XML. /// /// /// <remarks></remarks> /// The emailXmlString should be formatted as follows: /// <emailmessage></emailmessage> /// <from></from> ///

    </font><font size="2">
    </font>

    <font size="2">Holy WTF! I work with email  (a _lot_ of it), and stuff like this is part of what drives me insane.
    </font>

    <font size="2">Here is what you need to do if you need to send an email:
    </font>

    <font size="2">Method 1) Be a proper SMTP client. Connect to a designated mail submission agent (MSA on 587/tcp) and send mail via SMTP. This has the advantage that you do not need a mail client on the host itself, but it is slightly unreliable if your network connectivity fails (unless you implement queuing yourself).
    </font>

    <font size="2">Method 2) Run a MTA/MSA in submission only mode with a commandline interface (/usr/lib/sendmail or /usr/sbin/sendmail or equivalent). The MTA handles queueing and all the complexities of transferring mail over the network to the designated MTA.
    </font>

    <font size="2">Authentication is trivial to implement in SMTP (and for those people pointing out port 25 blocks, if you need to send mail, you can always get those lifted for mail going to a designated MSA).
    </font>

    <font size="2">The purpose of using different ports for different services is being broken by this whole HTTP for everything crap.
    </font>

    <font size="2">Why would you need to run SMTP over HTTP in the first place? Really, if you need to implement something like that, then you are solving the wrong problem in the first place.
    </font>

    <font size="2">(Hopefully this isn't mangled too much)
    </font>

  • (cs) in reply to Paula
    Anonymous:
    Anonymous:
    Alex Papadimoulis:

    I challenge some one to make a joke about integrating XML with some existing technology that someone hasn't already (or, is in the process of) actually implementing.


    <FONT size=2>
    It won't take long before someone will come up with this:
    XXML - eXtensible XML. It will look like this:

    <TAG></TAG>
        <ATTRIBUTE name="Tag"></ATTRIBUTE>
        <VALUE></VALUE>
            ...
        <VALUE></VALUE>


    Ha!</FONT>


    Brillant!

    Coming from Paula.   <FONT size=4>THAT</FONT> made me laugh!!!

  • (cs) in reply to XMLord
    XMLord:
    <font size="2">
    </font><font size="2">It won't take long before someone will come up with this:
    XXML - eXtensible XML. It will look like this:

    <Tag>
        <Attribute name="Tag"/>
        <Value>
            ...
        <Value>
    </Tag>

    Ha!</font>


    This is what you all have been waiting for: a truly extensible markup language! :D
    http://www.orfjackal.net/temp/xxml/

    (I just couldn't resist the temptation.)

    Here is what today's WTF looks like when it has been processed by this program:

    <font size="2"><?xml version="1.0"?>
    <element name="EmailMessage">
      <characters>
      </characters>
      <element name="From">
        <characters>
        </characters>
        <element name="Address">
          <attribute name="Name">John Doe</attribute>
          <attribute name="Email">[email protected]</attribute>
        </element>
        <characters>
      </characters>
      </element>
      <characters>
      </characters>
      <element name="To">
        <characters>
        </characters>
        <element name="Address">
          <attribute name="Name">John Doe</attribute>
          <attribute name="Email">[email protected]</attribute>
        </element>
        <characters>
      </characters>
      </element>
      <characters>
      </characters>
      <element name="CC">
        <characters>
        </characters>
        <element name="Address">
          <attribute name="Name">John Doe</attribute>
          <attribute name="Email">[email protected]</attribute>
        </element>
        <characters>
      </characters>
      </element>
      <characters>
      </characters>
      <element name="BCC">
        <characters>
        </characters>
        <element name="Address">
          <attribute name="Name">John Doe</attribute>
          <attribute name="Email">[email protected]</attribute>
        </element>
        <characters>
      </characters>
      </element>
      <characters>
      </characters>
      <element name="Subject">
        <characters>Test Email To John Doe</characters>
      </element>
      <characters>
      </characters>
      <element name="Body">
        <characters>This contains the body of the Email to John Doe</characters>
      </element>
      <characters>
    </characters>
    </element>
    </font>
  • (cs) in reply to Xenoveritas
    Anonymous:

    I started to create a LISP-like language using XML as the input format (since an XML DOM tree and a LISP-list are very, very similar) as a joke once. You'd get syntax like:


    They're not really that similar at all, I don't think.

    Shouldn't it have this DTD:

    <!DOCTYPE lisp-program list*>
    <!ELEMENT list (list|atom, list|atom)>  <!-- (car, cdr) -->
    <!ELEMENT atom #CDATA>


    ?

    <!-- (plus 2 2) -->
    <lisp-program>
      <list>
        <atom>plus</atom>
        <list>
          <atom>2</atom>
          <atom>2</atom>
        </list>
      </list>
    </lisp-program>


    That one reflects usage/theory not original syntax. Original LISP syntax is closer to this one:
    <!DOCTYPE lisp-program list*>
    <!ELEMENT list (list|atom*)>
    <!ELEMENT atom #CDATA>

    <!-- (plus 2 2) -->
    <lisp-program>
      <list>
        <atom>plus</atom>
        <atom>2</atom>
        <atom>2</atom>
      </list>
    </lisp-program>


    But here the parser would have to do more work.  For example, in the first DTD, implementing car and cdr are trivial; they are litirally the first and second sub-elements of the <list> element.  You could actually represent car and cdr with a trivial XPATH rule. 

    But in the second, it would have to create a new <list> element to contain the cdr list.

    Reed

  • (cs) in reply to mrsticks1982

    mrsticks1982:
    They were probably like "Look Guys/Gals I used XML!!!!"

    Which is a very valid reason in many (especially large) corporations, sadly...

    I've so far come across directives passed down from board (read CEO) level in multinational multibillion dollar corporations twice that dictated every application to use XML (no questions asked, doesn't matter if it serves any purpose, but every application has to use XML).

  • (cs)

    What's the problem now you just have to make the SmtpMail.Send function use the Web Service to send and you have a simple way to send emails while following the SOA Vision of Initech.

  • Anonymous Code Monkey (unregistered)

    So what happens if my email string looks like

    "</EMAILMESSAGE><EMAILMESSAGE>"

    Because people do things like that.

  • Anonymous Code Monkey (unregistered) in reply to Anonymous Code Monkey

    Hm.

    Well, I had html in that email string.  You know... close the body tag, start adding more html email tags....  You get the idea, right?

  • DZ (unregistered) in reply to miraculixx
    Anonymous:
    That's more than stupid.


    Its stupid++  !!!

    (or Inc(stupid) or stupid=stupid+1 for our Pascal/VB-coding friends)

        -dZ.
  • Julio (unregistered) in reply to DZ

    I don't see any problem upgrading all the company systems to support XML!!!1

    With our marketing department, we created a 3-month project to upgrade everything here to encapsulate all our data into XML. They guaranteed us our sales would skyrocket!!!!1one!!

    The first step was upgrading our network equipment to support RFC 3252 (Binary Lexical Octet Ad-hoc Transport). Please, take a look on http://www.faqs.org/rfcs/rfc3252.html.

  • (cs) in reply to firewireguy
    firewireguy:
    XML is like violence, if it doen't fix your problem you're not using enough of it.


    There is a difference: you can not get put in jail yet for using it.

    Too bad.

    Sincerely,

    Gene Wirchenko

  • Burt Himself (unregistered) in reply to Hartmut Holzgraefe
    Anonymous:
    Well, besides the obvious XML bloat the really WTF for me is that
    it is returning 'void' and not specifying any exceptions it might throw either ...
    is this method so advanced that it can't possibly fail? ;)


    Exceptions can be thrown server side and caught client side (in .Net anyway).
  • Lurker (unregistered) in reply to fregas

    Service Oriented Architecture properly refers to a set of design principles for constructing extensible applications architected around self-contained business units of work called "services." I could elaborate on the characteristics of SOA but the Wikipedia entry does a decent job on the basics.

    It is possible to employ SOA principles without using web services. In fact, it has been done so for many, many years in industries like telecommunications. The problem arises when a mechanism for enabling SOA (like web services) becomes conflated with the design principles.

    Back to lurking.....

  • Eric L (unregistered)

    So, this guys are guilty of making an email sending function that takes XML formatted e-mails (not a bad concept), but not taking extra time to define an abstraction layer that would make the process more object-friendly?

    Ooooooo... WTF.... I'm scared [8-)]

  • (cs)

    Ok, so let me get this right ...

    1. Create an XML document (with no apparent helper class/method) that represents the message to be sent.
    2. Wrap that XML in further XML (SOAP headers etc) and transmit this via HTTP to a server
    3. Unwrap the original XML from the SOAP XML
    4. Create an SMTP client (of some sort)
    5. Parse the original XML extracting the necessary parameters and allocating them to the SMTP client
    6. Send the original message to an SMTP server
    7. Swallow all and any errors that occur so the original client is none the wiser

    And some people on here think this is ok!

  • GhostHost (unregistered)

    Sadly, I know oh too well how this sort of thing happens:

    Application Programmer (AP): "You know that prototype web service for sending e-mail that accepts arrays in its parameters?  I can't use it."

    SOA Architect (SOA): "Why not?"

    AP: "The framework I'm forced to use for web services doesn't handle arrays according to spec, and corporate policy won't let me use a different framework that is actually compliant."

    SOA: "*sigh* can you at least pass me a single frickin' STRING?  I've gotta have this framework in production by the day after tomorrow."

     

  • (cs) in reply to Xarium

    Xarium:
    Of all the people on this board, Alex, I thought you would be the last to compare code to data - VB to XML.

    Code (like VB) describes how methods are implemented.
    Data (like XML) describes how methods are to be used.

    If they had implemented a "sendmail" method in XSL, that would be a WTF.

    He's comparing two different ways of doing the same thing.  He should have shown us the code that generates and processes that XML abomination, but it's easier and more concise to show us the XML and let us use our imaginations.

  • Codehead (unregistered) in reply to mugs

    I see so much overuse of XML where I work it makes me want to kill someone.  It's always the uber nerds that have no understanding of the big picture who think adding XML to an application will make it better. 

  • Xenoveritas (unregistered) in reply to reed
    reed:
    They're not really that similar at all, I don't think. (snip all the rest as the forums butchered it)
    You're right in that an XML document is, strictly speaking, a subset of LISP lists. Effectively an XML document is just a list of nodes, where each node can contain child lists of nodes. So:

    <tag att="1">some text</tag>

    Is semantically equivilent to something like:

    '('ELEMENT tag (('ATTRIBUTE att "1") ('TEXT "some text")))

    (Confession: I dunno if this is valid LISP, because I really know Scheme better than LISP.)

    So you can represent any XML document as a LISP list. You can't really do the reverse, though, without making stuff up. (Which is why you have the need for weird things like <atom/>)

    But by essentially fudging with the syntax, you can get a VERY verbose XML-based representation of LISP lists. And from there, you're only an evaluator away from having a working XML-based computer language. :)

    The real way that they're similar, though, is that they're based on lists of other lists. An XML element contains a list of other XML elements. (Redefine some of those elements as atoms, and you've got a working language.) In that respect, the two are similar.

    Take four on the stupid captcha... does case count?

  • Xenoveritas (unregistered) in reply to Xenoveritas

    Grr...  I'm really beginning to dislike this forum software.  That's the second post of mine it's gobbled the formatting in.  I think there's something screwy between my web browser and the forum software.  WYSIWYG is nice and all, but it's really starting to get annoying...

  • Kumo (unregistered)

    well "MailMessage" resides under system.WEB namespace and uses the old COM components in CDO which are not available on every machine.

    so if you publish your app through click once or any other x-copy'ish way , you wont be able to use those classes (unless you know that cdo is available on every machine).
    so the only odd part is the xml instead of object args..

  • (cs)

    Usually in .NET it is done like this:

    [WebMethod()]
    public void SendEmailMessage(EmailMessage message)
    {
    // code here
    }

    <font size="4">where EmailMessage is:</font>

    public class EmailMessage
    {
    private string _from;

    public string
    From
    {
    get { return _from; }
    set { _from = value; }
    }

    	private string _to;

    public string
    To
    {
    get { return _to; }
    set { _to = value; }
    }

    // all other properties follow
    ...
    }


    <font size="4">Now if you have a client proxy to your service</font>
    <font size="4"> (created automagically by the IDE)</font><font size="4">
    you can call it like this:</font>

    EmailMessage myMessage = new EmailMessage();
    myMessage.From = "[email protected]";
    myMessage.To = "[email protected]";
    ...
    EmailServiceProxy.SendEmailMessage(myMessage);
    <font style="font-family: Times New Roman;" size="4">
    The wtf is that in the previous code you have to create the XML by hand and then call
    the proxy method which could do it for you.</font>

Leave a comment on “Simplifying Email With Web Services”

Log In or post as a guest

Replying to comment #:

« Return to Article