Class: SOAP::RPC::HTTPServer
- Includes:
- AttrProxy
- Defined in:
- lib/soap/rpc/httpserver.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#default_namespace ⇒ Object
Returns the value of attribute default_namespace.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Instance Method Summary collapse
- #add_document_method(obj, soapaction, name, req_qnames, res_qnames) ⇒ Object
- #add_document_operation(receiver, soapaction, name, param_def, opt = {}) ⇒ Object
- #add_document_request_operation(factory, soapaction, name, param_def, opt = {}) ⇒ Object
- #add_headerhandler(obj) ⇒ Object (also: #add_rpc_headerhandler)
- #add_request_headerhandler(factory) ⇒ Object
-
#add_rpc_method(obj, name, *param) ⇒ Object
(also: #add_method)
method entry interface.
- #add_rpc_method_as(obj, name, name_as, *param) ⇒ Object (also: #add_method_as)
- #add_rpc_operation(receiver, qname, soapaction, name, param_def, opt = {}) ⇒ Object
- #add_rpc_request_operation(factory, qname, soapaction, name, param_def, opt = {}) ⇒ Object
-
#add_rpc_request_servant(factory, namespace = @default_namespace) ⇒ Object
servant entry interface.
- #add_rpc_servant(obj, namespace = @default_namespace) ⇒ Object
- #authenticator ⇒ Object
- #authenticator=(authenticator) ⇒ Object
- #filterchain ⇒ Object
-
#initialize(config) ⇒ HTTPServer
constructor
A new instance of HTTPServer.
- #on_init ⇒ Object
- #shutdown ⇒ Object
- #status ⇒ Object
Methods included from AttrProxy
Constructor Details
#initialize(config) ⇒ HTTPServer
Returns a new instance of HTTPServer.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# 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 |
Instance Attribute Details
#default_namespace ⇒ Object
Returns the value of attribute default_namespace.
26 27 28 |
# File 'lib/soap/rpc/httpserver.rb', line 26 def default_namespace @default_namespace end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
25 26 27 |
# File 'lib/soap/rpc/httpserver.rb', line 25 def server @server end |
Instance Method Details
#add_document_method(obj, soapaction, name, req_qnames, res_qnames) ⇒ Object
110 111 112 113 |
# File 'lib/soap/rpc/httpserver.rb', line 110 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 = {}) ⇒ Object
123 124 125 |
# File 'lib/soap/rpc/httpserver.rb', line 123 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 = {}) ⇒ Object
127 128 129 |
# File 'lib/soap/rpc/httpserver.rb', line 127 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) ⇒ Object Also known as: add_rpc_headerhandler
86 87 88 |
# File 'lib/soap/rpc/httpserver.rb', line 86 def add_headerhandler(obj) @router.add_headerhandler(obj) end |
#add_request_headerhandler(factory) ⇒ Object
82 83 84 |
# File 'lib/soap/rpc/httpserver.rb', line 82 def add_request_headerhandler(factory) @router.add_request_headerhandler(factory) end |
#add_rpc_method(obj, name, *param) ⇒ Object Also known as: add_method
method entry interface
97 98 99 |
# File 'lib/soap/rpc/httpserver.rb', line 97 def add_rpc_method(obj, name, *param) add_rpc_method_as(obj, name, name, *param) end |
#add_rpc_method_as(obj, name, name_as, *param) ⇒ Object Also known as: add_method_as
102 103 104 105 106 107 |
# File 'lib/soap/rpc/httpserver.rb', line 102 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 |
#add_rpc_operation(receiver, qname, soapaction, name, param_def, opt = {}) ⇒ Object
115 116 117 |
# File 'lib/soap/rpc/httpserver.rb', line 115 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 = {}) ⇒ Object
119 120 121 |
# File 'lib/soap/rpc/httpserver.rb', line 119 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) ⇒ Object
servant entry interface
74 75 76 |
# File 'lib/soap/rpc/httpserver.rb', line 74 def add_rpc_request_servant(factory, namespace = @default_namespace) @router.add_rpc_request_servant(factory, namespace) end |
#add_rpc_servant(obj, namespace = @default_namespace) ⇒ Object
78 79 80 |
# File 'lib/soap/rpc/httpserver.rb', line 78 def add_rpc_servant(obj, namespace = @default_namespace) @router.add_rpc_servant(obj, namespace) end |
#authenticator ⇒ Object
64 65 66 |
# File 'lib/soap/rpc/httpserver.rb', line 64 def authenticator @soaplet.authenticator end |
#authenticator=(authenticator) ⇒ Object
68 69 70 |
# File 'lib/soap/rpc/httpserver.rb', line 68 def authenticator=(authenticator) @soaplet.authenticator = authenticator end |
#filterchain ⇒ Object
91 92 93 |
# File 'lib/soap/rpc/httpserver.rb', line 91 def filterchain @router.filterchain end |
#on_init ⇒ Object
52 53 54 |
# File 'lib/soap/rpc/httpserver.rb', line 52 def on_init # do extra initialization in a derived class if needed. end |
#shutdown ⇒ Object
60 61 62 |
# File 'lib/soap/rpc/httpserver.rb', line 60 def shutdown @server.shutdown if @server end |
#status ⇒ Object
56 57 58 |
# File 'lib/soap/rpc/httpserver.rb', line 56 def status @server.status if @server end |