# Error when Testing AWS API (ArgumentError: illegal refid htt

**URL:** <https://www.ruby-forum.com/t/error-when-testing-aws-api-argumenterror-illegal-refid-htt/51434>\
**Category:** Rails\
**Created:** [December 31, 2005, 7:47am UTC](https://www.ruby-forum.com/t/error-when-testing-aws-api-argumenterror-illegal-refid-htt/51434 "2005-12-31T07:47:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![princenamor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Post date:** [December 31, 2005, 7:47am UTC](https://www.ruby-forum.com/t/error-when-testing-aws-api-argumenterror-illegal-refid-htt/51434/1 "2005-12-31T07:47:14Z")

</div>

OK, I’m finally starting to play around with the AWS part of Rails,  
and I’m running into problems with the functional tests. If I use the  
generator to create the web service as

```
./script/generate web_sevice MyTest do_it

```

and then run the unit tests without further editing the code, I get  
the following error:

```
test_do_it(MyTestControllerApiTest):
ArgumentError: illegal refid http://test.host/login
    /usr/local/ruby/lib/ruby/1.8/soap/baseData.rb:166:in `decode'
    /usr/local/ruby/lib/ruby/1.8/soap/encodingstyle/soapHandler.rb:153:in

```

`decode_tag' /usr/local/ruby/lib/ruby/1.8/soap/parser.rb:179:in `decode\_tag’  
/usr/local/ruby/lib/ruby/1.8/soap/parser.rb:130:in  
`start_element' /usr/local/ruby/lib/ruby/1.8/xsd/xmlparser/parser.rb:67:in `start\_element’  
/usr/local/ruby/lib/ruby/1.8/xsd/xmlparser/rexmlparser.rb:34:in  
`tag_start' /usr/local/ruby/lib/ruby/1.8/rexml/parsers/streamparser.rb:24:in `parse’  
/usr/local/ruby/lib/ruby/1.8/rexml/document.rb:173:in  
`parse_stream' /usr/local/ruby/lib/ruby/1.8/xsd/xmlparser/rexmlparser.rb:27:in `do\_parse’  
/usr/local/ruby/lib/ruby/1.8/soap/parser.rb:92:in `parse' /usr/local/ruby/lib/ruby/1.8/soap/processor.rb:39:in `unmarshal’  
/usr/local/ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.0.0/lib/action\_web\_service/protocol/soap\_protocol.rb:84:in  
`decode_response' /usr/local/ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.0.0/lib/action_web_service/test_invoke.rb:59:in `decode\_rpc\_response’  
/usr/local/ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.0.0/lib/action\_web\_service/test\_invoke.rb:11:in  
`invoke' ./test/functional/my_test_api_test.rb:14:in `test\_do\_it’

I’m using Ruby 1.8.4 compiled form source on Linux and the Rails 1.0.0  
gems.

I’ve been searching for info on the problem for the last couple of  
hours and haven’t turned up anything, so if someone could point me in  
the right direction (or confirm that it’s a bug and that I’m not just  
going nuts), it would be much appreciated.

Also, the web service itself seems to work just fine when I test it by  
hand using the web service scaffolding on the controller.

–  
Regards,  
John W.

> **[John Wilger](http://johnwilger.com)**
>
> The personal website of John Wilger; Dad, Cyclist, Software Developer

* * *

Alice came to a fork in the road. “Which road do I take?” she asked.  
“Where do you want to go?” responded the Cheshire cat.  
“I don’t know,” Alice answered.  
“Then,” said the cat, “it doesn’t matter.”

- Lewis Carrol, Alice in Wonderland

---

<div class="post-metadata">

**Author:** ![princenamor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Post date:** [December 31, 2005, 5:52pm UTC](https://www.ruby-forum.com/t/error-when-testing-aws-api-argumenterror-illegal-refid-htt/51434/2 "2005-12-31T17:52:57Z")

</div>

On 12/31/05, John W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> ArgumentError: illegal refid http://test.host/login
> 
> ```

Ugh. I’m an idiot. Guess I was just staring at it too long and too  
late at night. I’m getting the error because an application-wide  
before\_filter is redirecting the request to a login page. 😃

In my defence, the error message isn’t exactly informative.

–  
Regards,  
John W.

> **[John Wilger](http://johnwilger.com)**
>
> The personal website of John Wilger; Dad, Cyclist, Software Developer

* * *

Alice came to a fork in the road. “Which road do I take?” she asked.  
“Where do you want to go?” responded the Cheshire cat.  
“I don’t know,” Alice answered.  
“Then,” said the cat, “it doesn’t matter.”

- Lewis Carrol, Alice in Wonderland
