Sha256: 671b7a6c8d3c3e432ed69a899dcd104c49371fcc8d9fce67706236964b1dd544

Contents?: true

Size: 985 Bytes

Versions: 2

Compression:

Stored size: 985 Bytes

Contents

require "sinatra/base"
require "sinatra/soap/version"
require "sinatra/soap/wsdl"
require "sinatra/soap/error"
require "sinatra/soap/dsl_methods"
require "sinatra/soap/helper_methods"
require "sinatra/soap/request"
require "sinatra/soap/response"
require "builder"


module Sinatra
  module Soap

    include DslMethods

    def self.registered(app)
      app.helpers Soap::HelperMethods

      app.set :wsdl_route, '/wsdl' unless defined?(app.settings.wsdl_path)
      app.set :namespace, 'http://schemas.xmlsoap.org/wsdl/' unless defined?(app.settings.namespace)
      app.set :endpoint, '/action' unless defined?(app.settings.endpoint)
      app.set :service, 'Sinatra' unless defined?(app.settings.service)

      app.post(app.settings.endpoint) do
        content_type 'text/xml'
        call_action_block
      end

      app.get(app.settings.wsdl_route) do 
        content_type 'text/xml'
        get_wsdl
      end
    end
  end
  Delegator.delegate :soap
  register Soap
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
sinatra-soap-current-0.1.8 lib/sinatra/soap.rb
sinatra-soap-0.1.7 lib/sinatra/soap.rb