cvs: presentations /slides/webservices babelfish.php curl.xml curlex.xml first.xml mice-small.jpg pear-small.jpg pear.php php.xml php1.xml request.php
rest.xml rest1.xml rest2.xml soap.xml soap1.xml soap2.xml soap3.xml soapbody.xml soapex1.xml soapfault.xml soapheader.xml soapmessage.xml
soapsimple.xml sxe.xml sxeex.xml sxeex1.xml user.php wsdl.xml wsdl1.xml xmlrpc.xml xmlrpcex1.xml xmlrpcpayload.xml xmlrpcpayload1.xml xrpcphp.xml
| From: | Sterling Hughes | Date: | Sun, 06 Jul 2003 23:12:41 +0000 |
| Subject: | cvs: presentations /slides/webservices babelfish.php curl.xml curlex.xml first.xml mice-small.jpg pear-small.jpg pear.php php.xml php1.xml request.php rest.xml rest1.xml rest2.xml soap.xml soap1.xml soap2.xml soap3.xml soapbody.xml soapex1.xml soapfault.xml soapheader.xml soapmessage.xml soapsimple.xml sxe.xml sxeex.xml sxeex1.xml user.php wsdl.xml wsdl1.xml xmlrpc.xml xmlrpcex1.xml xmlrpcpayload.xml xmlrpcpayload1.xml xrpcphp.xml |
||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-798@lists.php.net to get a copy of this message | ||
sterling Sun Jul 6 19:12:41 2003 EDT
Added files:
/presentations/slides/webservices curl.xml curlex.xml
pear-small.jpg pear.php php.xml
php1.xml request.php rest.xml
rest1.xml rest2.xml soapbody.xml
soapfault.xml soapheader.xml
soapmessage.xml soapsimple.xml
sxe.xml sxeex.xml sxeex1.xml
user.php xmlrpc.xml xmlrpcex1.xml
xmlrpcpayload.xml
xmlrpcpayload1.xml xrpcphp.xml
Modified files:
/presentations/slides/webservices babelfish.php first.xml
mice-small.jpg soap.xml soap1.xml
soap2.xml soap3.xml soapex1.xml
wsdl.xml wsdl1.xml
Log:
plane hacking
Index: presentations/slides/webservices/babelfish.php diff -u presentations/slides/webservices/babelfish.php:1.1 presentations/slides/webservices/babelfish.php:1.2 --- presentations/slides/webservices/babelfish.php:1.1 Sat Jul 5 18:19:23 2003 +++ presentations/slides/webservices/babelfish.php Sun Jul 6 19:12:41 2003 @@ -6,5 +6,5 @@ $WSDL = new SOAP_WSDL($wsdlurl); $babel = $WSDL->getProxy(); -echo $babel->BabelFish('de_en', 'Unser erstes Beispiel'); +echo $babel->BabelFish('de_en', 'Unser erstes SOAP Beispiel'); ?> Index: presentations/slides/webservices/first.xml diff -u presentations/slides/webservices/first.xml:1.2 presentations/slides/webservices/first.xml:1.3 --- presentations/slides/webservices/first.xml:1.2 Sat Jul 5 15:03:43 2003 +++ presentations/slides/webservices/first.xml Sun Jul 6 19:12:41 2003 @@ -1,5 +1,5 @@ <slide title="Our First Webservice"> <image filename="weirdsisters-small.jpg" align="right"/> <break lines="6"/> -<example title="Madness!" filename="first.php" result="1"/> +<example title="Madness!" filename="first.php"/> </slide> Index: presentations/slides/webservices/mice-small.jpg Index: presentations/slides/webservices/soap.xml diff -u presentations/slides/webservices/soap.xml:1.1 presentations/slides/webservices/soap.xml:1.2 --- presentations/slides/webservices/soap.xml:1.1 Sat Jul 5 18:19:23 2003 +++ presentations/slides/webservices/soap.xml Sun Jul 6 19:12:41 2003 @@ -1,6 +1,7 @@ <slide title="SOAP"> -<image filename="mice-small.jpg" align="right"/> -<break lines="6"/> +<break/> +<image filename="mice-small.jpg" align="right" marginright="1.0em"/> +<break lines="4"/> <blurb fontsize="4.0em"> SOAP is not an acronym </blurb> Index: presentations/slides/webservices/soap1.xml diff -u presentations/slides/webservices/soap1.xml:1.1 presentations/slides/webservices/soap1.xml:1.2 --- presentations/slides/webservices/soap1.xml:1.1 Sat Jul 5 18:19:23 2003 +++ presentations/slides/webservices/soap1.xml Sun Jul 6 19:12:41 2003 @@ -1,6 +1,7 @@ <slide title="SOAP"> -<image filename="mice-small.jpg" align="right"/> -<break lines="6"/> +<break/> +<image filename="mice-small.jpg" align="right" marginright="1.0em"/> +<break lines="4"/> <blurb fontsize="4.0em"> SOAP is a messaging format, not an RPC format </blurb> Index: presentations/slides/webservices/soap2.xml diff -u presentations/slides/webservices/soap2.xml:1.1 presentations/slides/webservices/soap2.xml:1.2 --- presentations/slides/webservices/soap2.xml:1.1 Sat Jul 5 18:19:23 2003 +++ presentations/slides/webservices/soap2.xml Sun Jul 6 19:12:41 2003 @@ -1,11 +1,12 @@ <slide title="SOAP Document"> -<image filename="mice-small.jpg" align="right"/> +<break/> +<image filename="mice-small.jpg" align="right" marginright="1.0em"/> <break lines="4"/> <blurb fontsize="4.0em"> A SOAP Document must meet the following requirements </blurb> <list fontsize="4.0em"> -<bullet>Must have a top-level %Envelope% namespaced to http://soapinterop.org/</bullet> +<bullet>Must have a top-level %Envelope% namespaced to %http://schemas.xmlsoap.org/soap/envelope/%</bullet> <bullet>Must contain a %Header% and %Body% element</bullet> <bullet>The contents of that %Header% and %Body% must be properly namespaced</bullet> </list> Index: presentations/slides/webservices/soap3.xml diff -u presentations/slides/webservices/soap3.xml:1.1 presentations/slides/webservices/soap3.xml:1.2 --- presentations/slides/webservices/soap3.xml:1.1 Sat Jul 5 18:19:23 2003 +++ presentations/slides/webservices/soap3.xml Sun Jul 6 19:12:41 2003 @@ -1,13 +1,9 @@ -<slide title="SOAP Doc Cont."> -<image filename="mice-small.jpg" align="right"/> -<break lines="8"/> -<blurb fontsize="4.5em">Simplest SOAP Document</blurb> +<slide title="View Source"> <break/> -<example><![CDATA[<?xml version="1.0"?> -<Envelope xmlns="http://soapinterop.org"/> - <Header> - </Header> - <Body> - </Body> -</Envelope>]]></example> +<image filename="mice-small.jpg" align="right" marginright="1.0em"/> +<break lines="8"/> +<blurb align="center" fontsize="4.0em"> +SOAP is a ~View Source~ protocol. It takes advantage of XML's strengths and +allows for classification within the procedure call. +</blurb> </slide> Index: presentations/slides/webservices/soapex1.xml diff -u presentations/slides/webservices/soapex1.xml:1.1 presentations/slides/webservices/soapex1.xml:1.2 --- presentations/slides/webservices/soapex1.xml:1.1 Sat Jul 5 18:19:23 2003 +++ presentations/slides/webservices/soapex1.xml Sun Jul 6 19:12:41 2003 @@ -1,10 +1,12 @@ <slide title="SOAP and WSDL"> -<image filename="mice-small.jpg" align="right"/> +<break/> +<image filename="mice-small.jpg" align="right" marginright="2.0em"/> <php><![CDATA[<?php chdir(getcwd() . '/presentations/slides/webservices/'); ?>]]></php> <break lines="2"/> <blurb fontsize="4.0em"> We will use the WSDL file from %xmethods.net% to autogenerate a wrapper call, and then call the appropriate method. </blurb> -<example filename="babelfish.php" result="1"/> +<break/> +<example filename="babelfish.php"/> </slide> Index: presentations/slides/webservices/wsdl.xml diff -u presentations/slides/webservices/wsdl.xml:1.1 presentations/slides/webservices/wsdl.xml:1.2 --- presentations/slides/webservices/wsdl.xml:1.1 Sat Jul 5 18:19:23 2003 +++ presentations/slides/webservices/wsdl.xml Sun Jul 6 19:12:41 2003 @@ -1,5 +1,6 @@ <slide title="WSDL"> -<image filename="mice-small.jpg" align="right"/> +<break/> +<image filename="mice-small.jpg" align="right" marginright="1.0em"/> <break lines="4"/> <blurb fontsize="4.0em"> WSDL *is* an acronym Index: presentations/slides/webservices/wsdl1.xml diff -u presentations/slides/webservices/wsdl1.xml:1.1 presentations/slides/webservices/wsdl1.xml:1.2 --- presentations/slides/webservices/wsdl1.xml:1.1 Sat Jul 5 18:19:23 2003 +++ presentations/slides/webservices/wsdl1.xml Sun Jul 6 19:12:41 2003 @@ -1,5 +1,6 @@ <slide title="Welcome to the jungle"> -<image filename="mice-small.jpg" align="right"/> -<break lines="10"/> +<break/> +<image filename="mice-small.jpg" align="right" marginright="1.0em"/> +<break lines="6"/> <example filename="simple.wsdl" fontsize="1.9em"/> </slide> Index: presentations/slides/webservices/curl.xml +++ presentations/slides/webservices/curl.xml <slide title="cURL"> <break/> <list fontsize="4.0em"> <bullet>cURL is the swiss army knife of URL requests.</bullet> <bullet>PHP's cURL extension is some of the best written code in the universe.</bullet> <bullet marginleft="4.0em" effect="slide" type="none">|ff3333|~*cough cough*~|</bullet> <bullet>Can easily grok</bullet> <bullet marginleft="2.0em">HTTP(S) %POST%, %GET%, %PUT%, %DELETE%</bullet> <bullet marginleft="2.0em">Proxy Authentication (%Basic%, %NTLM%, %Digest%)</bullet> <bullet marginleft="2.0em">Non blocking transfers on multiple sources</bullet> <bullet marginleft="2.0em">Content Compression</bullet> <bullet>cURL is faster than Streams and Fopen wrappers</bullet> </list> </slide> Index: presentations/slides/webservices/curlex.xml +++ presentations/slides/webservices/curlex.xml <slide title="cURL Example"> <break/> <example filename="request.php" /> </slide> Index: presentations/slides/webservices/pear.php +++ presentations/slides/webservices/pear.php <?php require_once('XML/RPC.php'); $client = new XML_RPC_Client('/xmlrpc.php', 'pear.php.net'); $args[0] = new XML_RPC_Value; $args[0]->addScalar(true, $XML_RPC_Boolean); $result = $client->send( new XML_RPC_Message('package.listAll', $args) ); if ($result->faultCode()) { echo 'Error, ' . $result->faultString() . "\n<br/>\n"; } $packages = XML_RPC_decode($result->value()); $last_category = false; foreach ($packages as $name => $info) { if ($last_category != $info['category']) { echo str_repeat(' ', 40); echo "{$info['category']}\n"; $last_category = $info['category']; } echo "Name: $name\n"; echo "Summary: {$info['summary']}\n"; echo "State: {$info['state']}\n"; echo "\n\n"; } ?> Index: presentations/slides/webservices/php.xml +++ presentations/slides/webservices/php.xml <slide title="PHP & WS"> <break/> <blurb fontsize="3.5em"> PHP supports HTTP, and XML-RPC webservices out of the box. </blurb> <blurb fontsize="3.5em"> PHP supports SOAP via the %PEAR::SOAP% library. </blurb> <blurb fontsize="3.5em"> There is also a SOAP client in PECL, which is 100x faster than the PEAR::SOAP library. </blurb> <list> <bullet marginleft="4.0em" type="none" fontsize="2.5em" effect="slide"> Unfortunately it actually works about as often as I say the word ~bifurcate~. </bullet> </list> </slide> Index: presentations/slides/webservices/php1.xml +++ presentations/slides/webservices/php1.xml <slide title="HTTP WS & PHP"> <break/> <blurb fontsize="4.0em"> Custom tools for custom formats. </blurb> <list title="Toolbox" fontsize="4.0em"> <bullet>cURL</bullet> <bullet>OpenSSL</bullet> <bullet>SimpleXML |cc33ff|[PHP 5 only]|</bullet> </list> </slide> Index: presentations/slides/webservices/request.php +++ presentations/slides/webservices/request.php <?php $ch = curl_init('http://localhost/presservice.php'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); if ($data === false) { echo 'Error, ' . curl_error($ch) . "\n"; } curl_close($ch); echo "Contents: $data\n"; ?> Index: presentations/slides/webservices/rest.xml +++ presentations/slides/webservices/rest.xml <slide title="REST"> <break/> <blurb fontsize="4.0em"> I'll tell you what it means to me! </blurb> <break lines="3"/> <blurb fontsize="3.5em"> *Question:* How many HTTP methods have a defined behaviour? </blurb> <blurb fontsize="3.5em"> *Question:* How many do you actually use? </blurb> <blurb fontsize="3.5em"> *Question:* How many possible HTTP methods are there? </blurb> </slide> Index: presentations/slides/webservices/rest1.xml +++ presentations/slides/webservices/rest1.xml <slide title="REST Cont."> <break/> <list> <bullet fontsize="3.0em">Use your verbs!</bullet> <bullet fontsize="3.0em">Use your verbs appropriately!</bullet> </list> </slide> Index: presentations/slides/webservices/rest2.xml +++ presentations/slides/webservices/rest2.xml <slide title="A RESTful Poem"> <break lines="5"/> <blurb align="center" fontsize="3.5em"><![CDATA[Proponents of REST hope<br /> People will realize that HTTP is dope<br /> Can't you see? ~XML based webservices are bloat~<br /> Those who use them have missed the boat<br /> Roy Fielding is certainly a nice bloke<br /> But my god, he must toke<br /> What's this about many nouns and a verb?<br /> That's perfect proof you're on the herb!</br />]]> </blurb> </slide> Index: presentations/slides/webservices/soapbody.xml +++ presentations/slides/webservices/soapbody.xml <slide title="SOAP Body"> <break/> <image filename="mice-small.jpg" align="right" marginright="1.0em"/> <break/> <blurb fontsize="3.5em">The SOAP %Body% contains the document payload</blurb> <blurb fontsize="3.5em">This payload exists in two forms</blurb> <list> <bullet marginleft="2.0em" fontsize="2.6em">Document Literal</bullet> <bullet marginleft="2.0em" fontsize="2.6em">|0000ff|[Deprecated]| Section 5 Encoding (Pedantic typing)</bullet> </list> <break/> <example title="SOAP :: Document Literal"><![CDATA[<?xml version="1.0"?> <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <Header> </Header> <Body> <purge xmlns="http://www.edwardbear.org/distrib"> <documentid>12884</documentid> </purge> </Body> </Envelope>]]></example> </slide> Index: presentations/slides/webservices/soapfault.xml +++ presentations/slides/webservices/soapfault.xml <slide title="SOAP Faults"> <break/> <image filename="mice-small.jpg" align="right" marginright="1.0em"/> <break/> <blurb> Errors in SOAP should be returned as SOAP Faults. A SOAP Fault contains specific information detailing the reason for the Fault. </blurb> <break/> <example><![CDATA[<?xml version="1.0"?> <Fault> <faultcode xsi:type="xsd:QName"> SOAP-ENV:Client </faultcode> <faultstring xsi:type="xsd:string"> You sent an empty string </faultstring> <faultactor xsi:type="xsd:anyURI"> urn:SOAP_Example_Server </faultactor> <detail xsi:type="xsd:string"/> </Fault>]]></example> <blurb>Faults can be of four basic types: VersionMismatch, MustUnderstand, Client and Server:</blurb> <list> <bullet>VersionMismatch: invalid namespace for the SOAP Envelope</bullet> <bullet>MustUnderstand: a required header was not understood by the server</bullet> <bullet>Client: the message sent by the client was not properly formed, or did not contain the necessary information to fulfill the request.</bullet> <bullet>Server: the message could not be processed</bullet> </list> <blurb>Faults can also contain other information, such as a basic message describing the fault, the URI of the originator of the fault, and a detail field that can be used to provide additional information on the fault. </blurb> </slide> Index: presentations/slides/webservices/soapheader.xml +++ presentations/slides/webservices/soapheader.xml <slide title="SOAP Header"> <break/> <image filename="mice-small.jpg" align="right" marginright="1.0em"/> <break/> <blurb fontsize="3.5em">The SOAP Header is very much akin to a %HTTP% header.</blurb> <blurb fontsize="3.5em">SOAP aims to be transport independent (%HTTP%, %SMTP%, %send()%)</blurb> <break/> <example title="Sample SOAP Header"><![CDATA[<?xml version="1.0"?> <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <Header> <authinfo xmlns="http://www.edwardbear.org/auth/schema/"> <username>Sterling</username> <password>IHonLeiSiebnTognInEuropa</password> </authinfo> </Header> <Body> </Body> </Envelope>]]> </example> </slide> Index: presentations/slides/webservices/soapmessage.xml +++ presentations/slides/webservices/soapmessage.xml <slide title="SOAP Messages"> <break/> <image filename="mice-small.jpg" align="right" marginright="1.0em"/> <break/> <list> <bullet>Envelope wraps what is in the message</bullet> <bullet>Encoding defines serialization</bullet> </list> <list marginleft="2em"> <bullet>Strong Data typing 'Section 5' encoding</bullet> <bullet>Weak Data typing Literal encoding</bullet> <bullet>XML Schema data definition via WSDL</bullet> </list> <list> <bullet>RPC Conventions</bullet> </list> <list marginleft="2em"> <bullet>"Please do this for me."</bullet> <bullet>Used for "function call" type messaging</bullet> <bullet>Less work at the application level</bullet> </list> <list> <bullet>Document Model</bullet> </list> <list marginleft="2em"> <bullet>"I have information for you."</bullet> <bullet>You can pass arbitrary data, such as serialized DOM trees</bullet> <bullet>More work at the application level</bullet> <bullet>RPC-Like behaviour possible</bullet> </list> </slide> Index: presentations/slides/webservices/soapsimple.xml +++ presentations/slides/webservices/soapsimple.xml <slide title="SOAP Doc Cont."> <break/> <image filename="mice-small.jpg" align="right" marginright="1.0em"/> <break lines="4"/> <blurb fontsize="4.5em">Simplest SOAP Document</blurb> <break/> <example><![CDATA[<?xml version="1.0"?> <Envelope xmlns="http://soapinterop.org"/> <Header> </Header> <Body> </Body> </Envelope>]]></example> </slide> Index: presentations/slides/webservices/sxe.xml +++ presentations/slides/webservices/sxe.xml <slide title="SimpleXML"> <break/> <blurb fontsize="4.0em"> Simple XML is god's own tool. </blurb> <blurb fontsize="4.0em"> XML is a very simple data structure, why not treat it as one? </blurb> <blurb fontsize="4.0em"> %DOM% is bloat. </blurb> </slide> Index: presentations/slides/webservices/sxeex.xml +++ presentations/slides/webservices/sxeex.xml <slide title="SimpleXML"> <break/> <example title="A Sample Pres2 File"><![CDATA[<slide title="Hello World"> <list> <bullet>These are a few</bullet> <bullet>Sample Bullets</bullet> <bullet>This should be simple to parse</bullet> <bullet>But with SAX and DOM it is hell</bullet> </list> </slide>]]></example> <break lines="2"/> <example title="SimpleXML code"><![CDATA[<?php $s = simplexml_load_string($data); echo $s->title; echo "<ul>\n"; foreach ($s->list->bullet as $bullet) { echo " <li>$bullet</li>\n"; } echo "</ul>\n"; ?>]]></example> </slide> Index: presentations/slides/webservices/sxeex1.xml +++ presentations/slides/webservices/sxeex1.xml <slide title="cURL & SimpleXML"> <break/> <example filename="user.php" result="1"/> </slide> Index: presentations/slides/webservices/user.php +++ presentations/slides/webservices/user.php <?php $ch = curl_init("http://localhost/presservice.php?id=20"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $user = simplexml_load_string(curl_exec($ch)); ?> <table> <tr> <td colspan="2" align="center">Information about <?=$user->name->last?>, <?=$user->name->first?></td> </tr> <tr> <td>User ID</td> <td>Description</td> </tr> <tr> <td><?=$user->id?></td> <td><?=$user->description?></td> </tr> </table> Index: presentations/slides/webservices/xmlrpc.xml +++ presentations/slides/webservices/xmlrpc.xml <slide title="XML-RPC"> <image filename="weirdsisters-small.jpg" align="right"/> <break lines="2"/> <blurb fontsize="4.0em"> XML-RPC is the predecessor to SOAP, created by Dave Winer of UserLand Software (now Harvard) and Don Box of DevelopMentor (now Microsoft). </blurb> <blurb fontsize="4.0em"> From a semantical point of view, SOAP is simpler. </blurb> <blurb fontsize="4.0em"> But XML-RPC is very simple to implement, simple to understand and simple to use. </blurb> <blurb fontsize="4.0em"> It describes the method, not the data. </blurb> </slide> Index: presentations/slides/webservices/xmlrpcex1.xml +++ presentations/slides/webservices/xmlrpcex1.xml <slide title="Tastes So Good"> <break/> <image filename="pear-small.jpg" align="right"/> <blurb fontsize="3.5em"> The following example gets a list of packages from %PEAR%, and displays them on your machine. </blurb> <blurb fontsize="3.5em"> In real life you would use the %pear list-all% command. </blurb> <example filename="pear.php"/> </slide> Index: presentations/slides/webservices/xmlrpcpayload.xml +++ presentations/slides/webservices/xmlrpcpayload.xml <slide title="View Source"> <break/> <image filename="weirdsisters-small.jpg" align="right" marginright="1.0em"/> <break lines="6"/> <blurb fontsize="4.0em"> XML-RPC is not a ~View Source~ format. Its a computer serialization, for a computer, by a computer. </blurb> <blurb fontsize="4.0em"> With that said, let's look at some XML-RPC source... </blurb> </slide> Index: presentations/slides/webservices/xmlrpcpayload1.xml +++ presentations/slides/webservices/xmlrpcpayload1.xml <slide title="XML-RPC"> <break/> <image filename="weirdsisters-small.jpg" align="right" marginright="1.0em"/> <break lines="8"/> <example><![CDATA[<?xml version="1.0"?> <methodCall> <methodName>package.listAll</methodName> <params> <param> <value> <boolean>1</boolean> </value> </param> </params> </methodCall>]]></example> </slide> Index: presentations/slides/webservices/xrpcphp.xml +++ presentations/slides/webservices/xrpcphp.xml <slide title="XML-RPC and PHP"> <break/> <blurb fontsize="3.5em"> For production applications where you control the wire, XML-RPC is *currently* the best solution for PHP. </blurb> <list title="Why?" fontsize="3.5em"> <bullet>PHP's XML-RPC support is efficient</bullet> <bullet>PHP's SOAP support is terrible</bullet> <bullet marginleft="2.0em">On a language level</bullet> <bullet marginleft="2.0em">*And* on an IDE level</bullet> <bullet>In |cc0000|~*90%*~| of the cases, it is what you need</bullet> <bullet marginleft="3.0em" type="none">... |0000cc|~*54%*~| of presenters make up figures</bullet> </list> </slide>
Index: presentations/slides/webservices/babelfish.php diff -u presentations/slides/webservices/babelfish.php:1.1 presentations/slides/webservices/babelfish.php:1.2 --- presentations/slides/webservices/babelfish.php:1.1 Sat Jul 5 18:19:23 2003 +++ presentations/slides/webservices/babelfish.php Sun Jul 6 19:12:41 2003 @@ -6,5 +6,5 @@ $WSDL = new SOAP_WSDL($wsdlurl); $babel = $WSDL->getProxy(); -echo $babel->BabelFish('de_en', 'Unser erstes Beispiel'); +echo $babel->BabelFish('de_en', 'Unser erstes SOAP Beispiel'); ?> Index: presentations/slides/webservices/first.xml diff -u presentations/slides/webservices/first.xml:1.2 presentations/slides/webservices/first.xml:1.3 --- presentations/slides/webservices/first.xml:1.2 Sat Jul 5 15:03:43 2003 +++ presentations/slides/webservices/first.xml Sun Jul 6 19:12:41 2003 @@ -1,5 +1,5 @@ <slide title="Our First Webservice"> <image filename="weirdsisters-small.jpg" align="right"/> <break lines="6"/> -<example title="Madness!" filename="first.php" result="1"/> +<example title="Madness!" filename="first.php"/> </slide> Index: presentations/slides/webservices/mice-small.jpg Index: presentations/slides/webservices/soap.xml diff -u presentations/slides/webservices/soap.xml:1.1 presentations/slides/webservices/soap.xml:1.2 --- presentations/slides/webservices/soap.xml:1.1 Sat Jul 5 18:19:23 2003 +++ presentations/slides/webservices/soap.xml Sun Jul 6 19:12:41 2003 @@ -1,6 +1,7 @@ <slide title="SOAP"> -<image filename="mice-small.jpg" align="right"/> -<break lines="6"/> +<break/> +<image filename="mice-small.jpg" align="right" marginright="1.0em"/> +<break lines="4"/> <blurb fontsize="4.0em"> SOAP is not an acronym </blurb> Index: presentations/slides/webservices/soap1.xml diff -u presentations/slides/webservices/soap1.xml:1.1 presentations/slides/webservices/soap1.xml:1.2 --- presentations/slides/webservices/soap1.xml:1.1 Sat Jul 5 18:19:23 2003 +++ presentations/slides/webservices/soap1.xml Sun Jul 6 19:12:41 2003 @@ -1,6 +1,7 @@ <slide title="SOAP"> -<image filename="mice-small.jpg" align="right"/> -<break lines="6"/> +<break/> +<image filename="mice-small.jpg" align="right" marginright="1.0em"/> +<break lines="4"/> <blurb fontsize="4.0em"> SOAP is a messaging format, not an RPC format </blurb> Index: presentations/slides/webservices/soap2.xml diff -u presentations/slides/webservices/soap2.xml:1.1 presentations/slides/webservices/soap2.xml:1.2 --- presentations/slides/webservices/soap2.xml:1.1 Sat Jul 5 18:19:23 2003 +++ presentations/slides/webservices/soap2.xml Sun Jul 6 19:12:41 2003 @@ -1,11 +1,12 @@ <slide title="SOAP Document"> -<image filename="mice-small.jpg" align="right"/> +<break/> +<image filename="mice-small.jpg" align="right" marginright="1.0em"/> <break lines="4"/> <blurb fontsize="4.0em"> A SOAP Document must meet the following requirements </blurb> <list fontsize="4.0em"> -<bullet>Must have a top-level %Envelope% namespaced to http://soapinterop.org/</bullet> +<bullet>Must have a top-level %Envelope% namespaced to %http://schemas.xmlsoap.org/soap/envelope/%</bullet> <bullet>Must contain a %Header% and %Body% element</bullet> <bullet>The contents of that %Header% and %Body% must be properly namespaced</bullet> </list> Index: presentations/slides/webservices/soap3.xml diff -u presentations/slides/webservices/soap3.xml:1.1 presentations/slides/webservices/soap3.xml:1.2 --- presentations/slides/webservices/soap3.xml:1.1 Sat Jul 5 18:19:23 2003 +++ presentations/slides/webservices/soap3.xml Sun Jul 6 19:12:41 2003 @@ -1,13 +1,9 @@ -<slide title="SOAP Doc Cont."> -<image filename="mice-small.jpg" align="right"/> -<break lines="8"/> -<blurb fontsize="4.5em">Simplest SOAP Document</blurb> +<slide title="View Source"> <break/> -<example><![CDATA[<?xml version="1.0"?> -<Envelope xmlns="http://soapinterop.org"/> - <Header> - </Header> - <Body> - </Body> -</Envelope>]]></example> +<image filename="mice-small.jpg" align="right" marginright="1.0em"/> +<break lines="8"/> +<blurb align="center" fontsize="4.0em"> +SOAP is a ~View Source~ protocol. It takes advantage of XML's strengths and +allows for classification within the procedure call. +</blurb> </slide> Index: presentations/slides/webservices/soapex1.xml diff -u presentations/slides/webservices/soapex1.xml:1.1 presentations/slides/webservices/soapex1.xml:1.2 --- presentations/slides/webservices/soapex1.xml:1.1 Sat Jul 5 18:19:23 2003 +++ presentations/slides/webservices/soapex1.xml Sun Jul 6 19:12:41 2003 @@ -1,10 +1,12 @@ <slide title="SOAP and WSDL"> -<image filename="mice-small.jpg" align="right"/> +<break/> +<image filename="mice-small.jpg" align="right" marginright="2.0em"/> <php><![CDATA[<?php chdir(getcwd() . '/presentations/slides/webservices/'); ?>]]></php> <break lines="2"/> <blurb fontsize="4.0em"> We will use the WSDL file from %xmethods.net% to autogenerate a wrapper call, and then call the appropriate method. </blurb> -<example filename="babelfish.php" result="1"/> +<break/> +<example filename="babelfish.php"/> </slide> Index: presentations/slides/webservices/wsdl.xml diff -u presentations/slides/webservices/wsdl.xml:1.1 presentations/slides/webservices/wsdl.xml:1.2 --- presentations/slides/webservices/wsdl.xml:1.1 Sat Jul 5 18:19:23 2003 +++ presentations/slides/webservices/wsdl.xml Sun Jul 6 19:12:41 2003 @@ -1,5 +1,6 @@ <slide title="WSDL"> -<image filename="mice-small.jpg" align="right"/> +<break/> +<image filename="mice-small.jpg" align="right" marginright="1.0em"/> <break lines="4"/> <blurb fontsize="4.0em"> WSDL *is* an acronym Index: presentations/slides/webservices/wsdl1.xml diff -u presentations/slides/webservices/wsdl1.xml:1.1 presentations/slides/webservices/wsdl1.xml:1.2 --- presentations/slides/webservices/wsdl1.xml:1.1 Sat Jul 5 18:19:23 2003 +++ presentations/slides/webservices/wsdl1.xml Sun Jul 6 19:12:41 2003 @@ -1,5 +1,6 @@ <slide title="Welcome to the jungle"> -<image filename="mice-small.jpg" align="right"/> -<break lines="10"/> +<break/> +<image filename="mice-small.jpg" align="right" marginright="1.0em"/> +<break lines="6"/> <example filename="simple.wsdl" fontsize="1.9em"/> </slide> Index: presentations/slides/webservices/curl.xml +++ presentations/slides/webservices/curl.xml <slide title="cURL"> <break/> <list fontsize="4.0em"> <bullet>cURL is the swiss army knife of URL requests.</bullet> <bullet>PHP's cURL extension is some of the best written code in the universe.</bullet> <bullet marginleft="4.0em" effect="slide" type="none">|ff3333|~*cough cough*~|</bullet> <bullet>Can easily grok</bullet> <bullet marginleft="2.0em">HTTP(S) %POST%, %GET%, %PUT%, %DELETE%</bullet> <bullet marginleft="2.0em">Proxy Authentication (%Basic%, %NTLM%, %Digest%)</bullet> <bullet marginleft="2.0em">Non blocking transfers on multiple sources</bullet> <bullet marginleft="2.0em">Content Compression</bullet> <bullet>cURL is faster than Streams and Fopen wrappers</bullet> </list> </slide> Index: presentations/slides/webservices/curlex.xml +++ presentations/slides/webservices/curlex.xml <slide title="cURL Example"> <break/> <example filename="request.php" /> </slide> Index: presentations/slides/webservices/pear.php +++ presentations/slides/webservices/pear.php <?php require_once('XML/RPC.php'); $client = new XML_RPC_Client('/xmlrpc.php', 'pear.php.net'); $args[0] = new XML_RPC_Value; $args[0]->addScalar(true, $XML_RPC_Boolean); $result = $client->send( new XML_RPC_Message('package.listAll', $args) ); if ($result->faultCode()) { echo 'Error, ' . $result->faultString() . "\n<br/>\n"; } $packages = XML_RPC_decode($result->value()); $last_category = false; foreach ($packages as $name => $info) { if ($last_category != $info['category']) { echo str_repeat(' ', 40); echo "{$info['category']}\n"; $last_category = $info['category']; } echo "Name: $name\n"; echo "Summary: {$info['summary']}\n"; echo "State: {$info['state']}\n"; echo "\n\n"; } ?> Index: presentations/slides/webservices/php.xml +++ presentations/slides/webservices/php.xml <slide title="PHP & WS"> <break/> <blurb fontsize="3.5em"> PHP supports HTTP, and XML-RPC webservices out of the box. </blurb> <blurb fontsize="3.5em"> PHP supports SOAP via the %PEAR::SOAP% library. </blurb> <blurb fontsize="3.5em"> There is also a SOAP client in PECL, which is 100x faster than the PEAR::SOAP library. </blurb> <list> <bullet marginleft="4.0em" type="none" fontsize="2.5em" effect="slide"> Unfortunately it actually works about as often as I say the word ~bifurcate~. </bullet> </list> </slide> Index: presentations/slides/webservices/php1.xml +++ presentations/slides/webservices/php1.xml <slide title="HTTP WS & PHP"> <break/> <blurb fontsize="4.0em"> Custom tools for custom formats. </blurb> <list title="Toolbox" fontsize="4.0em"> <bullet>cURL</bullet> <bullet>OpenSSL</bullet> <bullet>SimpleXML |cc33ff|[PHP 5 only]|</bullet> </list> </slide> Index: presentations/slides/webservices/request.php +++ presentations/slides/webservices/request.php <?php $ch = curl_init('http://localhost/presservice.php'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); if ($data === false) { echo 'Error, ' . curl_error($ch) . "\n"; } curl_close($ch); echo "Contents: $data\n"; ?> Index: presentations/slides/webservices/rest.xml +++ presentations/slides/webservices/rest.xml <slide title="REST"> <break/> <blurb fontsize="4.0em"> I'll tell you what it means to me! </blurb> <break lines="3"/> <blurb fontsize="3.5em"> *Question:* How many HTTP methods have a defined behaviour? </blurb> <blurb fontsize="3.5em"> *Question:* How many do you actually use? </blurb> <blurb fontsize="3.5em"> *Question:* How many possible HTTP methods are there? </blurb> </slide> Index: presentations/slides/webservices/rest1.xml +++ presentations/slides/webservices/rest1.xml <slide title="REST Cont."> <break/> <list> <bullet fontsize="3.0em">Use your verbs!</bullet> <bullet fontsize="3.0em">Use your verbs appropriately!</bullet> </list> </slide> Index: presentations/slides/webservices/rest2.xml +++ presentations/slides/webservices/rest2.xml <slide title="A RESTful Poem"> <break lines="5"/> <blurb align="center" fontsize="3.5em"><![CDATA[Proponents of REST hope<br /> People will realize that HTTP is dope<br /> Can't you see? ~XML based webservices are bloat~<br /> Those who use them have missed the boat<br /> Roy Fielding is certainly a nice bloke<br /> But my god, he must toke<br /> What's this about many nouns and a verb?<br /> That's perfect proof you're on the herb!</br />]]> </blurb> </slide> Index: presentations/slides/webservices/soapbody.xml +++ presentations/slides/webservices/soapbody.xml <slide title="SOAP Body"> <break/> <image filename="mice-small.jpg" align="right" marginright="1.0em"/> <break/> <blurb fontsize="3.5em">The SOAP %Body% contains the document payload</blurb> <blurb fontsize="3.5em">This payload exists in two forms</blurb> <list> <bullet marginleft="2.0em" fontsize="2.6em">Document Literal</bullet> <bullet marginleft="2.0em" fontsize="2.6em">|0000ff|[Deprecated]| Section 5 Encoding (Pedantic typing)</bullet> </list> <break/> <example title="SOAP :: Document Literal"><![CDATA[<?xml version="1.0"?> <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <Header> </Header> <Body> <purge xmlns="http://www.edwardbear.org/distrib"> <documentid>12884</documentid> </purge> </Body> </Envelope>]]></example> </slide> Index: presentations/slides/webservices/soapfault.xml +++ presentations/slides/webservices/soapfault.xml <slide title="SOAP Faults"> <break/> <image filename="mice-small.jpg" align="right" marginright="1.0em"/> <break/> <blurb> Errors in SOAP should be returned as SOAP Faults. A SOAP Fault contains specific information detailing the reason for the Fault. </blurb> <break/> <example><![CDATA[<?xml version="1.0"?> <Fault> <faultcode xsi:type="xsd:QName"> SOAP-ENV:Client </faultcode> <faultstring xsi:type="xsd:string"> You sent an empty string </faultstring> <faultactor xsi:type="xsd:anyURI"> urn:SOAP_Example_Server </faultactor> <detail xsi:type="xsd:string"/> </Fault>]]></example> <blurb>Faults can be of four basic types: VersionMismatch, MustUnderstand, Client and Server:</blurb> <list> <bullet>VersionMismatch: invalid namespace for the SOAP Envelope</bullet> <bullet>MustUnderstand: a required header was not understood by the server</bullet> <bullet>Client: the message sent by the client was not properly formed, or did not contain the necessary information to fulfill the request.</bullet> <bullet>Server: the message could not be processed</bullet> </list> <blurb>Faults can also contain other information, such as a basic message describing the fault, the URI of the originator of the fault, and a detail field that can be used to provide additional information on the fault. </blurb> </slide> Index: presentations/slides/webservices/soapheader.xml +++ presentations/slides/webservices/soapheader.xml <slide title="SOAP Header"> <break/> <image filename="mice-small.jpg" align="right" marginright="1.0em"/> <break/> <blurb fontsize="3.5em">The SOAP Header is very much akin to a %HTTP% header.</blurb> <blurb fontsize="3.5em">SOAP aims to be transport independent (%HTTP%, %SMTP%, %send()%)</blurb> <break/> <example title="Sample SOAP Header"><![CDATA[<?xml version="1.0"?> <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <Header> <authinfo xmlns="http://www.edwardbear.org/auth/schema/"> <username>Sterling</username> <password>IHonLeiSiebnTognInEuropa</password> </authinfo> </Header> <Body> </Body> </Envelope>]]> </example> </slide> Index: presentations/slides/webservices/soapmessage.xml +++ presentations/slides/webservices/soapmessage.xml <slide title="SOAP Messages"> <break/> <image filename="mice-small.jpg" align="right" marginright="1.0em"/> <break/> <list> <bullet>Envelope wraps what is in the message</bullet> <bullet>Encoding defines serialization</bullet> </list> <list marginleft="2em"> <bullet>Strong Data typing 'Section 5' encoding</bullet> <bullet>Weak Data typing Literal encoding</bullet> <bullet>XML Schema data definition via WSDL</bullet> </list> <list> <bullet>RPC Conventions</bullet> </list> <list marginleft="2em"> <bullet>"Please do this for me."</bullet> <bullet>Used for "function call" type messaging</bullet> <bullet>Less work at the application level</bullet> </list> <list> <bullet>Document Model</bullet> </list> <list marginleft="2em"> <bullet>"I have information for you."</bullet> <bullet>You can pass arbitrary data, such as serialized DOM trees</bullet> <bullet>More work at the application level</bullet> <bullet>RPC-Like behaviour possible</bullet> </list> </slide> Index: presentations/slides/webservices/soapsimple.xml +++ presentations/slides/webservices/soapsimple.xml <slide title="SOAP Doc Cont."> <break/> <image filename="mice-small.jpg" align="right" marginright="1.0em"/> <break lines="4"/> <blurb fontsize="4.5em">Simplest SOAP Document</blurb> <break/> <example><![CDATA[<?xml version="1.0"?> <Envelope xmlns="http://soapinterop.org"/> <Header> </Header> <Body> </Body> </Envelope>]]></example> </slide> Index: presentations/slides/webservices/sxe.xml +++ presentations/slides/webservices/sxe.xml <slide title="SimpleXML"> <break/> <blurb fontsize="4.0em"> Simple XML is god's own tool. </blurb> <blurb fontsize="4.0em"> XML is a very simple data structure, why not treat it as one? </blurb> <blurb fontsize="4.0em"> %DOM% is bloat. </blurb> </slide> Index: presentations/slides/webservices/sxeex.xml +++ presentations/slides/webservices/sxeex.xml <slide title="SimpleXML"> <break/> <example title="A Sample Pres2 File"><![CDATA[<slide title="Hello World"> <list> <bullet>These are a few</bullet> <bullet>Sample Bullets</bullet> <bullet>This should be simple to parse</bullet> <bullet>But with SAX and DOM it is hell</bullet> </list> </slide>]]></example> <break lines="2"/> <example title="SimpleXML code"><![CDATA[<?php $s = simplexml_load_string($data); echo $s->title; echo "<ul>\n"; foreach ($s->list->bullet as $bullet) { echo " <li>$bullet</li>\n"; } echo "</ul>\n"; ?>]]></example> </slide> Index: presentations/slides/webservices/sxeex1.xml +++ presentations/slides/webservices/sxeex1.xml <slide title="cURL & SimpleXML"> <break/> <example filename="user.php" result="1"/> </slide> Index: presentations/slides/webservices/user.php +++ presentations/slides/webservices/user.php <?php $ch = curl_init("http://localhost/presservice.php?id=20"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $user = simplexml_load_string(curl_exec($ch)); ?> <table> <tr> <td colspan="2" align="center">Information about <?=$user->name->last?>, <?=$user->name->first?></td> </tr> <tr> <td>User ID</td> <td>Description</td> </tr> <tr> <td><?=$user->id?></td> <td><?=$user->description?></td> </tr> </table> Index: presentations/slides/webservices/xmlrpc.xml +++ presentations/slides/webservices/xmlrpc.xml <slide title="XML-RPC"> <image filename="weirdsisters-small.jpg" align="right"/> <break lines="2"/> <blurb fontsize="4.0em"> XML-RPC is the predecessor to SOAP, created by Dave Winer of UserLand Software (now Harvard) and Don Box of DevelopMentor (now Microsoft). </blurb> <blurb fontsize="4.0em"> From a semantical point of view, SOAP is simpler. </blurb> <blurb fontsize="4.0em"> But XML-RPC is very simple to implement, simple to understand and simple to use. </blurb> <blurb fontsize="4.0em"> It describes the method, not the data. </blurb> </slide> Index: presentations/slides/webservices/xmlrpcex1.xml +++ presentations/slides/webservices/xmlrpcex1.xml <slide title="Tastes So Good"> <break/> <image filename="pear-small.jpg" align="right"/> <blurb fontsize="3.5em"> The following example gets a list of packages from %PEAR%, and displays them on your machine. </blurb> <blurb fontsize="3.5em"> In real life you would use the %pear list-all% command. </blurb> <example filename="pear.php"/> </slide> Index: presentations/slides/webservices/xmlrpcpayload.xml +++ presentations/slides/webservices/xmlrpcpayload.xml <slide title="View Source"> <break/> <image filename="weirdsisters-small.jpg" align="right" marginright="1.0em"/> <break lines="6"/> <blurb fontsize="4.0em"> XML-RPC is not a ~View Source~ format. Its a computer serialization, for a computer, by a computer. </blurb> <blurb fontsize="4.0em"> With that said, let's look at some XML-RPC source... </blurb> </slide> Index: presentations/slides/webservices/xmlrpcpayload1.xml +++ presentations/slides/webservices/xmlrpcpayload1.xml <slide title="XML-RPC"> <break/> <image filename="weirdsisters-small.jpg" align="right" marginright="1.0em"/> <break lines="8"/> <example><![CDATA[<?xml version="1.0"?> <methodCall> <methodName>package.listAll</methodName> <params> <param> <value> <boolean>1</boolean> </value> </param> </params> </methodCall>]]></example> </slide> Index: presentations/slides/webservices/xrpcphp.xml +++ presentations/slides/webservices/xrpcphp.xml <slide title="XML-RPC and PHP"> <break/> <blurb fontsize="3.5em"> For production applications where you control the wire, XML-RPC is *currently* the best solution for PHP. </blurb> <list title="Why?" fontsize="3.5em"> <bullet>PHP's XML-RPC support is efficient</bullet> <bullet>PHP's SOAP support is terrible</bullet> <bullet marginleft="2.0em">On a language level</bullet> <bullet marginleft="2.0em">*And* on an IDE level</bullet> <bullet>In |cc0000|~*90%*~| of the cases, it is what you need</bullet> <bullet marginleft="3.0em" type="none">... |0000cc|~*54%*~| of presenters make up figures</bullet> </list> </slide>