Forum: Ruby on Rails Strange error when testing layered web service

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Berger, Daniel (Guest)
on 2006-05-20 00:19
(Received via mailing list)
Hi all,

Ruby 1.8.4
Rails 1.1.2

  1) Error:
test_find_hardware_by_id(HardwareControllerApiTest):
ArgumentError: illegal refid http://test.host/
    c:/ruby/lib/ruby/1.8/soap/baseData.rb:166:in `decode'
    c:/ruby/lib/ruby/1.8/soap/encodingstyle/soapHandler.rb:153:in
`decode_tag'
    c:/ruby/lib/ruby/1.8/soap/parser.rb:179:in `decode_tag'
    c:/ruby/lib/ruby/1.8/soap/parser.rb:130:in `start_element'
    c:/ruby/lib/ruby/1.8/xsd/xmlparser/parser.rb:67:in `start_element'
    c:/ruby/lib/ruby/1.8/xsd/xmlparser/xmlparser.rb:34:in `do_parse'
    c:/ruby/lib/ruby/1.8/xsd/xmlparser/xmlparser.rb:31:in `do_parse'
    c:/ruby/lib/ruby/1.8/soap/parser.rb:92:in `parse'
    c:/ruby/lib/ruby/1.8/soap/processor.rb:39:in `unmarshal'

c:/ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_ser
vice/protocol/soap_proto
col.rb:84:in `decode_response'

c:/ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_ser
vice/test_invoke.rb:60:i
n `decode_rpc_response'

c:/ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_ser
vice/test_invoke.rb:26:i
n `invoke_layered'
    hardware_api_test.rb:21:in `test_find_hardware_by_id'

1 tests, 0 assertions, 0 failures, 1 errors

I'm not sure why it's looking at http://test.host when it ought to be
looking at http://localhost/webservice/api (on port 3000).

What am I doing wrong?  Am I supposed to be setting that somewhere?

Here's my simple test:

require File.dirname(__FILE__) + '/../test_helper'
require 'webservice_controller'

class WebserviceController
   def rescue_action(e)
      raise e
   end
end

class HardwareControllerApiTest < Test::Unit::TestCase
   fixtures :stuff

   def setup
      @controller = WebserviceController.new
      @request    = ActionController::TestRequest.new
      @response   = ActionController::TestResponse.new
      @uid        = 'xxx'
   end

   def test_find_hardware_by_id
      result = invoke_layered('hardware', :find_hardware_by_id, 1, @uid)
      assert(result[0].is_a?(Integer))
   end
end

Thanks,

Dan


This communication is the property of Qwest and may contain confidential
or
privileged information. Unauthorized use of this communication is
strictly
prohibited and may be unlawful.  If you have received this communication
in error, please immediately notify the sender by reply e-mail and
destroy
all copies of the communication and any attachments.
This topic is locked and can not be replied to.