class Bio::SOAPWSDL
Examples¶ ↑
class API < Bio::SOAPWSDL
def initialize @wsdl = 'http://example.com/example.wsdl' @log = File.new("soap_log", 'w') create_driver end
end
Use HTTP proxy¶ ↑
You need to set following two environmental variables (case might be insensitive) as required by SOAP4R.
— soap_use_proxy
Set the value of this variable to 'on'.
— http_proxy
Set the URL of your proxy server (myproxy.com:8080 etc.).
Example to use HTTP proxy¶ ↑
% export soap_use_proxy=on % export http_proxy=localhost:8080
Attributes
Returns current logging IO.
Returns URL of the current WSDL file.
Public Class Methods
# File lib/bio/io/soapwsdl.rb, line 54 def initialize(wsdl = nil) @wsdl = wsdl @log = nil create_driver end
Public Instance Methods
List of methods defined by WSDL
# File lib/bio/io/soapwsdl.rb, line 106 def list_methods @driver.methods(false) end
Change the IO for logging. The argument is passed to wiredump_dev method of the SOAP4R, thus
serv = Bio::SOAPWSDL.new serv.log = STDERR
will print all the SOAP transactions in standard error. This feature is especially useful for debug.
# File lib/bio/io/soapwsdl.rb, line 99 def log=(io) @log = io @driver.wiredump_dev = @log end
Change the URL for WSDL file
serv = Bio::SOAPWSDL.new("http://soap.genome.jp/KEGG.wsdl")
or
serv = Bio::SOAPWSDL.new serv.wsdl = "http://soap.genome.jp/KEGG.wsdl"
Note that you can't read two or more different WSDL files at once. In that case, create Bio::SOAPWSDL object for each.
# File lib/bio/io/soapwsdl.rb, line 84 def wsdl=(url) @wsdl = url create_driver end
Private Instance Methods
# File lib/bio/io/soapwsdl.rb, line 61 def create_driver if RUBY_VERSION > "1.8.2" @driver = SOAP::WSDLDriverFactory.new(@wsdl).create_rpc_driver else @driver = SOAP::WSDLDriverFactory.new(@wsdl).create_driver end @driver.generate_explicit_type = true # Ruby obj <-> SOAP obj end
# File lib/bio/io/soapwsdl.rb, line 111 def method_missing(*arg) @driver.send(*arg) end