SOAP: Difference between revisions
Content added Content deleted
(→Tcl: Added implementation) |
(→Tcl: Correct to actually perform the official task: oops!) |
||
Line 69: | Line 69: | ||
<lang Tcl>package require WS::Client |
<lang Tcl>package require WS::Client |
||
# Grok the service |
# Grok the service, and generate stubs |
||
::WS::Client::GetAndParseWsdl http:// |
::WS::Client::GetAndParseWsdl http://example.com/soap/wsdl |
||
::WS::Client::CreateStubs ExampleService ;# Assume that's the service name... |
|||
# |
# Do the calls |
||
set result1 [ExampleService::soapFunc "hello"] |
|||
dict set args key "<your google license key here>" |
|||
set result2 [ExampleService::anotherSoapFunc 34234]</lang> |
|||
dict set args q {site:tclscripting.com font} |
|||
dict set args start 0 |
|||
dict set args maxResults 10 |
|||
dict set args filter true |
|||
dict set args restrict {} |
|||
dict set args safeSearch false |
|||
dict set args lr {} |
|||
dict set args ie latin1 |
|||
dict set args oe latin1 |
|||
# Do the call using the direct synchronous interface |
|||
set result [::WS::Client::DoCall GoogleSearchService doGoogleSearch $args] |
|||
# Print the results |
|||
foreach item [dict get $result return resultElements item] { |
|||
puts [dict get $item title] |
|||
puts [dict get $item URL] |
|||
puts "" |
|||
}</lang> |
|||
=={{header|VBScript}}== |
=={{header|VBScript}}== |