# ActiveResource or Ajax/XHR + REXML or similar for calling ashx webservice

**URL:** <https://www.ruby-forum.com/t/activeresource-or-ajax-xhr-rexml-or-similar-for-calling-ashx-webservice/127097>\
**Category:** Rails\
**Created:** [January 24, 2008, 11:08pm UTC](https://www.ruby-forum.com/t/activeresource-or-ajax-xhr-rexml-or-similar-for-calling-ashx-webservice/127097 "2008-01-24T23:08:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![prism](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@prism](https://www.ruby-forum.com/u/prism)\
**Post date:** [January 24, 2008, 11:08pm UTC](https://www.ruby-forum.com/t/activeresource-or-ajax-xhr-rexml-or-similar-for-calling-ashx-webservice/127097/1 "2008-01-24T23:08:42Z")

</div>

Hi!

I’m making an application to display logs that are returned from an  
external resource as XML.

I’d like to use ActiveResource, but from what I understand it can’t be  
done out of the box,  
because the WS I’m calling doesn’t conform to the URI conventions.

To log on to the service, I’ll have to call something like

[http://server.com/Admin/logon.ashx?username={#username}&password={#password}](http://server.com/Admin/logon.ashx?username=%7B#username%7D&password=%7B#password%7D)

which then returns either the user’s passkey + other info, or an  
error.  
The service itself is made with .NET.

Then, when that is done and the user-name is retrieved, I need to call

[http://server.com/Admin/log1.ashx?ID={@user.passkey}&timeframe={#timeframe}&sorting={#sorting}](http://server.com/Admin/log1.ashx?ID=%7B@user.passkey%7D&timeframe=%7B#timeframe%7D&sorting=%7B#sorting%7D)  
[http://server.com/Admin/log2.ashx?ID={@user.passkey}&status={#status}](http://server.com/Admin/log2.ashx?ID=%7B@user.passkey%7D&status=%7B#status%7D)

and have that return the log XML.

I don’t want to have to write, modify or even use an XML parser if I  
can help it, and  
would rather use ActiveResource.

Apart from the URL, the XML that is returned is not in english either,  
which means  
it doesn’t follow the pluralisation rules in Rails.

Is there some way I can get ARes to relate to the web service? Some  
way to interface them…

Or what is the best way to send requests + get and parse returned XML  
in a case like this?

Thanks for any insight!
