diff options
author | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-24 15:18:44 +0000 |
---|---|---|
committer | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-24 15:18:44 +0000 |
commit | db9445103c082a306ba085f7677da02ea94b8841 (patch) | |
tree | a311d59f031ae5def87f68be71ed1f58abadc031 /sample/wsdl/googleSearch/sampleClient.rb | |
parent | 8c2fb77787d1f20b4c19c9c52552856c339b86e9 (diff) | |
download | ruby-db9445103c082a306ba085f7677da02ea94b8841.tar.gz |
* lib/soap/* (29 files): SOAP4R added.
* lib/wsdl/* (42 files): WSDL4R added.
* lib/xsd/* (12 files): XSD4R added.
* test/soap/* (16 files): added.
* test/wsdl/* (2 files): added.
* test/xsd/* (3 files): added.
* sample/soap/* (27 files): added.
* sample/wsdl/* (13 files): added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/wsdl/googleSearch/sampleClient.rb')
-rw-r--r-- | sample/wsdl/googleSearch/sampleClient.rb | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/sample/wsdl/googleSearch/sampleClient.rb b/sample/wsdl/googleSearch/sampleClient.rb new file mode 100644 index 0000000000..38e7253ef5 --- /dev/null +++ b/sample/wsdl/googleSearch/sampleClient.rb @@ -0,0 +1,56 @@ +#!/usr/bin/env ruby + +# This file is a sample based on GoogleSearchClient.rb, which can be +# generated by WSDL file and wsdl2ruby.rb. +# +# $ wsdl2ruby.rb --type client --force \ +# --wsdl http://api.google.com/GoogleSearch.wsdl +# +# See wsdlDriver.rb to use WSDL file directly (slow). +require 'GoogleSearchDriver.rb' + +endpoint_url = ARGV.shift +obj = GoogleSearchPort.new(endpoint_url) + +# Uncomment the below line to see SOAP wiredumps. +# obj.wiredump_dev = STDERR + +# SYNOPSIS +# doGoogleSearch(key, q, start, maxResults, filter, restrict, safeSearch, lr, ie, oe) +# +# ARGS +# key - {http://www.w3.org/2001/XMLSchema}string +# q - {http://www.w3.org/2001/XMLSchema}string +# start - {http://www.w3.org/2001/XMLSchema}int +# maxResults - {http://www.w3.org/2001/XMLSchema}int +# filter - {http://www.w3.org/2001/XMLSchema}boolean +# restrict - {http://www.w3.org/2001/XMLSchema}string +# safeSearch - {http://www.w3.org/2001/XMLSchema}boolean +# lr - {http://www.w3.org/2001/XMLSchema}string +# ie - {http://www.w3.org/2001/XMLSchema}string +# oe - {http://www.w3.org/2001/XMLSchema}string +# +# RETURNS +# return GoogleSearchResult - {urn:GoogleSearch}GoogleSearchResult +# +# RAISES +# N/A +# +key = q = start = maxResults = filter = restrict = safeSearch = lr = ie = oe = nil +key = File.open(File.expand_path("~/.google_key")).read.chomp +q = "Ruby" +start = 0 +maxResults = 10 +filter = false +restrict = "" +safeSearch = false +lr = "" +ie = "utf-8" +oe = "utf-8" +result = obj.doGoogleSearch(key, q, start, maxResults, filter, restrict, safeSearch, lr, ie, oe) + +result.resultElements.each do |ele| + puts "== #{ele.title}: #{ele.URL}" + puts ele.snippet + puts +end |