# SOAP on rails? Confused

**URL:** <https://www.ruby-forum.com/t/soap-on-rails-confused/98997>\
**Category:** Rails\
**Created:** [July 19, 2006, 5:34pm UTC](https://www.ruby-forum.com/t/soap-on-rails-confused/98997 "2006-07-19T17:34:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bex3000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bb73d2/32.png) [@bex3000](https://www.ruby-forum.com/u/bex3000)\
**Post date:** [July 19, 2006, 5:34pm UTC](https://www.ruby-forum.com/t/soap-on-rails-confused/98997/1 "2006-07-19T17:34:27Z")

</div>

Hi,

Ive been struggling with the SOAP client things to do with rails as I’m  
not sure how to do what I need to do. So far I have:

class SOAPclient \< SOAP::RPC::StandaloneServer  
def on\_init  
setup = gui\_controller.new  
add\_method(setup, “submit”)  
end  
end

server = SOAPclient.new(“[http://127.0.0.1:3000](http://127.0.0.1:3000)”, “[http://192.168.0.5](http://192.168.0.5)”,  
8080)  
trap(‘INT’) { server.shutdown }  
server.start

But I’ve no idea how to call that or if its anywhere near right? :S  
Doesn’t seem to be any tutorials on this sortve stuff so getting very  
lost!  
Thanks alot,  
Bex

---

<div class="post-metadata">

**Author:** ![bex3000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bb73d2/32.png) [@bex3000](https://www.ruby-forum.com/u/bex3000)\
**Post date:** [July 20, 2006, 1:41am UTC](https://www.ruby-forum.com/t/soap-on-rails-confused/98997/2 "2006-07-20T01:41:51Z")

</div>

On Wed, Jul 19, 2006 at 05:34:27PM +0200, Becky F. wrote:

> Ive been struggling with the SOAP client things to do with rails as I’m  
> not sure how to do what I need to do. So far I have:
> 
> class SOAPclient \< SOAP::RPC::StandaloneServer  
> ^^^^^^ ^^^^^^

I’m fairly sure there’s some confusion about roles in your code.

> But I’ve no idea how to call that or if its anywhere near right? :S  
> Doesn’t seem to be any tutorials on this sortve stuff so getting very  
> lost!

There’s not a lot, but there should be enough to let you work out how to  
do  
most things. Perhaps you could explain what exactly you’re trying to  
do,  
and people can give more specific help?

- Matt

---

<div class="post-metadata">

**Author:** ![bex3000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bb73d2/32.png) [@bex3000](https://www.ruby-forum.com/u/bex3000)\
**Post date:** [July 20, 2006, 10:13am UTC](https://www.ruby-forum.com/t/soap-on-rails-confused/98997/3 "2006-07-20T10:13:31Z")

</div>

Hi, thanks for the reply.

I have a basic form in rhtml that I’m sending the contents of to a Java  
class method via soap. So far I have the controller successfully  
extracting the filled out forms contents properly, and not sure where to  
go from there (I have about 3 weeks experience working with rails so  
excuse the simple questions :D)

Thanks again, I hope that’s clearer,  
Bex

---

<div class="post-metadata">

**Author:** ![bex3000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bb73d2/32.png) [@bex3000](https://www.ruby-forum.com/u/bex3000)\
**Post date:** [July 20, 2006, 11:48am UTC](https://www.ruby-forum.com/t/soap-on-rails-confused/98997/4 "2006-07-20T11:48:48Z")

</div>

On Thu, Jul 20, 2006 at 10:13:31AM +0200, Becky F. wrote:

> Hi, thanks for the reply.
> 
> I have a basic form in rhtml that I’m sending the contents of to a Java  
> class method via soap. So far I have the controller successfully  
> extracting the filled out forms contents properly, and not sure where to  
> go from there (I have about 3 weeks experience working with rails so  
> excuse the simple questions :D)
> 
> Thanks again, I hope that’s clearer,

Not really, no. Your descriptions are pretty thin on useful detail,  
like  
what role each part of your system plays.

What I think you’re shooting for is something like so:

- User requests a page via a Rails app, which contains a HTML form  
generated  
via rhtml;

- User fills out form, submits it to another action in your Rails app  
for  
processing;

- This action takes the values of the params array;

- The values extracted from params need to be sent via a SOAP call to  
some  
sort of external service for further processing.

It’s this last step you’re getting hung up on, right? If so, the answer  
to  
that is pretty straight-forward – the Pickaxe has all the examples you  
need  
to make a straight-forward SOAP call. My PDF has it at page 237, but  
the  
whole SOAP and Web Services section is valuable to read if you’re  
working in  
this space.

If, of course, my description above is off-base, then you’ll need to  
explain  
what exactly you’re after. The point-by-point data flow is a good way  
to  
go.

- Matt

---

<div class="post-metadata">

**Author:** ![bex3000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bb73d2/32.png) [@bex3000](https://www.ruby-forum.com/u/bex3000)\
**Post date:** [July 21, 2006, 2:42am UTC](https://www.ruby-forum.com/t/soap-on-rails-confused/98997/5 "2006-07-21T02:42:08Z")

</div>

On Thu, Jul 20, 2006 at 12:41:40PM +0200, Becky F. wrote:

> That’s exactly it yeh. I’ve found tutorials like :
> 
> [http://rails.techno-weenie.net/question/2006/2/2/how\_do\_i\_upload\_files\_using\_a\_rails\_web\_service](http://rails.techno-weenie.net/question/2006/2/2/how_do_i_upload_files_using_a_rails_web_service)

That’s pretty different to what you’re trying to do. What probably  
confused  
you with that one is that the solution shows both a client portion (for  
making the SOAP calls) and a server (for receiving the SOAP calls) when  
all  
you want is the client end.

> but I’m not sure where the server and client parts fit in and whether  
> they’re called from a controller or how that works.

The controller code makes the call, yes.

> PS. What pdf do you mean?

The PDF version of “Programming Ruby, 2nd Edition”, sometimes referred  
to as  
“the Pickaxe”. It’s an excellent reference manual for the Ruby  
language,  
and comes highly recommended by lots of people as The Book To Have for  
anyone who’s going to be writing lots of Ruby. See  
[https://pragprog.com/titles/ruby/programming-ruby-2nd-edition/](http://www.pragmaticprogrammer.com/titles/ruby/) for all the details.  
I’ve  
got both the hardcopy for home reference, and a PDF version for  
“anywhere,  
any time” access to all the gems of wisdom contained within it.

- Matt

---

<div class="post-metadata">

**Author:** ![bex3000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bb73d2/32.png) [@bex3000](https://www.ruby-forum.com/u/bex3000)\
**Post date:** [July 20, 2006, 12:41pm UTC](https://www.ruby-forum.com/t/soap-on-rails-confused/98997/6 "2006-07-20T12:41:40Z")

</div>

That’s exactly it yeh. I’ve found tutorials like :

[http://rails.techno-weenie.net/question/2006/2/2/how\_do\_i\_upload\_files\_using\_a\_rails\_web\_service](http://rails.techno-weenie.net/question/2006/2/2/how_do_i_upload_files_using_a_rails_web_service)

but I’m not sure where the server and client parts fit in and whether  
they’re called from a controller or how that works.

Thanks for your help,

Bex

PS. What pdf do you mean?
