Strange error when testing layered web service


#1

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:indecode_tag’
    c:/ruby/lib/ruby/1.8/soap/parser.rb:179:in decode_tag' c:/ruby/lib/ruby/1.8/soap/parser.rb:130:instart_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:indo_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:inparse’
    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:intest_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.