Parent

Files

Class/Module Index [+]

Quicksearch

SOAP::RPC::SOAPlet

Attributes

authenticator[RW]
options[R]

Public Class Methods

cookies() click to toggle source
# File lib/soap/rpc/soaplet.rb, line 114
def self.cookies
  get_variable(:Cookies)
end
cookies=(cookies) click to toggle source
# File lib/soap/rpc/soaplet.rb, line 118
def self.cookies=(cookies)
  set_variable(:Cookies, cookies)
end
new(router = nil) click to toggle source
# File lib/soap/rpc/soaplet.rb, line 46
def initialize(router = nil)
  @router = router || ::SOAP::RPC::Router.new(self.class.name)
  @options = {}
  @authenticator = nil
  @config = {}
end
user() click to toggle source
# File lib/soap/rpc/soaplet.rb, line 122
def self.user
  get_variable(:User)
end
user=(user) click to toggle source
# File lib/soap/rpc/soaplet.rb, line 126
def self.user=(user)
  set_variable(:User, user)
end

Public Instance Methods

add_servant(obj, namespace) click to toggle source

for backward compatibility

# 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) click to toggle source
# File lib/soap/rpc/soaplet.rb, line 63
def allow_content_encoding_gzip=(allow)
  @options[:allow_content_encoding_gzip] = allow
end
app_scope_router() click to toggle source

for backward compatibility

# File lib/soap/rpc/soaplet.rb, line 54
def app_scope_router
  @router
end
do_GET(req, res) click to toggle source
# 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) click to toggle source
# 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.cookies = req.cookies
      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) click to toggle source

Servlet interfaces for WEBrick.

# File lib/soap/rpc/soaplet.rb, line 70
def get_instance(config, *options)
  @config = config
  self
end
require_path_info?() click to toggle source
# File lib/soap/rpc/soaplet.rb, line 75
def require_path_info?
  false
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.