Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Ticket #141 (closed enhancement: fixed)

Opened 3 years ago

Last modified 9 months ago

SOAP::RPC::Driver#defined_webservice? SOAP::WSDLDriverFactory#defined_methods?

Reported by: nahi Assigned to: nahi
Priority: normal Milestone: 1.5.8
Component: soap4r Version: 1.5
Keywords: Cc:

Description

instead of; (driver.methods - Kernel.methods).sort

Change History

09/12/05 20:54:33 changed by nahi

  • type changed from defect to enhancement.
  • milestone changed from 1.5.5 to undefined.

02/05/06 21:28:48 changed by nahi

  • priority changed from normal to high.

(from ruby-talk)

hello all I'm using the following to get a driver to call to some
functions.

require 'soap/wsdlDriver'
wsdl = "http://localhost:8100/user/wsdl"
@drv = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver

works great,  but now I want a simple list of methods, paramaters and
return values

i can get the available methods with

@drv.singleton_methods

but how do i get to see the return values and parameters per method in
an easy way?

thanks

bd

07/19/06 22:36:46 changed by nahi

Oh, and I also think it would be a great feature to be able to get
meta data about the remote methods. I have been working on this, be
not fully done yet. What I mean is something like this:

driver = SOAP::WSDLDriverFactory.new(WSDL_URL).create_rpc_driver
driver.ws_methods
=> ['doGoogleSearch', 'doSpellingSuggestion']
driver.doGoogleSearch_help
SYNOPSIS
  doGoogleSearch(key, q, start, maxResults, filter, restrict,
safeSearch, lr, ie, oe)

ARGS
  key             String - {http://www.w3.org/2001/XMLSchema}string
  q               String - {http://www.w3.org/2001/XMLSchema}string
  start           Int - {http://www.w3.org/2001/XMLSchema}int
  maxResults      Int - {http://www.w3.org/2001/XMLSchema}int
  filter          Boolean - {http://www.w3.org/2001/XMLSchema}boolean
  restrict        String - {http://www.w3.org/2001/XMLSchema}string
  safeSearch      Boolean - {http://www.w3.org/2001/XMLSchema}boolean
  lr              String - {http://www.w3.org/2001/XMLSchema}string
  ie              String - {http://www.w3.org/2001/XMLSchema}string
  oe              String - {http://www.w3.org/2001/XMLSchema}string

RETURNS
  v_return        GoogleSearchResult - {urn:GoogleSearch}GoogleSearchResult

result = driver.getScores(key, 'hello world', 0, 10, false, '', false, '', 'utf-8', 'utf-8')
result.ws_properties
=>['resultElements']


and so forth...it should help to learn about a webservice more easily,
through the use of the interactive shell.

07/31/07 23:57:27 changed by nahi

  • priority changed from high to normal.
  • severity changed from normal to minor.
  • milestone changed from undefined to 1.5.8.

07/31/07 23:57:55 changed by nahi

from soap4r-ml

So here's what I've come up with in order to get the parameter names
and types from a given wsdl:

require 'soap/wsdlDriver'
wsdlloc = "http://mysite.com/api.wsdl"
wsdl = WSDL::Importer.import(wsdlloc)
methoddefcreator = WSDL::SOAP::MethodDefCreator.new(wsdl, nil)
service = wsdl.services[0]
port = service.ports.find { |port| !port.soap_address.nil? }
param_def =
methoddefcreator.collect_rpcparameter(port.find_binding.operations[0].find_operation)

You can then do param_def.each to get each parameter and it's type.

There must be an easier way to do this. Isn't the whole point of a
WSDL to allow applications the ability to access new methods as they
are created? If so, shouldn't discovering the required types of said
methods be easier?

08/19/07 00:50:44 changed by nahi

  • summary changed from SOAP::RPC::Driver#defined_webservice ? to SOAP::RPC::Driver#defined_webservice? SOAP::WSDLDriverFactory#defined_methods?.

08/26/07 00:30:16 changed by nahi

  • status changed from new to closed.
  • resolution set to fixed.

(In [1922]) * added SOAP::WSDLDriverFactory#dump_method_signatures. it returns a formatted text which describes method signatures. closes #141.