Class: SOAP::RPC::SOAPlet
- Inherits:
-
WEBrick::HTTPServlet::AbstractServlet
- Object
- WEBrick::HTTPServlet::AbstractServlet
- SOAP::RPC::SOAPlet
- Defined in:
- lib/action_web_service/soap/rpc/soaplet.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
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
#options ⇒ Object (readonly)
Returns the value of attribute options.
43 44 45 |
# File 'lib/action_web_service/soap/rpc/soaplet.rb', line 43 def @options end |
Instance Method Details
#add_servant(obj, namespace) ⇒ Object
for backward compatibility
57 58 59 |
# File 'lib/action_web_service/soap/rpc/soaplet.rb', line 57 def add_servant(obj, namespace) @router.add_rpc_servant(obj, namespace) end |
#allow_content_encoding_gzip=(allow) ⇒ Object
61 62 63 |
# File 'lib/action_web_service/soap/rpc/soaplet.rb', line 61 def allow_content_encoding_gzip=(allow) @options[:allow_content_encoding_gzip] = allow end |
#app_scope_router ⇒ Object
for backward compatibility
52 53 54 |
# File 'lib/action_web_service/soap/rpc/soaplet.rb', line 52 def app_scope_router @router end |
#do_GET(req, res) ⇒ Object
77 78 79 80 |
# File 'lib/action_web_service/soap/rpc/soaplet.rb', line 77 def do_GET(req, res) res.header['Allow'] = 'POST' raise WEBrick::HTTPStatus::MethodNotAllowed, "GET request not allowed" end |
#do_POST(req, res) ⇒ Object
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/action_web_service/soap/rpc/soaplet.rb', line 82 def do_POST(req, res) logger.debug { "SOAP request: " + req.body } if logger begin conn_data = ::SOAP::StreamHandler::ConnectionData.new setup_req(conn_data, req) @router.external_ces = @options[:external_ces] conn_data = @router.route(conn_data) setup_res(conn_data, req, res) 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.
68 69 70 71 |
# File 'lib/action_web_service/soap/rpc/soaplet.rb', line 68 def get_instance(config, *) @config = config self end |
#require_path_info? ⇒ Boolean
73 74 75 |
# File 'lib/action_web_service/soap/rpc/soaplet.rb', line 73 def require_path_info? false end |