simplews 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -1
- data/lib/simplews/version.rb +1 -1
- data/lib/simplews.rb +21 -0
- data/test/test_simplews.rb +5 -0
- metadata +2 -2
data/History.txt
CHANGED
data/lib/simplews/version.rb
CHANGED
data/lib/simplews.rb
CHANGED
@@ -4,6 +4,25 @@ require 'builder'
|
|
4
4
|
|
5
5
|
class SimpleWS < SOAP::RPC::StandaloneServer
|
6
6
|
|
7
|
+
def self.get_wsdl(url, name)
|
8
|
+
require 'soap/rpc/driver'
|
9
|
+
driver = SOAP::RPC::Driver.new(url, "urn:#{ name }")
|
10
|
+
driver.add_method('wsdl')
|
11
|
+
driver.wsdl
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.get_driver(url, name)
|
15
|
+
require 'soap/wsdlDriver'
|
16
|
+
require 'fileutils'
|
17
|
+
|
18
|
+
tmp = File.open("/tmp/simpleWS.wsdl",'w')
|
19
|
+
tmp.write SimpleWS::get_wsdl(url, name)
|
20
|
+
tmp.close
|
21
|
+
driver = SOAP::WSDLDriverFactory.new( "TestWS.wsdl" ).create_rpc_driver
|
22
|
+
FileUtils.rm "/tmp/simpleWS.wsdl"
|
23
|
+
|
24
|
+
driver
|
25
|
+
end
|
7
26
|
|
8
27
|
def initialize(name="WS", description="", host="localhost", port="1984", *args)
|
9
28
|
super(description, "urn:#{ name }", host, port, *args)
|
@@ -14,6 +33,8 @@ class SimpleWS < SOAP::RPC::StandaloneServer
|
|
14
33
|
@messages = []
|
15
34
|
@operations = []
|
16
35
|
@bindings = []
|
36
|
+
|
37
|
+
serve :wsdl, %w(), :return => :string
|
17
38
|
end
|
18
39
|
|
19
40
|
def serve(name, args=[], types={}, &block)
|
data/test/test_simplews.rb
CHANGED
@@ -35,6 +35,11 @@ class TestSimpleWS < Test::Unit::TestCase
|
|
35
35
|
assert(driver.hi('Gladis') == "Hi Gladis, how are you?")
|
36
36
|
assert(driver.bye('Gladis') == "Bye bye Gladis. See you soon.")
|
37
37
|
|
38
|
+
|
39
|
+
driver = SimpleWS::get_driver('http://localhost:1984', "TestWS")
|
40
|
+
assert(driver.hi('Gladis') == "Hi Gladis, how are you?")
|
41
|
+
assert(driver.bye('Gladis') == "Bye bye Gladis. See you soon.")
|
42
|
+
|
38
43
|
|
39
44
|
|
40
45
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplews
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-10-
|
12
|
+
date: 2008-10-27 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|