cvs: presentations /slides/webservices CarRentalQuotes.wsdl GoogleSearch.wsdl about.xml about1.xml carcode.php first.php first.xml googleapi.php
titlepage.xml weirdsisters-small.jpg weirdsisters.jpg
| From: | Sterling Hughes | Date: | Sat, 05 Jul 2003 18:57:40 +0000 |
| Subject: | cvs: presentations /slides/webservices CarRentalQuotes.wsdl GoogleSearch.wsdl about.xml about1.xml carcode.php first.php first.xml googleapi.php titlepage.xml weirdsisters-small.jpg weirdsisters.jpg |
||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-782@lists.php.net to get a copy of this message | ||
sterling Sat Jul 5 14:57:40 2003 EDT
Added files:
/presentations/slides/webservices CarRentalQuotes.wsdl
GoogleSearch.wsdl about.xml
about1.xml carcode.php first.php
first.xml googleapi.php
titlepage.xml
weirdsisters-small.jpg
weirdsisters.jpg
Log:
add some initial slides and files
Index: presentations/slides/webservices/CarRentalQuotes.wsdl +++ presentations/slides/webservices/CarRentalQuotes.wsdl <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns1="http://SBGCarRentalService.sbg.travel.ws.dsdata.co.uk" xmlns:intf="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:impl="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk" xmlns="http://schemas.xmlsoap.org/wsdl/"><wsdl:types><schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://SBGCarRentalService.sbg.travel.ws.dsdata.co.uk"><import namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType name="CarRentalQuoteResponse"><sequence><element name="request" nillable="true" type="tns1:CarRentalQuoteRequest"/><element name="companyName" nillable="true" type="xsd:string"/><element name="rate" type="xsd:float"/><element name="currency" nillable="true" type="xsd:string"/><element name="carType" nillable="true" type="xsd:string"/><element name="mileage" nillable="true" type="xsd:string"/><element name="tax" nillable="true" type="xsd:string"/><element name="roadTax" nillable="true" type="xsd:string"/><element name="surcharges" nillable="true" type="xsd:string"/><element name="cDW" nillable="true" type="xsd:string"/><element name="pAI" nillable="true" type="xsd:string"/><element name="errorOccurred" type="xsd:boolean"/><element name="scrapeError" type="xsd:boolean"/><element name="errorMessage" nillable="true" type="xsd:string"/></sequence></complexType><complexType name="CarRentalQuoteRequest"><sequence><element name="companyName" nillable="true" type="xsd:string"/><element name="carType" nillable="true" type="xsd:string"/><element name="pickupLocation" nillable="true" type="xsd:string"/><element name="pickupDate" nillable="true" type="xsd:dateTime"/><element name="returnLocation" nillable="true" type="xsd:string"/><element name="returnDate" nillable="true" type="xsd:dateTime"/><element name="country" nillable="true" type="xsd:string"/><element name="currency" nillable="true" type="xsd:string"/></sequence></complexType></schema><schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"><import namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType name="ArrayOf_tns2_CarRentalQuoteResponse"><complexContent><restriction base="soapenc:Array"><attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:CarRentalQuoteResponse[]"/></restriction></complexContent></complexType><element name="ArrayOf_tns2_CarRentalQuoteResponse" nillable="true" type="impl:ArrayOf_tns2_CarRentalQuoteResponse"/><complexType name="ArrayOf_xsd_string"><complexContent><restriction base="soapenc:Array"><attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/></restriction></complexContent></complexType><element name="ArrayOf_xsd_string" nillable="true" type="impl:ArrayOf_xsd_string"/></schema></wsdl:types> <wsdl:message name="getCurrenciesRequest"> </wsdl:message> <wsdl:message name="getLocationsResponse"> <wsdl:part name="getLocationsReturn" type="intf:ArrayOf_xsd_string"/> </wsdl:message> <wsdl:message name="getQuotesResponse"> <wsdl:part name="getQuotesReturn" type="intf:ArrayOf_tns2_CarRentalQuoteResponse"/> </wsdl:message> <wsdl:message name="getCountriesResponse"> <wsdl:part name="getCountriesReturn" type="intf:ArrayOf_xsd_string"/> </wsdl:message> <wsdl:message name="getCarTypesResponse"> <wsdl:part name="getCarTypesReturn" type="intf:ArrayOf_xsd_string"/> </wsdl:message> <wsdl:message name="getQuotesRequest"> <wsdl:part name="carType" type="xsd:string"/> <wsdl:part name="country" type="xsd:string"/> <wsdl:part name="currency" type="xsd:string"/> <wsdl:part name="pickupDate" type="xsd:dateTime"/> <wsdl:part name="pickupLocation" type="xsd:string"/> <wsdl:part name="returnDate" type="xsd:dateTime"/> <wsdl:part name="returnLocation" type="xsd:string"/> <wsdl:part name="clientID" type="xsd:string"/> <wsdl:part name="userEmail" type="xsd:string"/> </wsdl:message> <wsdl:message name="getCountriesRequest"> </wsdl:message> <wsdl:message name="getCurrenciesResponse"> <wsdl:part name="getCurrenciesReturn" type="intf:ArrayOf_xsd_string"/> </wsdl:message> <wsdl:message name="getLocationsRequest"> <wsdl:part name="country" type="xsd:string"/> </wsdl:message> <wsdl:message name="getCarTypesRequest"> </wsdl:message> <wsdl:portType name="CarRentalQuotes"> <wsdl:operation name="getQuotes" parameterOrder="carType country currency pickupDate pickupLocation returnDate returnLocation clientID userEmail"> <wsdl:input name="getQuotesRequest" message="intf:getQuotesRequest"/> <wsdl:output name="getQuotesResponse" message="intf:getQuotesResponse"/> </wsdl:operation> <wsdl:operation name="getCountries"> <wsdl:input name="getCountriesRequest" message="intf:getCountriesRequest"/> <wsdl:output name="getCountriesResponse" message="intf:getCountriesResponse"/> </wsdl:operation> <wsdl:operation name="getLocations" parameterOrder="country"> <wsdl:input name="getLocationsRequest" message="intf:getLocationsRequest"/> <wsdl:output name="getLocationsResponse" message="intf:getLocationsResponse"/> </wsdl:operation> <wsdl:operation name="getCurrencies"> <wsdl:input name="getCurrenciesRequest" message="intf:getCurrenciesRequest"/> <wsdl:output name="getCurrenciesResponse" message="intf:getCurrenciesResponse"/> </wsdl:operation> <wsdl:operation name="getCarTypes"> <wsdl:input name="getCarTypesRequest" message="intf:getCarTypesRequest"/> <wsdl:output name="getCarTypesResponse" message="intf:getCarTypesResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="CarRentalQuotesSoapBinding" type="intf:CarRentalQuotes"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="getQuotes"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="getQuotesRequest"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:input> <wsdl:output name="getQuotesResponse"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="getCountries"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="getCountriesRequest"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:input> <wsdl:output name="getCountriesResponse"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="getLocations"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="getLocationsRequest"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:input> <wsdl:output name="getLocationsResponse"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="getCurrencies"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="getCurrenciesRequest"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:input> <wsdl:output name="getCurrenciesResponse"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="getCarTypes"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="getCarTypesRequest"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:input> <wsdl:output name="getCarTypesResponse"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="CarRentalQuotesService"> <wsdl:port name="CarRentalQuotes" binding="intf:CarRentalQuotesSoapBinding"> <wsdlsoap:address location="http://wavendon.dsdata.co.uk/axis/services/CarRentalQuotes"/> </wsdl:port> </wsdl:service> </wsdl:definitions> Index: presentations/slides/webservices/GoogleSearch.wsdl +++ presentations/slides/webservices/GoogleSearch.wsdl <?xml version="1.0"?> <!-- WSDL description of the Google Web APIs. The Google Web APIs are in beta release. All interfaces are subject to change as we refine and extend our APIs. Please see the terms of use for more information. --> <!-- Revision 2002-08-16 --> <definitions name="GoogleSearch" targetNamespace="urn:GoogleSearch" xmlns:typens="urn:GoogleSearch" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <!-- Types for search - result elements, directory categories --> <types> <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:GoogleSearch"> <xsd:complexType name="GoogleSearchResult"> <xsd:all> <xsd:element name="documentFiltering" type="xsd:boolean"/> <xsd:element name="searchComments" type="xsd:string"/> <xsd:element name="estimatedTotalResultsCount" type="xsd:int"/> <xsd:element name="estimateIsExact" type="xsd:boolean"/> <xsd:element name="resultElements" type="typens:ResultElementArray"/> <xsd:element name="searchQuery" type="xsd:string"/> <xsd:element name="startIndex" type="xsd:int"/> <xsd:element name="endIndex" type="xsd:int"/> <xsd:element name="searchTips" type="xsd:string"/> <xsd:element name="directoryCategories" type="typens:DirectoryCategoryArray"/> <xsd:element name="searchTime" type="xsd:double"/> </xsd:all> </xsd:complexType> <xsd:complexType name="ResultElement"> <xsd:all> <xsd:element name="summary" type="xsd:string"/> <xsd:element name="URL" type="xsd:string"/> <xsd:element name="snippet" type="xsd:string"/> <xsd:element name="title" type="xsd:string"/> <xsd:element name="cachedSize" type="xsd:string"/> <xsd:element name="relatedInformationPresent" type="xsd:boolean"/> <xsd:element name="hostName" type="xsd:string"/> <xsd:element name="directoryCategory" type="typens:DirectoryCategory"/> <xsd:element name="directoryTitle" type="xsd:string"/> </xsd:all> </xsd:complexType> <xsd:complexType name="ResultElementArray"> <xsd:complexContent> <xsd:restriction base="soapenc:Array"> <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:ResultElement[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="DirectoryCategoryArray"> <xsd:complexContent> <xsd:restriction base="soapenc:Array"> <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:DirectoryCategory[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="DirectoryCategory"> <xsd:all> <xsd:element name="fullViewableName" type="xsd:string"/> <xsd:element name="specialEncoding" type="xsd:string"/> </xsd:all> </xsd:complexType> </xsd:schema> </types> <!-- Messages for Google Web APIs - cached page, search, spelling. --> <message name="doGetCachedPage"> <part name="key" type="xsd:string"/> <part name="url" type="xsd:string"/> </message> <message name="doGetCachedPageResponse"> <part name="return" type="xsd:base64Binary"/> </message> <message name="doSpellingSuggestion"> <part name="key" type="xsd:string"/> <part name="phrase" type="xsd:string"/> </message> <message name="doSpellingSuggestionResponse"> <part name="return" type="xsd:string"/> </message> <!-- note, ie and oe are ignored by server; all traffic is UTF-8. --> <message name="doGoogleSearch"> <part name="key" type="xsd:string"/> <part name="q" type="xsd:string"/> <part name="start" type="xsd:int"/> <part name="maxResults" type="xsd:int"/> <part name="filter" type="xsd:boolean"/> <part name="restrict" type="xsd:string"/> <part name="safeSearch" type="xsd:boolean"/> <part name="lr" type="xsd:string"/> <part name="ie" type="xsd:string"/> <part name="oe" type="xsd:string"/> </message> <message name="doGoogleSearchResponse"> <part name="return" type="typens:GoogleSearchResult"/> </message> <!-- Port for Google Web APIs, "GoogleSearch" --> <portType name="GoogleSearchPort"> <operation name="doGetCachedPage"> <input message="typens:doGetCachedPage"/> <output message="typens:doGetCachedPageResponse"/> </operation> <operation name="doSpellingSuggestion"> <input message="typens:doSpellingSuggestion"/> <output message="typens:doSpellingSuggestionResponse"/> </operation> <operation name="doGoogleSearch"> <input message="typens:doGoogleSearch"/> <output message="typens:doGoogleSearchResponse"/> </operation> </portType> <!-- Binding for Google Web APIs - RPC, SOAP over HTTP --> <binding name="GoogleSearchBinding" type="typens:GoogleSearchPort"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="doGetCachedPage"> <soap:operation soapAction="urn:GoogleSearchAction"/> <input> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> <operation name="doSpellingSuggestion"> <soap:operation soapAction="urn:GoogleSearchAction"/> <input> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> <operation name="doGoogleSearch"> <soap:operation soapAction="urn:GoogleSearchAction"/> <input> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> <!-- Endpoint for Google Web APIs --> <service name="GoogleSearchService"> <port name="GoogleSearchPort" binding="typens:GoogleSearchBinding"> <soap:address location="http://api.google.com/search/beta2"/> </port> </service> </definitions> Index: presentations/slides/webservices/about.xml +++ presentations/slides/webservices/about.xml <slide title="What are Webservices?"> <blurb align="center" fontsize="4.0em" textcolor="red">Double, double; toil and trouble;</blurb> <blurb align="center" fontsize="4.0em" textcolor="red">Fire burn and cauldron bubble.</blurb> <image align="center" filename="weirdsisters.jpg"/> </slide> Index: presentations/slides/webservices/about1.xml +++ presentations/slides/webservices/about1.xml <slide title="What are Webservices?"> <image align="right" filename="weirdsisters-small.jpg"/> <break lines="5"/> <blurb fontsize="4.5em"> Computer communication over the web (HTTP). </blurb> <list fontsize="4.0em"> <bullet>SOAP</bullet> <bullet>XML-RPC</bullet> <bullet>HTTP</bullet> <bullet>REST</bullet> </list> </slide> Index: presentations/slides/webservices/carcode.php +++ presentations/slides/webservices/carcode.php <?php require_once('SOAP/Client.php'); $wsdl = new SOAP_WSDL('CarRentalQuotes.wsdl'); echo $wsdl->generateProxyCode(); ?> Index: presentations/slides/webservices/first.php +++ presentations/slides/webservices/first.php <?php $TEXT = <<<MB Be bloody, bold, and resolute; laugh to scorn The power of man, for none of woman born Shall harm Macbeth. MB; $URL = 'http://landonize.it/index.php?' . 'filter=Landon&' . 'how=text&' . 'method=plain&' . 'text=' . urlencode(nl2br($TEXT)); echo file_get_contents($URL); ?> Index: presentations/slides/webservices/first.xml +++ presentations/slides/webservices/first.xml <slide title="Our First Webservice"> <example title="Go Landon! Go!" filename="first.php" result="1"/> </slide> Index: presentations/slides/webservices/googleapi.php +++ presentations/slides/webservices/googleapi.php <?php require_once('SOAP/Client.php'); $key = 'cSlFdvpQFHIiGEpLTO2YzQq55k1G4519'; $query = '"Sterling Hughes"'; $wsdlurl = 'GoogleSearch.wsdl'; $WSDL = new SOAP_WSDL($wsdlurl); $client = $WSDL->getProxy(); $response = $client->doGoogleSearch($key, $query, 0, 10, false, '', false, '', '', ''); foreach ($response->resultElements as $result) { echo str_repeat(' ', 40); strip_html($result->title); echo "{$result->title}\n"; echo str_repeat(' ', 40); echo "({$result->URL})\n"; echo "\n"; strip_html($result->snippet); echo $result->snippet; echo "\n\n"; } function strip_html(&$text) { $text = preg_replace('/<.*?>/', '', $text); } ?> Index: presentations/slides/webservices/titlepage.xml +++ presentations/slides/webservices/titlepage.xml <slide fontsize="3.5em"> <title>Welcome!</title> <blurb> </blurb> <blurb align="center" fontsize="6.0em">Webservices with PHP</blurb> <blurb align="center" fontsize="4.0em">O'Reilly Open Source Convention</blurb> <blurb align="center">July 8, 2003</blurb> <link align="center" leader="Sterling Hughes, " href="sterling@php.net"/> </slide>
Index: presentations/slides/webservices/CarRentalQuotes.wsdl +++ presentations/slides/webservices/CarRentalQuotes.wsdl <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns1="http://SBGCarRentalService.sbg.travel.ws.dsdata.co.uk" xmlns:intf="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:impl="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk" xmlns="http://schemas.xmlsoap.org/wsdl/"><wsdl:types><schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://SBGCarRentalService.sbg.travel.ws.dsdata.co.uk"><import namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType name="CarRentalQuoteResponse"><sequence><element name="request" nillable="true" type="tns1:CarRentalQuoteRequest"/><element name="companyName" nillable="true" type="xsd:string"/><element name="rate" type="xsd:float"/><element name="currency" nillable="true" type="xsd:string"/><element name="carType" nillable="true" type="xsd:string"/><element name="mileage" nillable="true" type="xsd:string"/><element name="tax" nillable="true" type="xsd:string"/><element name="roadTax" nillable="true" type="xsd:string"/><element name="surcharges" nillable="true" type="xsd:string"/><element name="cDW" nillable="true" type="xsd:string"/><element name="pAI" nillable="true" type="xsd:string"/><element name="errorOccurred" type="xsd:boolean"/><element name="scrapeError" type="xsd:boolean"/><element name="errorMessage" nillable="true" type="xsd:string"/></sequence></complexType><complexType name="CarRentalQuoteRequest"><sequence><element name="companyName" nillable="true" type="xsd:string"/><element name="carType" nillable="true" type="xsd:string"/><element name="pickupLocation" nillable="true" type="xsd:string"/><element name="pickupDate" nillable="true" type="xsd:dateTime"/><element name="returnLocation" nillable="true" type="xsd:string"/><element name="returnDate" nillable="true" type="xsd:dateTime"/><element name="country" nillable="true" type="xsd:string"/><element name="currency" nillable="true" type="xsd:string"/></sequence></complexType></schema><schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"><import namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType name="ArrayOf_tns2_CarRentalQuoteResponse"><complexContent><restriction base="soapenc:Array"><attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:CarRentalQuoteResponse[]"/></restriction></complexContent></complexType><element name="ArrayOf_tns2_CarRentalQuoteResponse" nillable="true" type="impl:ArrayOf_tns2_CarRentalQuoteResponse"/><complexType name="ArrayOf_xsd_string"><complexContent><restriction base="soapenc:Array"><attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/></restriction></complexContent></complexType><element name="ArrayOf_xsd_string" nillable="true" type="impl:ArrayOf_xsd_string"/></schema></wsdl:types> <wsdl:message name="getCurrenciesRequest"> </wsdl:message> <wsdl:message name="getLocationsResponse"> <wsdl:part name="getLocationsReturn" type="intf:ArrayOf_xsd_string"/> </wsdl:message> <wsdl:message name="getQuotesResponse"> <wsdl:part name="getQuotesReturn" type="intf:ArrayOf_tns2_CarRentalQuoteResponse"/> </wsdl:message> <wsdl:message name="getCountriesResponse"> <wsdl:part name="getCountriesReturn" type="intf:ArrayOf_xsd_string"/> </wsdl:message> <wsdl:message name="getCarTypesResponse"> <wsdl:part name="getCarTypesReturn" type="intf:ArrayOf_xsd_string"/> </wsdl:message> <wsdl:message name="getQuotesRequest"> <wsdl:part name="carType" type="xsd:string"/> <wsdl:part name="country" type="xsd:string"/> <wsdl:part name="currency" type="xsd:string"/> <wsdl:part name="pickupDate" type="xsd:dateTime"/> <wsdl:part name="pickupLocation" type="xsd:string"/> <wsdl:part name="returnDate" type="xsd:dateTime"/> <wsdl:part name="returnLocation" type="xsd:string"/> <wsdl:part name="clientID" type="xsd:string"/> <wsdl:part name="userEmail" type="xsd:string"/> </wsdl:message> <wsdl:message name="getCountriesRequest"> </wsdl:message> <wsdl:message name="getCurrenciesResponse"> <wsdl:part name="getCurrenciesReturn" type="intf:ArrayOf_xsd_string"/> </wsdl:message> <wsdl:message name="getLocationsRequest"> <wsdl:part name="country" type="xsd:string"/> </wsdl:message> <wsdl:message name="getCarTypesRequest"> </wsdl:message> <wsdl:portType name="CarRentalQuotes"> <wsdl:operation name="getQuotes" parameterOrder="carType country currency pickupDate pickupLocation returnDate returnLocation clientID userEmail"> <wsdl:input name="getQuotesRequest" message="intf:getQuotesRequest"/> <wsdl:output name="getQuotesResponse" message="intf:getQuotesResponse"/> </wsdl:operation> <wsdl:operation name="getCountries"> <wsdl:input name="getCountriesRequest" message="intf:getCountriesRequest"/> <wsdl:output name="getCountriesResponse" message="intf:getCountriesResponse"/> </wsdl:operation> <wsdl:operation name="getLocations" parameterOrder="country"> <wsdl:input name="getLocationsRequest" message="intf:getLocationsRequest"/> <wsdl:output name="getLocationsResponse" message="intf:getLocationsResponse"/> </wsdl:operation> <wsdl:operation name="getCurrencies"> <wsdl:input name="getCurrenciesRequest" message="intf:getCurrenciesRequest"/> <wsdl:output name="getCurrenciesResponse" message="intf:getCurrenciesResponse"/> </wsdl:operation> <wsdl:operation name="getCarTypes"> <wsdl:input name="getCarTypesRequest" message="intf:getCarTypesRequest"/> <wsdl:output name="getCarTypesResponse" message="intf:getCarTypesResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="CarRentalQuotesSoapBinding" type="intf:CarRentalQuotes"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="getQuotes"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="getQuotesRequest"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:input> <wsdl:output name="getQuotesResponse"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="getCountries"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="getCountriesRequest"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:input> <wsdl:output name="getCountriesResponse"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="getLocations"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="getLocationsRequest"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:input> <wsdl:output name="getLocationsResponse"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="getCurrencies"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="getCurrenciesRequest"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:input> <wsdl:output name="getCurrenciesResponse"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="getCarTypes"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="getCarTypesRequest"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:input> <wsdl:output name="getCarTypesResponse"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SBGCarRentalQuotes.sbg.travel.ws.dsdata.co.uk"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="CarRentalQuotesService"> <wsdl:port name="CarRentalQuotes" binding="intf:CarRentalQuotesSoapBinding"> <wsdlsoap:address location="http://wavendon.dsdata.co.uk/axis/services/CarRentalQuotes"/> </wsdl:port> </wsdl:service> </wsdl:definitions> Index: presentations/slides/webservices/GoogleSearch.wsdl +++ presentations/slides/webservices/GoogleSearch.wsdl <?xml version="1.0"?> <!-- WSDL description of the Google Web APIs. The Google Web APIs are in beta release. All interfaces are subject to change as we refine and extend our APIs. Please see the terms of use for more information. --> <!-- Revision 2002-08-16 --> <definitions name="GoogleSearch" targetNamespace="urn:GoogleSearch" xmlns:typens="urn:GoogleSearch" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <!-- Types for search - result elements, directory categories --> <types> <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:GoogleSearch"> <xsd:complexType name="GoogleSearchResult"> <xsd:all> <xsd:element name="documentFiltering" type="xsd:boolean"/> <xsd:element name="searchComments" type="xsd:string"/> <xsd:element name="estimatedTotalResultsCount" type="xsd:int"/> <xsd:element name="estimateIsExact" type="xsd:boolean"/> <xsd:element name="resultElements" type="typens:ResultElementArray"/> <xsd:element name="searchQuery" type="xsd:string"/> <xsd:element name="startIndex" type="xsd:int"/> <xsd:element name="endIndex" type="xsd:int"/> <xsd:element name="searchTips" type="xsd:string"/> <xsd:element name="directoryCategories" type="typens:DirectoryCategoryArray"/> <xsd:element name="searchTime" type="xsd:double"/> </xsd:all> </xsd:complexType> <xsd:complexType name="ResultElement"> <xsd:all> <xsd:element name="summary" type="xsd:string"/> <xsd:element name="URL" type="xsd:string"/> <xsd:element name="snippet" type="xsd:string"/> <xsd:element name="title" type="xsd:string"/> <xsd:element name="cachedSize" type="xsd:string"/> <xsd:element name="relatedInformationPresent" type="xsd:boolean"/> <xsd:element name="hostName" type="xsd:string"/> <xsd:element name="directoryCategory" type="typens:DirectoryCategory"/> <xsd:element name="directoryTitle" type="xsd:string"/> </xsd:all> </xsd:complexType> <xsd:complexType name="ResultElementArray"> <xsd:complexContent> <xsd:restriction base="soapenc:Array"> <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:ResultElement[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="DirectoryCategoryArray"> <xsd:complexContent> <xsd:restriction base="soapenc:Array"> <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:DirectoryCategory[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="DirectoryCategory"> <xsd:all> <xsd:element name="fullViewableName" type="xsd:string"/> <xsd:element name="specialEncoding" type="xsd:string"/> </xsd:all> </xsd:complexType> </xsd:schema> </types> <!-- Messages for Google Web APIs - cached page, search, spelling. --> <message name="doGetCachedPage"> <part name="key" type="xsd:string"/> <part name="url" type="xsd:string"/> </message> <message name="doGetCachedPageResponse"> <part name="return" type="xsd:base64Binary"/> </message> <message name="doSpellingSuggestion"> <part name="key" type="xsd:string"/> <part name="phrase" type="xsd:string"/> </message> <message name="doSpellingSuggestionResponse"> <part name="return" type="xsd:string"/> </message> <!-- note, ie and oe are ignored by server; all traffic is UTF-8. --> <message name="doGoogleSearch"> <part name="key" type="xsd:string"/> <part name="q" type="xsd:string"/> <part name="start" type="xsd:int"/> <part name="maxResults" type="xsd:int"/> <part name="filter" type="xsd:boolean"/> <part name="restrict" type="xsd:string"/> <part name="safeSearch" type="xsd:boolean"/> <part name="lr" type="xsd:string"/> <part name="ie" type="xsd:string"/> <part name="oe" type="xsd:string"/> </message> <message name="doGoogleSearchResponse"> <part name="return" type="typens:GoogleSearchResult"/> </message> <!-- Port for Google Web APIs, "GoogleSearch" --> <portType name="GoogleSearchPort"> <operation name="doGetCachedPage"> <input message="typens:doGetCachedPage"/> <output message="typens:doGetCachedPageResponse"/> </operation> <operation name="doSpellingSuggestion"> <input message="typens:doSpellingSuggestion"/> <output message="typens:doSpellingSuggestionResponse"/> </operation> <operation name="doGoogleSearch"> <input message="typens:doGoogleSearch"/> <output message="typens:doGoogleSearchResponse"/> </operation> </portType> <!-- Binding for Google Web APIs - RPC, SOAP over HTTP --> <binding name="GoogleSearchBinding" type="typens:GoogleSearchPort"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="doGetCachedPage"> <soap:operation soapAction="urn:GoogleSearchAction"/> <input> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> <operation name="doSpellingSuggestion"> <soap:operation soapAction="urn:GoogleSearchAction"/> <input> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> <operation name="doGoogleSearch"> <soap:operation soapAction="urn:GoogleSearchAction"/> <input> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> <!-- Endpoint for Google Web APIs --> <service name="GoogleSearchService"> <port name="GoogleSearchPort" binding="typens:GoogleSearchBinding"> <soap:address location="http://api.google.com/search/beta2"/> </port> </service> </definitions> Index: presentations/slides/webservices/about.xml +++ presentations/slides/webservices/about.xml <slide title="What are Webservices?"> <blurb align="center" fontsize="4.0em" textcolor="red">Double, double; toil and trouble;</blurb> <blurb align="center" fontsize="4.0em" textcolor="red">Fire burn and cauldron bubble.</blurb> <image align="center" filename="weirdsisters.jpg"/> </slide> Index: presentations/slides/webservices/about1.xml +++ presentations/slides/webservices/about1.xml <slide title="What are Webservices?"> <image align="right" filename="weirdsisters-small.jpg"/> <break lines="5"/> <blurb fontsize="4.5em"> Computer communication over the web (HTTP). </blurb> <list fontsize="4.0em"> <bullet>SOAP</bullet> <bullet>XML-RPC</bullet> <bullet>HTTP</bullet> <bullet>REST</bullet> </list> </slide> Index: presentations/slides/webservices/carcode.php +++ presentations/slides/webservices/carcode.php <?php require_once('SOAP/Client.php'); $wsdl = new SOAP_WSDL('CarRentalQuotes.wsdl'); echo $wsdl->generateProxyCode(); ?> Index: presentations/slides/webservices/first.php +++ presentations/slides/webservices/first.php <?php $TEXT = <<<MB Be bloody, bold, and resolute; laugh to scorn The power of man, for none of woman born Shall harm Macbeth. MB; $URL = 'http://landonize.it/index.php?' . 'filter=Landon&' . 'how=text&' . 'method=plain&' . 'text=' . urlencode(nl2br($TEXT)); echo file_get_contents($URL); ?> Index: presentations/slides/webservices/first.xml +++ presentations/slides/webservices/first.xml <slide title="Our First Webservice"> <example title="Go Landon! Go!" filename="first.php" result="1"/> </slide> Index: presentations/slides/webservices/googleapi.php +++ presentations/slides/webservices/googleapi.php <?php require_once('SOAP/Client.php'); $key = 'cSlFdvpQFHIiGEpLTO2YzQq55k1G4519'; $query = '"Sterling Hughes"'; $wsdlurl = 'GoogleSearch.wsdl'; $WSDL = new SOAP_WSDL($wsdlurl); $client = $WSDL->getProxy(); $response = $client->doGoogleSearch($key, $query, 0, 10, false, '', false, '', '', ''); foreach ($response->resultElements as $result) { echo str_repeat(' ', 40); strip_html($result->title); echo "{$result->title}\n"; echo str_repeat(' ', 40); echo "({$result->URL})\n"; echo "\n"; strip_html($result->snippet); echo $result->snippet; echo "\n\n"; } function strip_html(&$text) { $text = preg_replace('/<.*?>/', '', $text); } ?> Index: presentations/slides/webservices/titlepage.xml +++ presentations/slides/webservices/titlepage.xml <slide fontsize="3.5em"> <title>Welcome!</title> <blurb> </blurb> <blurb align="center" fontsize="6.0em">Webservices with PHP</blurb> <blurb align="center" fontsize="4.0em">O'Reilly Open Source Convention</blurb> <blurb align="center">July 8, 2003</blurb> <link align="center" leader="Sterling Hughes, " href="sterling@php.net"/> </slide>