SOAP::RPC::Driver::Servant__ (Class)

In: soap/rpc/driver.rb
Parent: Object

Attributes

options  [R] 
proxy  [R] 
streamhandler  [R] 

Public Class methods

[Source]

# File soap/rpc/driver.rb, line 137
    def initialize(host, endpoint_url, namespace)
      @host = host
      @namespace = namespace
      @mapping_registry = nil
      @soapaction = nil
      @wiredump_file_base = nil
      @options = setup_options
      @streamhandler = HTTPPostStreamHandler.new(endpoint_url,
        @options["protocol.http"] ||= ::SOAP::Property.new)
      @proxy = Proxy.new(@streamhandler, @soapaction)
      @proxy.allow_unqualified_element = true
    end

Public Instance methods

[Source]

# File soap/rpc/driver.rb, line 212
    def add_method(name_as, soapaction, name, param_def)
      qname = XSD::QName.new(@namespace, name_as)
      @proxy.add_method(qname, soapaction, name, param_def)
      add_rpc_method_interface(name, param_def)
    end

[Source]

# File soap/rpc/driver.rb, line 218
    def add_rpc_method_interface(name, param_def)
      param_names = []
      i = 0
      @proxy.method[name].each_param_name(RPC::SOAPMethod::IN,
          RPC::SOAPMethod::INOUT) do |param_name|
        i += 1
        param_names << "arg#{ i }"
      end
      callparam = (param_names.collect { |pname| ", " + pname }).join
      @host.instance_eval "def \#{ name }(\#{ param_names.join(\", \") })\n@servant.call(\#{ name.dump }\#{ callparam })\nend\n"
    end

[Source]

# File soap/rpc/driver.rb, line 188
    def call(name, *params)
      set_wiredump_file_base(name)
      # Convert parameters: params array => SOAPArray => members array

      params = Mapping.obj2soap(params, @mapping_registry).to_a
      header, body = @proxy.call(nil, name, *params)
      raise EmptyResponseError.new("Empty response.") unless body
      begin
        @proxy.check_fault(body)
      rescue SOAP::FaultError => e
        Mapping.fault2exception(e)
      end

      ret = body.response ?

        Mapping.soap2obj(body.response, @mapping_registry) : nil
      if body.outparams
        outparams = body.outparams.collect { |outparam|
          Mapping.soap2obj(outparam)
        }
        return [ret].concat(outparams)
      else
        return ret
      end
    end

[Source]

# File soap/rpc/driver.rb, line 175
    def default_encodingstyle
      @proxy.default_encodingstyle
    end

[Source]

# File soap/rpc/driver.rb, line 179
    def default_encodingstyle=(encodingstyle)
      @proxy.default_encodingstyle = encodingstyle
    end

[Source]

# File soap/rpc/driver.rb, line 150
    def endpoint_url
      @streamhandler.endpoint_url
    end

[Source]

# File soap/rpc/driver.rb, line 154
    def endpoint_url=(endpoint_url)
      @streamhandler.endpoint_url = endpoint_url
      @streamhandler.reset
    end

[Source]

# File soap/rpc/driver.rb, line 183
    def invoke(headers, body)
      set_wiredump_file_base(body.elename.name)
      @proxy.invoke(headers, body)
    end

[Source]

# File soap/rpc/driver.rb, line 159
    def mapping_registry
      @mapping_registry
    end

[Source]

# File soap/rpc/driver.rb, line 163
    def mapping_registry=(mapping_registry)
      @mapping_registry = mapping_registry
    end

[Source]

# File soap/rpc/driver.rb, line 167
    def soapaction
      @soapaction
    end

[Source]

# File soap/rpc/driver.rb, line 171
    def soapaction=(soapaction)
      @soapaction = soapaction
    end

[Validate]