Sha256: 48df4c9f81ce1473efe94829e3ee320544abf770001109b08bcac61bc0902f05

Contents?: true

Size: 1.41 KB

Versions: 1

Compression:

Stored size: 1.41 KB

Contents

== Wash Out

Wash Out is very simple SOAP service solution. It allows you to create SOAP services on top of your controllers in 3 steps (see Usage).

== Install

  gem install wash_out
  
== Usage

=== I. Define structure in your controller

  class TestController < ApplicationController
    wash_with_soap :my_soap_method => { 
      :in => { 'structure' => { 'foo' => :string }, 'bar' => :integer },
      :out => :boolean
    }

Defined this way method "my_soap_method" will wait for two parameters:

1. 'structure' will wait for complex type (defined separately in WSDL)
2. 'bar' will wait for string (xsd:string in WSDL)
  
On the other side it will return boolean (xsd:boolean in WSDL).

=== II. Define worker

At same controller define action "my_soap_method"

  def my_soap_method
    @soap # this will contain data passed by SOAP request
  end
  
Parameters are handling by WashOut::Param entity. To get values use 'value' and '[]' methods.

To get 'bar' parameter: 
  @soap['bar'].value
  
To get 'foo' from 'structure': 
  @soap['structure']['foo'].value

=== III. Return something

Return from your method to respond. In our case we should just respond with 
  return true #or return false
  
In complex scenarios we can do 
  return { :foo => 'foo', :bar => 'bar' }
  
  
== Complex cases

=== I have same substructures for several methods. Are there any ways to define WSDL besides hash?

=== How to respond with SOAP error?

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wash_out-0.1 README.rdoc