<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" 
      xmlns:thr="http://purl.org/syndication/thread/1.0">
  <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/04/demystifying-web-services.html" />
  <link rel="self" type="application/atom+xml" href="http://www.insideria.com/atom.xml" />
  <id>tag:www.insideria.com,2009://34/tag:www.insideria.com,2009://34.35871-</id>
  <updated>2009-11-16T15:06:35Z</updated>
  <title>Comments for Demystifying Web Services (http://www.insideria.com/2009/04/demystifying-web-services.html)</title>
  <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.21-en</generator>
  <entry>
    <id>tag:www.insideria.com,2009://34.35871</id>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/04/demystifying-web-services.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://blogs.oreilly.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=34/entry_id=35871" title="Demystifying Web Services" />
    <published>2009-04-15T23:30:00Z</published>
    <updated>2009-04-16T15:38:01Z</updated>
    <title>Demystifying Web Services</title>
    <summary>I had my first encounter with web services about two years ago.  I was contracting at the time, and Adobe had just announced the end of development of the software where I had most of my reputation, Authorware.  I needed to retool my skills to Adobe Flex, and I needed to convey to potential clients what kind of skills they could expect as I was retooling.  I decided I wanted my company website to reflect the bleeding edge of what I was doing.  But I was also devoting a lot of time to blogging and participating in online newsgroups to try to spread the word, and I just didn&apos;t have time to manually update my site as often as I felt I needed to.</summary>
    <author>
      <name>Amy Blankenship</name>
      
    </author>
    
    <category term="Blogs" />
    
    <content type="html" xml:lang="en" xml:base="http://www.insideria.com/">
      <![CDATA[<p>I had my first encounter with web services about two years ago.  I was contracting at the time, and Adobe had just announced the end of development of the software where I had most of my reputation, Authorware.&nbsp; I needed to retool my skills to Adobe Flex, and I needed to convey to potential clients what kind of skills they could expect as I was retooling.&nbsp; I decided I wanted my company website to reflect the bleeding edge of what I was doing.  But I was also devoting a lot of time to blogging and participating in online newsgroups to try to spread the word, and I just didn't have time to manually update my site as often as I felt I needed to. </p>
<p>Luckily, <a href="http://www.blogger.com/home">Blogger</a>, the web logging service I use, allows you to publish your blog as an RSS feed, so I realized that I could get double duty out of my blog&#8212;I could consume my own blog on my company website, simultaneously keeping my site fresh and in the moment and demonstrating that I could at least <em>spell</em> RSS.&nbsp; I went looking for a tutorial on how to do this at my favorite tech site, <a href="http://www.4guysfromrolla.com/">4guysfromrolla.com</a>, and I found that the tutorials they had at the time were ASP.net.&nbsp; I didn't want to learn ASP.net just for this one task, so I reluctantly turned to the <a href="http://www.adobe.com">Adobe</a> website. I say reluctantly because 4guysfromrolla tutorials will usually teach you all of the concepts you need to do a task from start to finish, whereas Adobe articles often focus on how Adobe tools make it possible for you to perform a task without needing to know much about the underlying details of the technologies involved.&nbsp; And, indeed, I found <a href="http://www.adobe.com/devnet/dreamweaver/articles/dw_xsl_rss_03.html">a nice article</a> on Adobe's Dreamweaver Developer Center that gave me enough information that I could add this functionality into my web site in a couple of hours without having any clue as to what actually happens when you call a service.</p>

<p>For much of the time since then, the whole process has been shrouded in mystery to me.&nbsp; A web service was a piece of specialized code that was created by some process I didn't have time to research and that made its way into your page in a way that was hidden from the sight of mere mortals by the magic of Dreamweaver's automatic code generation.&nbsp; But then I was hired by VOIP.com, and I was asked to work on some pages that did a curious thing.&nbsp; They submitted an xml request to a page on another server, and that server would respond back with an xml response <strong>which my pages then parsed and displayed.</strong>&nbsp;After working on a few of these pages, I realized that I had discovered by accident the side of the code that had been hidden behind the curtain by Dreamweaver.</p>
<p>I probably would have still considered the process a bit magical and mysterious&#8212;after all, what we do with these xml-based services   can be pretty complex at times&#8212;but for one of those coincidences that turns an idle observation into an aha! moment.&nbsp;Some of my contracting clients have been with me for years, so if I can possibly find a way to support their projects while still honoring my full time job, I do it.&nbsp;One of my clients had decided to move his hosting from a Windows server to a Linux server, and by the time I knew anything about it, the transition had already been made.&nbsp; </p>

<p>The problem is that the proprietary activation system on his DVD-based Authorware courses depended on an Access database on the server, and any Access drivers I could find for Linux required that a Windows machine be physically attached to the Linux machine. I had a feeling that if we asked his hosting company to do that, it would wind up being very expensive.&nbsp;And that's where the aha! came in&#8212;since a Windows server had to be involved anyway, couldn't we use some of the same techniques that I was using on my full-time job to get data from a cheap Windows hosting account and feed it through into the &quot;real&quot; website?&nbsp; The php page sitting in between would mean that we could even point to the &quot;old&quot; Windows server and then change that to point to a different server at some future date, without needing to issue new DVD's.</p>
<p>And even at that point, I have to admit I was picturing a complex scenario where I was going to have to submit an XML request from php, rewrite the ASP pages to return XML formatted results, and then reformat those results to return the simple return- and tab-delimited results the existing application expected.&nbsp; So I started looking into what the php version was of MSXML2.ServerXMLHTTP, the object that we typically use to send these types of requests in ASP classic.&nbsp; It turns out that php has something called the cURL library, which essentially serves the same purpose.&nbsp; When I started looking at the php examples, I realized that the task was much simpler than I'd thought&#8212;all I had to do was pass the request parameters through to the original ASP pages using cURL and my PHP pages would simply serve up the content from the ASP pages.&nbsp; Only the URL would be different.</p>

<p>All of this has been a long way around to say that a web service is really any piece of content that you call on the web and use as a resource in your own page.&nbsp; So, if the service is XML you can iterate through it like a recordset, for instance, or format it via XSLT and CSS.&nbsp; If it's plain text, you can either just pass it on through, as I did, or process it line by line to wrap it in HTML. Or you can pass XML on through without processing.</p>
<p>This last application is very important, because sometimes we need to use AJAX or Flash to access services on a domain that we have no control over.&nbsp; Both these technologies have restrictions on requests to other domains, but the normal ways around these restrictions, such as a crossdomain policy file for Flash, involve the need to put files on the server that hosts the feeds.&nbsp; By consuming a service from your own page without processing it, you can make it available to Flash and AJAX files hosted on your server.</p>
]]>
      
    </content>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.35871-comment:2094756</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.35871" type="text/html" href="http://www.insideria.com/2009/04/demystifying-web-services.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/04/demystifying-web-services.html#comment-2094756" />
    <title>Comment from locksmith on 2009-09-12</title>
    <author>
        <name>locksmith</name>
        <uri>http://www.national-locksmith.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.national-locksmith.com">
        <![CDATA[<p>Adobe flex and web services are new topic for me. I could understand only little bit. Thanks for posting this information. <a href="http://national-locksmith.com">locksmith</a></p>]]>
    </content>
    <published>2009-09-12T18:32:43Z</published>
  </entry>

</feed
