Sha256: 150b0ec6a0eaf23ee59d9818c07ba9b8cecca04b8db66893b5b7e39a054d2d87

Contents?: true

Size: 1.63 KB

Versions: 30

Compression:

Stored size: 1.63 KB

Contents

require 'test/unit'
require 'soap/rpc/standaloneServer'
require 'soap/wsdlDriver'
require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb')


module SOAP


class TestDocument < Test::Unit::TestCase
  Namespace = 'urn:example.com:document'

  class Server < ::SOAP::RPC::StandaloneServer
    def on_init
      add_document_method(self, 'urn:example.com:document#submit', 'submit', XSD::QName.new(Namespace, 'ruby'), XSD::QName.new(Namespace, 'ruby'))
    end
  
    def submit(ruby)
      ruby
    end
  end

  DIR = File.dirname(File.expand_path(__FILE__))

  Port = 17171

  def setup
    setup_server
    setup_client
  end

  def setup_server
    @server = Server.new('Test', Namespace, '0.0.0.0', Port)
    @server.level = Logger::Severity::ERROR
    @server_thread = TestUtil.start_server_thread(@server)
  end

  def setup_client
    wsdl = File.join(DIR, 'document.wsdl')
    @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
    @client.endpoint_url = "http://localhost:#{Port}/"
    @client.wiredump_dev = STDOUT if $DEBUG
  end

  def teardown
    teardown_server if @server
    teardown_client if @client
  end

  def teardown_server
    @server.shutdown
    @server_thread.kill
    @server_thread.join
  end

  def teardown_client
    @client.reset_stream
  end

  def test_document
    msg = {'myversion' => "1.9", 'date' => "2004-01-01T00:00:00Z"}
    reply_msg = @client.submit(msg)
    assert_equal('1.9', reply_msg.myversion)
    assert_equal('1.9', reply_msg['myversion'])
    assert_equal('2004-01-01T00:00:00Z', reply_msg.date)
    assert_equal('2004-01-01T00:00:00Z', reply_msg['date'])
  end
end


end

Version data entries

30 entries across 30 versions & 13 rubygems

Version Path
mumboe-soap4r-1.6.0.pre.beta test/soap/wsdlDriver/test_document.rb
DefV-soap4r-1.5.8.2 test/soap/wsdlDriver/test_document.rb
mumboe-soap4r-1.5.8.7 test/soap/wsdlDriver/test_document.rb
teo-soap4r-1.5.9b test/soap/wsdlDriver/test_document.rb
mumboe-soap4r-1.5.8.6 test/soap/wsdlDriver/test_document.rb
soap4r-spox-1.6.0 test/soap/wsdlDriver/test_document.rb
soap4r-r19-1.5.9 test/soap/wsdlDriver/test_document.rb
mumboe-soap4r-1.5.8.5 test/soap/wsdlDriver/test_document.rb
soap4r-ruby1.9-2.0.5 test/soap/wsdlDriver/test_document.rb
soap4r-sgonyea-1.6.0 test/soap/wsdlDriver/test_document.rb
soap4r-straightjacket-1.5.9 test/soap/wsdlDriver/test_document.rb
soap4r-straightjacket-1.5.8 test/soap/wsdlDriver/test_document.rb
soap4r-ruby1.9-2.0.3 test/soap/wsdlDriver/test_document.rb
soap4r-ruby1.9-2.0.2 test/soap/wsdlDriver/test_document.rb
soap4r-ruby1.9-2.0.1 test/soap/wsdlDriver/test_document.rb
mumboe-soap4r-1.5.8.4 test/soap/wsdlDriver/test_document.rb
soap4r-ruby1.9-2.0.0 test/soap/wsdlDriver/test_document.rb
hands-soap4r-1.5.8.4 test/soap/wsdlDriver/test_document.rb
soap4r-ruby1.9-1.0.0 test/soap/wsdlDriver/test_document.rb
snaury-soap4r-1.5.8.1 test/soap/wsdlDriver/test_document.rb