class SOAP::RPC::HTTPServer

Attributes

default_namespace[RW]
server[R]

Public Class Methods

new(config) click to toggle source
Calls superclass method
# File lib/soap/rpc/httpserver.rb, line 33
def initialize(config)
  actor = config[:SOAPHTTPServerApplicationName] || self.class.name
  super(actor)
  @default_namespace = config[:SOAPDefaultNamespace]
  @webrick_config = config.dup
  self.level = Logger::Severity::ERROR # keep silent by default
  @webrick_config[:Logger] ||= @log
  @log = @webrick_config[:Logger]     # sync logger of App and HTTPServer
  @router = ::SOAP::RPC::Router.new(actor)
  @soaplet = ::SOAP::RPC::SOAPlet.new(@router)
  on_init

  @server = WEBrick::HTTPServer.new(@webrick_config)
  @server.mount('/soaprouter', @soaplet)
  if wsdldir = config[:WSDLDocumentDirectory]
    @server.mount('/wsdl', WEBrick::HTTPServlet::FileHandler, wsdldir)
  end
  @server.mount('/', @soaplet)
end

Public Instance Methods

add_document_method(obj, soapaction, name, req_qnames, res_qnames) click to toggle source
# File lib/soap/rpc/httpserver.rb, line 117
def add_document_method(obj, soapaction, name, req_qnames, res_qnames)
  param_def = SOAPMethod.create_doc_param_def(req_qnames, res_qnames)
  @router.add_document_operation(obj, soapaction, name, param_def)
end
add_document_operation(receiver, soapaction, name, param_def, opt = {}) click to toggle source
# File lib/soap/rpc/httpserver.rb, line 130
def add_document_operation(receiver, soapaction, name, param_def, opt = {})
  @router.add_document_operation(receiver, soapaction, name, param_def, opt)
end
add_document_request_operation(factory, soapaction, name, param_def, opt = {}) click to toggle source
# File lib/soap/rpc/httpserver.rb, line 134
def add_document_request_operation(factory, soapaction, name, param_def, opt = {})
  @router.add_document_request_operation(factory, soapaction, name, param_def, opt)
end
add_headerhandler(obj) click to toggle source
# File lib/soap/rpc/httpserver.rb, line 93
def add_headerhandler(obj)
  @router.add_headerhandler(obj)
end
Also aliased as: add_rpc_headerhandler
add_method(obj, name, *param)
Alias for: add_rpc_method
add_method_as(obj, name, name_as, *param)
Alias for: add_rpc_method_as
add_request_headerhandler(factory) click to toggle source
# File lib/soap/rpc/httpserver.rb, line 89
def add_request_headerhandler(factory)
  @router.add_request_headerhandler(factory)
end
add_rpc_headerhandler(obj)
Alias for: add_headerhandler
add_rpc_method(obj, name, *param) click to toggle source

method entry interface

# File lib/soap/rpc/httpserver.rb, line 104
def add_rpc_method(obj, name, *param)
  add_rpc_method_as(obj, name, name, *param)
end
Also aliased as: add_method
add_rpc_method_as(obj, name, name_as, *param) click to toggle source
# File lib/soap/rpc/httpserver.rb, line 109
def add_rpc_method_as(obj, name, name_as, *param)
  qname = XSD::QName.new(@default_namespace, name_as)
  soapaction = nil
  param_def = SOAPMethod.derive_rpc_param_def(obj, name, *param)
  @router.add_rpc_operation(obj, qname, soapaction, name, param_def)
end
Also aliased as: add_method_as
add_rpc_operation(receiver, qname, soapaction, name, param_def, opt = {}) click to toggle source
# File lib/soap/rpc/httpserver.rb, line 122
def add_rpc_operation(receiver, qname, soapaction, name, param_def, opt = {})
  @router.add_rpc_operation(receiver, qname, soapaction, name, param_def, opt)
end
add_rpc_request_operation(factory, qname, soapaction, name, param_def, opt = {}) click to toggle source
# File lib/soap/rpc/httpserver.rb, line 126
def add_rpc_request_operation(factory, qname, soapaction, name, param_def, opt = {})
  @router.add_rpc_request_operation(factory, qname, soapaction, name, param_def, opt)
end
add_rpc_request_servant(factory, namespace = @default_namespace) click to toggle source

servant entry interface

# File lib/soap/rpc/httpserver.rb, line 81
def add_rpc_request_servant(factory, namespace = @default_namespace)
  @router.add_rpc_request_servant(factory, namespace)
end
add_rpc_servant(obj, namespace = @default_namespace) click to toggle source
# File lib/soap/rpc/httpserver.rb, line 85
def add_rpc_servant(obj, namespace = @default_namespace)
  @router.add_rpc_servant(obj, namespace)
end
authenticator() click to toggle source
# File lib/soap/rpc/httpserver.rb, line 71
def authenticator
  @soaplet.authenticator
end
authenticator=(authenticator) click to toggle source
# File lib/soap/rpc/httpserver.rb, line 75
def authenticator=(authenticator)
  @soaplet.authenticator = authenticator
end
filterchain() click to toggle source
# File lib/soap/rpc/httpserver.rb, line 98
def filterchain
  @router.filterchain
end
on_init() click to toggle source
# File lib/soap/rpc/httpserver.rb, line 53
def on_init
  # do extra initialization in a derived class if needed.
end
shutdown() click to toggle source
# File lib/soap/rpc/httpserver.rb, line 61
def shutdown
  if @server
    @server.shutdown
    while (@server.listeners.length > 0) && (@server.tokens.length > 0) && (@server.status != :Stop) 
      sleep(0.25)
    end
    sleep(0.25) # One more for good measure.
  end
end
status() click to toggle source
# File lib/soap/rpc/httpserver.rb, line 57
def status
  @server.status if @server
end

Private Instance Methods

attrproxy() click to toggle source
# File lib/soap/rpc/httpserver.rb, line 140
def attrproxy
  @router
end
run() click to toggle source
# File lib/soap/rpc/httpserver.rb, line 144
def run
  @server.start
end