{"id":18544429,"url":"https://github.com/instructure/soap4r-middleware","last_synced_at":"2025-04-09T19:30:43.858Z","repository":{"id":1405708,"uuid":"1455986","full_name":"instructure/soap4r-middleware","owner":"instructure","description":"Expose a soap4r server endpoint using Rack middleware","archived":false,"fork":false,"pushed_at":"2020-04-10T19:07:44.000Z","size":13,"stargazers_count":11,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T10:49:08.151Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"haraldmartin/things-rb","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/instructure.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-03-08T19:24:55.000Z","updated_at":"2022-11-29T19:38:24.000Z","dependencies_parsed_at":"2022-07-07T11:33:05.149Z","dependency_job_id":null,"html_url":"https://github.com/instructure/soap4r-middleware","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Fsoap4r-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Fsoap4r-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Fsoap4r-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Fsoap4r-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instructure","download_url":"https://codeload.github.com/instructure/soap4r-middleware/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247856541,"owners_count":21007620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T20:16:30.587Z","updated_at":"2025-04-09T19:30:43.403Z","avatar_url":"https://github.com/instructure.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Soap4r Rack Middleware\n======================\n\nThis small library provides a Rack Middleware interface to exposing\nSoap4r server endpoints. This is a lightweight alternative to using\nActionWebService for exposing SOAP in a Rails application, as well as\nallowing SOAP endpoints in any other Rack-based application. It's been\ntested with Rails 2.3.x, but should work fine in Rails 3 as well.\n\nInstall\n-------\n\n    $ gem install soap4r-middleware\n\nUsage\n-----\n\nFirst, get yourself some Soap4r endpoint code. The easiest way to do\nthis is to generate it from a WSDL file. Details are in the Soap4r\ndocumentation, or see http://dev.ctor.org/soap4r/wiki/HowtouseWSDL4R ,\nbut basically:\n\n    $ wsdl2ruby.rb --wsdl /path/to/definiton.wsdl --type server\n\nYou'll get some generated files. One of them will be named\nlike `*APIService.rb`, near the bottom will be a class of the same name.\nTo enable middleware functionality, you want to copy this class'\ninitialization code into a new class that subclasses `Soap4r::Middleware::Base`, and replace the initialize method with a block passed to `setup`. For instance:\n\n    gem 'soap4r-middleware' # or use Bundler\n    require 'soap4r-middleware'\n\n    class MyAPIMiddleware \u003c Soap4r::Middleware::Base\n      setup do\n        self.endpoint = %r{^/url/to/soap/endpoint/}\n        servant MyAPIPort.new\n        MyAPIPort::Methods.each do |definitions|\n          opt = definitions.last\n          if opt[:request_style] == :document\n            @router.add_document_operation(servant, *definitions)\n          else\n            @router.add_rpc_operation(servant, *definitions)\n          end\n        end\n        self.mapping_registry = UrnMyAPIMappingRegistry::EncodedRegistry\n        self.literal_mapping_registry = UrnMyAPIMappingRegistry::LiteralRegistry\n      end\n    end\n\nThen use this middleware anywhere you'd use a Rack middleware. It\ndoubles as a Rack application as well, so you can host it directly using\n`run MyAPIMiddleware.new` in your `rackup.ru` file.\n\n### TODO\n\nI guess I could wrap `wsdl2ruby.rb` and make this automatic.\n\n### Wait, This is For Seriously??\n\nSometimes you just gotta SOAP. Might as well make it suck as little as\npossible.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstructure%2Fsoap4r-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstructure%2Fsoap4r-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstructure%2Fsoap4r-middleware/lists"}