Class: SOAP::RPC::HTTPServer

Inherits:
Logger::Application
  • Object
show all
Defined in:
lib/soap/rpc/httpserver.rb

Direct Known Subclasses

StandaloneServer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ HTTPServer

Returns a new instance of HTTPServer.


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/soap/rpc/httpserver.rb', line 23

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
  # for backward compatibility
  @server.mount('/', @soaplet)
end

Instance Attribute Details

#default_namespaceObject

Returns the value of attribute default_namespace


21
22
23
# File 'lib/soap/rpc/httpserver.rb', line 21

def default_namespace
  @default_namespace
end

#serverObject (readonly)

Returns the value of attribute server


20
21
22
# File 'lib/soap/rpc/httpserver.rb', line 20

def server
  @server
end

Instance Method Details

#add_document_method(obj, soapaction, name, req_qnames, res_qnames) ⇒ Object


125
126
127
128
# File 'lib/soap/rpc/httpserver.rb', line 125

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


138
139
140
# File 'lib/soap/rpc/httpserver.rb', line 138

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


142
143
144
# File 'lib/soap/rpc/httpserver.rb', line 142

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


101
102
103
# File 'lib/soap/rpc/httpserver.rb', line 101

def add_headerhandler(obj)
  @router.add_headerhandler(obj)
end

#add_request_headerhandler(factory) ⇒ Object


97
98
99
# File 'lib/soap/rpc/httpserver.rb', line 97

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


112
113
114
# File 'lib/soap/rpc/httpserver.rb', line 112

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


117
118
119
120
121
122
# File 'lib/soap/rpc/httpserver.rb', line 117

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


130
131
132
# File 'lib/soap/rpc/httpserver.rb', line 130

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


134
135
136
# File 'lib/soap/rpc/httpserver.rb', line 134

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


89
90
91
# File 'lib/soap/rpc/httpserver.rb', line 89

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


93
94
95
# File 'lib/soap/rpc/httpserver.rb', line 93

def add_rpc_servant(obj, namespace = @default_namespace)
  @router.add_rpc_servant(obj, namespace)
end

#authenticatorObject


55
56
57
# File 'lib/soap/rpc/httpserver.rb', line 55

def authenticator
  @soaplet.authenticator
end

#authenticator=(authenticator) ⇒ Object


59
60
61
# File 'lib/soap/rpc/httpserver.rb', line 59

def authenticator=(authenticator)
  @soaplet.authenticator = authenticator
end

#filterchainObject


106
107
108
# File 'lib/soap/rpc/httpserver.rb', line 106

def filterchain
  @router.filterchain
end

#generate_explicit_typeObject


79
80
81
# File 'lib/soap/rpc/httpserver.rb', line 79

def generate_explicit_type
  @router.generate_explicit_type
end

#generate_explicit_type=(generate_explicit_type) ⇒ Object


83
84
85
# File 'lib/soap/rpc/httpserver.rb', line 83

def generate_explicit_type=(generate_explicit_type)
  @router.generate_explicit_type = generate_explicit_type
end

#literal_mapping_registryObject


71
72
73
# File 'lib/soap/rpc/httpserver.rb', line 71

def literal_mapping_registry
  @router.literal_mapping_registry
end

#literal_mapping_registry=(literal_mapping_registry) ⇒ Object


75
76
77
# File 'lib/soap/rpc/httpserver.rb', line 75

def literal_mapping_registry=(literal_mapping_registry)
  @router.literal_mapping_registry = literal_mapping_registry
end

#mapping_registryObject


63
64
65
# File 'lib/soap/rpc/httpserver.rb', line 63

def mapping_registry
  @router.mapping_registry
end

#mapping_registry=(mapping_registry) ⇒ Object


67
68
69
# File 'lib/soap/rpc/httpserver.rb', line 67

def mapping_registry=(mapping_registry)
  @router.mapping_registry = mapping_registry
end

#on_initObject


43
44
45
# File 'lib/soap/rpc/httpserver.rb', line 43

def on_init
  # do extra initialization in a derived class if needed.
end

#shutdownObject


51
52
53
# File 'lib/soap/rpc/httpserver.rb', line 51

def shutdown
  @server.shutdown if @server
end

#statusObject


47
48
49
# File 'lib/soap/rpc/httpserver.rb', line 47

def status
  @server.status if @server
end