2
require 'soap/rpc/standaloneServer'
3
require 'soap/wsdlDriver'
9
class TestDocument < Test::Unit::TestCase
10
Namespace = 'urn:example.com:document'
12
class Server < ::SOAP::RPC::StandaloneServer
14
add_document_method(self, 'urn:example.com:document#submit', 'submit', XSD::QName.new(Namespace, 'ruby'), XSD::QName.new(Namespace, 'ruby'))
22
DIR = File.dirname(File.expand_path(__FILE__))
32
@server = Server.new('Test', Namespace, '0.0.0.0', Port)
33
@server.level = Logger::Severity::ERROR
34
@server_thread = start_server_thread(@server)
38
wsdl = File.join(DIR, 'document.wsdl')
39
@client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
40
@client.endpoint_url = "http://localhost:#{Port}/"
41
@client.wiredump_dev = STDOUT if $DEBUG
59
def start_server_thread(server)
61
Thread.current.abort_on_exception = true
68
msg = {'myversion' => "1.9", 'date' => "2004-01-01T00:00:00Z"}
69
reply_msg = @client.submit(msg)
70
assert_equal('1.9', reply_msg.myversion)
71
assert_equal('1.9', reply_msg['myversion'])
72
assert_equal('2004-01-01T00:00:00Z', reply_msg.date)
73
assert_equal('2004-01-01T00:00:00Z', reply_msg['date'])