diff options
Diffstat (limited to 'test/wsdl/datetime')
-rw-r--r-- | test/wsdl/datetime/DatetimeService.rb | 42 | ||||
-rw-r--r-- | test/wsdl/datetime/test_datetime.rb | 10 |
2 files changed, 26 insertions, 26 deletions
diff --git a/test/wsdl/datetime/DatetimeService.rb b/test/wsdl/datetime/DatetimeService.rb index 91c006005d..800e06d66f 100644 --- a/test/wsdl/datetime/DatetimeService.rb +++ b/test/wsdl/datetime/DatetimeService.rb @@ -2,37 +2,43 @@ require 'datetimeServant.rb' require 'soap/rpc/standaloneServer' +require 'soap/mapping/registry' class DatetimePortType - MappingRegistry = SOAP::Mapping::Registry.new - - # No mapping definition + MappingRegistry = ::SOAP::Mapping::Registry.new Methods = [ - ["now", "now", [ - ["in", "now", - [SOAP::SOAPDateTime]], - ["retval", "now", - [SOAP::SOAPDateTime]]], "", "urn:jp.gr.jin.rrr.example.datetime"] + ["now", "now", + [ + ["in", "now", [::SOAP::SOAPDateTime]], + ["retval", "now", [::SOAP::SOAPDateTime]] + ], + "", "urn:jp.gr.jin.rrr.example.datetime", :rpc + ] ] end -class DatetimePortTypeApp < SOAP::RPC::StandaloneServer +class DatetimePortTypeApp < ::SOAP::RPC::StandaloneServer def initialize(*arg) - super - + super(*arg) servant = DatetimePortType.new - DatetimePortType::Methods.each do |name_as, name, params, soapaction, namespace| - qname = XSD::QName.new(namespace, name_as) - @soaplet.app_scope_router.add_method(servant, qname, soapaction, - name, params) + DatetimePortType::Methods.each do |name_as, name, param_def, soapaction, namespace, style| + if style == :document + @router.add_document_operation(servant, soapaction, name, param_def) + else + qname = XSD::QName.new(namespace, name_as) + @router.add_rpc_operation(servant, qname, soapaction, name, param_def) + end end - self.mapping_registry = DatetimePortType::MappingRegistry end end -# Change listen port. if $0 == __FILE__ - DatetimePortTypeApp.new('app', nil, '0.0.0.0', 10080).start + # Change listen port. + server = DatetimePortTypeApp.new('app', nil, '0.0.0.0', 10080) + trap(:INT) do + server.shutdown + end + server.start end diff --git a/test/wsdl/datetime/test_datetime.rb b/test/wsdl/datetime/test_datetime.rb index 0f531ff18c..7652318205 100644 --- a/test/wsdl/datetime/test_datetime.rb +++ b/test/wsdl/datetime/test_datetime.rb @@ -24,20 +24,14 @@ class TestDatetime < Test::Unit::TestCase Thread.current.abort_on_exception = true @server.start } - while @server.status != :Running - sleep 0.1 - unless @t.alive? - @t.join - raise - end - end end def setup_client wsdl = File.join(DIR, 'datetime.wsdl') - @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_driver + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver @client.endpoint_url = "http://localhost:#{Port}/" @client.generate_explicit_type = true + @client.wiredump_dev = STDOUT if $DEBUG end def teardown |