Class: SOAP::RPC::SOAPlet
- Inherits:
-
WEBrick::HTTPServlet::AbstractServlet
- Object
- WEBrick::HTTPServlet::AbstractServlet
- SOAP::RPC::SOAPlet
- Defined in:
- lib/soap/rpc/soaplet.rb
Instance Attribute Summary collapse
-
#authenticator ⇒ Object
Returns the value of attribute authenticator.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#add_servant(obj, namespace) ⇒ Object
for backward compatibility.
- #allow_content_encoding_gzip=(allow) ⇒ Object
-
#app_scope_router ⇒ Object
for backward compatibility.
- #do_GET(req, res) ⇒ Object
- #do_POST(req, res) ⇒ Object
-
#get_instance(config, *options) ⇒ Object
Servlet interfaces for WEBrick.
-
#initialize(router = nil) ⇒ SOAPlet
constructor
A new instance of SOAPlet.
- #require_path_info? ⇒ Boolean
Constructor Details
Instance Attribute Details
#authenticator ⇒ Object
Returns the value of attribute authenticator.
44 45 46 |
# File 'lib/soap/rpc/soaplet.rb', line 44 def authenticator @authenticator end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
43 44 45 |
# File 'lib/soap/rpc/soaplet.rb', line 43 def @options end |
Class Method Details
.cookies ⇒ Object
114 115 116 |
# File 'lib/soap/rpc/soaplet.rb', line 114 def self. get_variable(:Cookies) end |
.cookies=(cookies) ⇒ Object
118 119 120 |
# File 'lib/soap/rpc/soaplet.rb', line 118 def self.() set_variable(:Cookies, ) end |
.user ⇒ Object
122 123 124 |
# File 'lib/soap/rpc/soaplet.rb', line 122 def self.user get_variable(:User) end |
.user=(user) ⇒ Object
126 127 128 |
# File 'lib/soap/rpc/soaplet.rb', line 126 def self.user=(user) set_variable(:User, user) end |
Instance Method Details
#add_servant(obj, namespace) ⇒ Object
for backward compatibility
59 60 61 |
# File 'lib/soap/rpc/soaplet.rb', line 59 def add_servant(obj, namespace) @router.add_rpc_servant(obj, namespace) end |
#allow_content_encoding_gzip=(allow) ⇒ Object
63 64 65 |
# File 'lib/soap/rpc/soaplet.rb', line 63 def allow_content_encoding_gzip=(allow) @options[:allow_content_encoding_gzip] = allow end |
#app_scope_router ⇒ Object
for backward compatibility
54 55 56 |
# File 'lib/soap/rpc/soaplet.rb', line 54 def app_scope_router @router end |
#do_GET(req, res) ⇒ Object
79 80 81 82 |
# File 'lib/soap/rpc/soaplet.rb', line 79 def do_GET(req, res) res.header['Allow'] = 'POST' raise WEBrick::HTTPStatus::MethodNotAllowed, "GET request not allowed" end |
#do_POST(req, res) ⇒ Object
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/soap/rpc/soaplet.rb', line 84 def do_POST(req, res) logger.debug { "SOAP request: " + req.body } if logger if @authenticator @authenticator.authenticate(req, res) # you can check authenticated user with SOAP::RPC::SOAPlet.user end begin conn_data = ::SOAP::StreamHandler::ConnectionData.new setup_req(conn_data, req) @router.external_ces = @options[:external_ces] Mapping.protect_threadvars(:SOAPlet) do SOAPlet.user = req.user SOAPlet. = req. conn_data = @router.route(conn_data) setup_res(conn_data, req, res) end rescue Exception => e conn_data = @router.create_fault_response(e) res.status = WEBrick::HTTPStatus::RC_INTERNAL_SERVER_ERROR res.body = conn_data.send_string res['content-type'] = conn_data.send_contenttype || "text/xml" end if res.body.is_a?(IO) res.chunked = true logger.debug { "SOAP response: (chunked response not logged)" } if logger else logger.debug { "SOAP response: " + res.body } if logger end end |
#get_instance(config, *options) ⇒ Object
Servlet interfaces for WEBrick.
70 71 72 73 |
# File 'lib/soap/rpc/soaplet.rb', line 70 def get_instance(config, *) @config = config self end |
#require_path_info? ⇒ Boolean
75 76 77 |
# File 'lib/soap/rpc/soaplet.rb', line 75 def require_path_info? false end |