# Design question: working with data from external source

**URL:** <https://www.ruby-forum.com/t/design-question-working-with-data-from-external-source/134146>\
**Category:** Rails\
**Created:** [April 8, 2008, 9:01am UTC](https://www.ruby-forum.com/t/design-question-working-with-data-from-external-source/134146 "2008-04-08T09:01:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![artello](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f05b48/32.png) [@artello](https://www.ruby-forum.com/u/artello)\
**Post date:** [April 8, 2008, 9:01am UTC](https://www.ruby-forum.com/t/design-question-working-with-data-from-external-source/134146/1 "2008-04-08T09:01:06Z")

</div>

Hello,

Could someone give an idea to Rails newbie?  
I’ve a need to do a SOAP query against remote server in my RoR  
application. As result of SOAP query array of strings (or hash)will be  
returned.  
But the question: how do I pass this array/hash to View if I’m doing  
SOAP call from the Controller? Or Controller isn’t a good place for  
external call code?

Regards,  
Artem

---

<div class="post-metadata">

**Author:** ![artello](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f05b48/32.png) [@artello](https://www.ruby-forum.com/u/artello)\
**Post date:** [April 8, 2008, 10:03am UTC](https://www.ruby-forum.com/t/design-question-working-with-data-from-external-source/134146/2 "2008-04-08T10:03:53Z")

</div>

What do you want to do with the data that you get from the SOAP query?

It depends what librar(ies) you’re using to get the SOAP data.

The best thing is to get the results, and use some breakpointer code,  
and inspect the result of the SOAP query and see what type of object  
and what messages you can send it.

Julian.

Learn Ruby on Rails! Check out the FREE VIDS (for a limited time)  
VIDEO #3 out NOW!  
[http://sensei.zenunit.com/](http://sensei.zenunit.com/)

---

<div class="post-metadata">

**Author:** ![artello](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f05b48/32.png) [@artello](https://www.ruby-forum.com/u/artello)\
**Post date:** [April 8, 2008, 10:22am UTC](https://www.ruby-forum.com/t/design-question-working-with-data-from-external-source/134146/3 "2008-04-08T10:22:17Z")

</div>

I’m using SOAP4R (ver 1.5.8) as interface and Hpricot to parse the  
server response (the server responds with data in XML format). So I’ll  
have a number String values as result of parsing data, which I need  
represent the data received from server as table in certain view.

Julian L. wrote:

> What do you want to do with the data that you get from the SOAP query?
> 
> It depends what librar(ies) you’re using to get the SOAP data.
> 
> The best thing is to get the results, and use some breakpointer code,  
> and inspect the result of the SOAP query and see what type of object  
> and what messages you can send it.

---

<div class="post-metadata">

**Author:** ![artello](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f05b48/32.png) [@artello](https://www.ruby-forum.com/u/artello)\
**Post date:** [April 9, 2008, 4:15pm UTC](https://www.ruby-forum.com/t/design-question-working-with-data-from-external-source/134146/4 "2008-04-09T16:15:21Z")

</div>

You do it in the same way that you’d do it if it were data from an  
ActiveRecord model:

@results = …SOAP4R results…

On Apr 8, 3:01 am, Artem T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![artello](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f05b48/32.png) [@artello](https://www.ruby-forum.com/u/artello)\
**Post date:** [April 8, 2008, 10:57am UTC](https://www.ruby-forum.com/t/design-question-working-with-data-from-external-source/134146/5 "2008-04-08T10:57:23Z")

</div>

Okay. You sound like you know what’s going on then.

Julian.

Learn Ruby on Rails! Check out the FREE VIDS (for a limited time)  
VIDEO #3 out NOW!  
[http://sensei.zenunit.com/](http://sensei.zenunit.com/)
