{"id":1259,"date":"2004-08-12T21:45:19","date_gmt":"2004-08-13T01:45:19","guid":{"rendered":"https:\/\/dwan.org\/?p=1259"},"modified":"2019-10-27T21:46:04","modified_gmt":"2019-10-28T01:46:04","slug":"web-services","status":"publish","type":"post","link":"https:\/\/dwan.org\/index.php\/2004\/08\/12\/web-services\/","title":{"rendered":"Web Services"},"content":{"rendered":"\n<p>More geekage.<\/p>\n\n\n\n<p>I\u2019m writing a web service interface to my company\u2019s tools. The idea of web services is to provide a way of remotely invoking methods that can be transparently streamed through any wire protocol you want to use. This idea is far from new, but the infrastructure is finally in place to make it really simple and obvious how to do it.<\/p>\n\n\n\n<p>The goal is this: I have objects (data with attitude, or sometimes functions with associated data structures) that I would like to make available to other people. The traditional, and in many cases still the simplest, thing to do is to pick up the source code which implements those objects, haul it over to the machine on which I want to make it available, build it, and be done. People who want to use my objects must then link against them or include them (depending on the language).<\/p>\n\n\n\n<p>A more painful, but also well accepted method is to write an interface to every aspect of the objects that I want to share, and put that interface online via either a web page or a special and magical protocol made up just for these objects. If I\u2019m really infected with the \u201cnot invented here\u201d bug, I might choose to re-implement the \u201cfork and listen\u201d protocol instead of just using one of the zillion open source solutions to that particular problem. Users must, instead of just calling the functions, write code that speaks my language.<\/p>\n\n\n\n<p>The web services solution is a happy middle ground. We agree on a way to serialize objects (SOAP, the Simple Object Access Protocol, which is a special case of XML). Then, we agree on a way to move around these serialized objects. In this case, we\u2019re going to use HTTP, passing through a web server. Then (and here\u2019s the dark magic) the server makes the objects available to clients and nobody is the wiser about where the code really lives.<\/p>\n\n\n\n<p>For example, a PERL client might look like:<\/p>\n\n\n\n<p>use SOAP::LITE;<br>my $server = SOAP::Lite -> uri(\u201chttp:\/\/chris.dwan.org\/\u201d);<br>my %results = $server->do_that_funky_dance();<\/p>\n\n\n\n<p>Benefit: We have been saved the anguish of installing the code for \u201cdo_that_funky_dance\u201d on the client side.<br>Drawback: We had to install and use a SOAP client.<\/p>\n\n\n\n<p>I actually think this is a pretty cool set of technologies. Have any of the rest of you used it \/ got an opinion?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>More geekage. I\u2019m writing a web service interface to my company\u2019s tools. The idea of web services is to provide a way of remotely invoking methods that can be transparently streamed through any wire protocol you want to use. This idea is far from new,&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[],"class_list":["post-1259","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/dwan.org\/index.php\/wp-json\/wp\/v2\/posts\/1259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dwan.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dwan.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dwan.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dwan.org\/index.php\/wp-json\/wp\/v2\/comments?post=1259"}],"version-history":[{"count":1,"href":"https:\/\/dwan.org\/index.php\/wp-json\/wp\/v2\/posts\/1259\/revisions"}],"predecessor-version":[{"id":1260,"href":"https:\/\/dwan.org\/index.php\/wp-json\/wp\/v2\/posts\/1259\/revisions\/1260"}],"wp:attachment":[{"href":"https:\/\/dwan.org\/index.php\/wp-json\/wp\/v2\/media?parent=1259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dwan.org\/index.php\/wp-json\/wp\/v2\/categories?post=1259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dwan.org\/index.php\/wp-json\/wp\/v2\/tags?post=1259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}