Class: MongrelSOAP::RPC::HTTPServer

Inherits:
Logger::Application
  • Object
show all
Defined in:
lib/mongrel-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.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 15

def initialize(config)
  actor = config[:SOAPHTTPServerApplicationName] || self.class.name
  super(actor)
  
  @default_namespace = config[:SOAPDefaultNamespace]
  
  @router = ::SOAP::RPC::Router.new(actor)
  on_init
  
  @server = Mongrel::HttpServer.new(config[:BindAddress], config[:Port])
  @server.register("/", Mongrel::SOAP4RHandler.new(@router))
  if wsdl_dir = config[:WSDLDocumentDirectory]
    @server.register('/wsdl', Mongrel::DirHandler.new(wsdl_dir))
  end
end

Instance Attribute Details

#default_namespaceObject

Returns the value of attribute default_namespace.



13
14
15
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 13

def default_namespace
  @default_namespace
end

#serverObject (readonly)

Returns the value of attribute server.



12
13
14
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 12

def server
  @server
end

Instance Method Details

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



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

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



114
115
116
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 114

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



118
119
120
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 118

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



77
78
79
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 77

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

#add_request_headerhandler(factory) ⇒ Object



73
74
75
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 73

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



88
89
90
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 88

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



93
94
95
96
97
98
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 93

def add_rpc_method_as(obj, name, name_as, *param)
  qname = XSD::QName.new(@default_namespace, name_as)
  soapaction = nil
  param_def = ::SOAP::RPC::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



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

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



110
111
112
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 110

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



64
65
66
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 64

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 Also known as: add_servant



68
69
70
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 68

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

#filterchainObject



82
83
84
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 82

def filterchain
  @router.filterchain
end

#generate_explicit_typeObject



54
55
56
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 54

def generate_explicit_type
  @router.generate_explicit_type
end

#generate_explicit_type=(generate_explicit_type) ⇒ Object



58
59
60
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 58

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

#literal_mapping_registryObject



46
47
48
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 46

def literal_mapping_registry
  @router.literal_mapping_registry
end

#literal_mapping_registry=(literal_mapping_registry) ⇒ Object



50
51
52
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 50

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

#mapping_registryObject



38
39
40
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 38

def mapping_registry
  @router.mapping_registry
end

#mapping_registry=(mapping_registry) ⇒ Object



42
43
44
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 42

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

#on_initObject



31
32
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 31

def on_init
end

#shutdownObject



34
35
36
# File 'lib/mongrel-soap/rpc/httpserver.rb', line 34

def shutdown
  @server.stop if @server
end