Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Google + SOAP

From: dockimbel:free at: 23-Apr-2002 11:35

Here's how web services could be supported by REBOL : * code example : service: open soap://api-ab.google.com/search/beta2/GoogleSearchService res: insert service [ doGoogleSearch [ key: #00000000000000000000000000000000 q: "shrdlu winograd maclisp teletype" start: 0 maxResults: 10 filter: true restrict: none safeSearch: false lr: none ie: 'latin1 oe: 'latin1 ]] close service * Of course a short 'read call should also be possible : res: read soap://api-ab.google.com/search/beta2/GoogleSearchService [ doGoogleSearch [ key: #00000000000000000000000000000000 q: "shrdlu winograd maclisp teletype" start: 0 maxResults: 10 filter: true restrict: none safeSearch: false lr: none ie: 'latin1 oe: 'latin1 ] ] I like this one a lot! :-) * all XML stuff should be kept hidden in the 'soap scheme. * on opening the 'soap port, port/locals will be loaded with all available methods found in the WSDL file. The functions "spec" could be stored like this :
>> probe service/locals
[ doGoogleSearch [ key string! q string! start integer! maxResults integer! filter logic! restrict string! safeSearch logic! lr string! ie string! oe string! ] doGetCachedPage [...] doGetSpellingSuggestion [...] ] or if you prefer : [ Do-Google-Search [...] Do-Get-Cached-Page [...] Do-Get-Spelling-Suggestion [...] ] Maybe we could also use 'help to pretty print these infos. (>> help service) * The 'soap scheme should also take care of arguments conversion. For example : key: #000... => string! => "000..." restrict: none => string! => "" * if you want a wrapping func in the global context, just do : Do-Google-Search: func [data [block!]][ read soap://api-ab.google.com/search/beta2/GoogleSearchService reduce ['doGoogleSearch data] ] My 0,02eu... -DocKimbel. Carl Sassenrath wrote: