What would a Two-Way Google Interface Look like? : a perfect world spoiled by reality



What would a Two-Way Google Interface Look like?

I got to thinking this afternoon about what a two way interface for Google would look like.  Below is just one possibility.

This introduces three new operations and a new WSDL portType.

The new operations are:

  • doGoogleNotify -- Used to notify Google that a URL has been updated and should be reindexed
  • doGoogleSubscribe -- Used to create a search subscription.  The user specifies the URL of a Web service where search results are delivered.  An expiration parameter tells google when to stop sending results.  As Google comes across sites that match the search parameters, it will deliver the results (delivered daily)
  • doGoogleUnsubscribe -- Used to explicitly delete a Google subscription.

The new PortType would be implemented by Google subscribers.  It would be used to receive the subscribed search results.

 

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions 
  name="urn:GoogleTwoWay"
  targetNamespace="urn:GoogleTwoWay"
  xmlns:tns="urn:GoogleTwoWay"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
 
  <types>
    <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" 
                targetNamespace="urn:GoogleTwoWay">
            
      <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="tns: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="tns: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="tns: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="tns: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="tns: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>
   
  <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>
  <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="tns:GoogleSearchResult"/>           
  </message>
  
  <message name="doGoogleNotify">
    <part name="URL"            type="xsd:anyURI"/>
  </message>
  
  <message name="doGoogleSubscribe">
    <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"/>
    <!-- the listener parameter points to a Web service that
         implements the GoogleSearchListener Port Type -->
    <part name="listener"       type="xsd:anyURI"/>
    <!-- indicates the date/time the subscription expires -->
    <part name="expires"        type="xsd:dateTime"/>
  </message>
  
  <message name="doGoogleSubscribeResponse">
    <part name="subscriptionID" type="xsd:string" />
  </message>
  
  <message name="doGoogleUnsubscribe">
    <part name="subscriptionID" type="xsd:string" />
  </message>
  <message name="deliverGoogleSearchResults">
    <part name="subscriptionID" type="xsd:string" />
    <part name="results"        type="tns:GoogleSearchResult"/>           
  </message>
  
  <!-- Google would implement this PortType -->
  <portType name="GoogleTwoWayPort">
    <operation name="doGetCachedPage">
      <input message="tns:doGetCachedPage"/>
      <output message="tns:doGetCachedPageResponse"/>
    </operation>
    <operation name="doSpellingSuggestion">
      <input message="tns:doSpellingSuggestion"/>
      <output message="tns:doSpellingSuggestionResponse"/>
    </operation>
    <operation name="doGoogleSearch">
      <input message="tns:doGoogleSearch"/>
      <output message="tns:doGoogleSearchResponse"/>
    </operation>    
    <operation name="doGoogleNotify">
      <input message="tns:doGoogleNotify"/>
    </operation>    
    <operation name="doGoogleSubscribe">
      <input message="tns:doGoogleSubscribe" />
      <output message="tns:doGoogleSubscribeResponse" />
    </operation>  
    <operation name="doGoogleUnsubscribe">
      <input message="tns:doGoogleUnsubscribe" />
    </operation>
  </portType>
  
  <!-- Google clients would implement this PortType to receive
       search results for their google subscriptions -->
  <portType name="GoogleSearchListener">
    <operation name="deliverGoogleSearchResults">
      <input message="tns:deliverGoogleSearchResults" />
    </operation>
  </portType>

<binding name="GoogleSearchBinding" type="tns:GoogleSearchPort"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="doGetCachedPage"> <soap:operation soapAction="urn:GoogleTwoWayAction"/> <input> <soap:body use="encoded" namespace="urn:GoogleTwoWay" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="urn:GoogleTwoWay" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> <operation name="doSpellingSuggestion"> <soap:operation soapAction="urn:GoogleTwoWayAction"/> <input> <soap:body use="encoded" namespace="urn:GoogleTwoWay" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="urn:GoogleTwoWay" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> <operation name="doGoogleSearch"> <soap:operation soapAction="urn:GoogleTwoWayAction"/> <input> <soap:body use="encoded" namespace="urn:GoogleTwoWay" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="urn:GoogleTwoWay" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> <operation name="doGoogleNotify"> <soap:operation soapAction="urn:GoogleTwoWayAction"/> <input> <soap:body use="encoded" namespace="urn:GoogleTwoWay" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> </operation> <operation name="doGoogleSubscribe"> <soap:operation soapAction="urn:GoogleTwoWayAction"/> <input> <soap:body use="encoded" namespace="urn:GoogleTwoWay" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="urn:GoogleTwoWay" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> <operation name="doGoogleUnsubscribe"> <soap:operation soapAction="urn:GoogleTwoWayAction"/> <input> <soap:body use="encoded" namespace="urn:GoogleTwoWay" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> </operation> </binding> <binding name="GoogleSearchListenerBinding" type="typens:GoogleSearchListener"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="deliverGoogleSearchResults"> <soap:operation soapAction="urn:GoogleSearchListenerAction"/> <input> <soap:body use="encoded" namespace="urn:GoogleTwoWay" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> </operation> </binding> </wsdl:definitions>


Copyright © 2002 James Snell.
Last update: 6/25/2002; 9:22:05 PM.