Class: SOAP::RPC::SOAPlet

Class | SOAP::RPC::SOAPlet
In: | soap/rpc/soaplet.rb
Parent: | WEBrick::HTTPServlet::AbstractServlet

### Methods

add_servant allow_content_encoding_gzip= app_scope_router do_GET do_POST get_instance new require_path_info?

### Attributes

options | [R] |

### Public Class methods

new(router = nil)

[Source]

    # File soap/rpc/soaplet.rb, line 45
      def initialize(router = nil)
        @router = router || ::SOAP::RPC::Router.new(self.class.name)
        @options = {}
        @config = {}
      end

### Public Instance methods

add_servant(obj, namespace)

for backward compatibility

[Source]

    # File soap/rpc/soaplet.rb, line 57
      def add_servant(obj, namespace)
        @router.add_rpc_servant(obj, namespace)
      end

allow_content_encoding_gzip=(allow)

[Source]

    # File soap/rpc/soaplet.rb, line 61
      def allow_content_encoding_gzip=(allow)
        @options[:allow_content_encoding_gzip] = allow
      end

app_scope_router()

for backward compatibility

[Source]

    # File soap/rpc/soaplet.rb, line 52
      def app_scope_router
        @router
      end

do_GET(req, res)

[Source]

    # File 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)

[Source]

    # File 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)

Servlet interfaces for WEBrick.

[Source]

    # File soap/rpc/soaplet.rb, line 68
      def get_instance(config, *options)
        @config = config
        self
      end

require_path_info?()

[Source]

    # File soap/rpc/soaplet.rb, line 73
      def require_path_info?
        false
      end

[Validate]