# Rails + SOAP?

**URL:** <https://www.ruby-forum.com/t/rails-soap/75681>\
**Category:** Rails\
**Created:** [December 25, 2005, 5:42am UTC](https://www.ruby-forum.com/t/rails-soap/75681 "2005-12-25T05:42:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![janovetz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/53a042/32.png) [@janovetz](https://www.ruby-forum.com/u/janovetz)\
**Post date:** [December 25, 2005, 5:42am UTC](https://www.ruby-forum.com/t/rails-soap/75681/1 "2005-12-25T05:42:43Z")

</div>

Hello-

I have a Rails web app that is database-centric (go figure). What I  
would like to do is expose certain parts of this database to an  
application running on a Windows box (or whatever). For the moment,  
let’s consider the read-only case, but authentication will be required.

Is SOAP what would be used for something like this? Are there better  
alternatives?

The existing Windows app already has an interface to a local database  
using ODBC. Would it be reasonable to write an ODBC wrapper for the  
SOAP connection and essentially re-use this existing interface? The  
alternative (that I see at the moment) is to write the interface to my  
db as a plugin for that application.

I’m very new to some of this terminology, but would be interested in  
hearing more of it!

Jake

---

<div class="post-metadata">

**Author:** ![janovetz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/53a042/32.png) [@janovetz](https://www.ruby-forum.com/u/janovetz)\
**Post date:** [December 25, 2005, 6:19am UTC](https://www.ruby-forum.com/t/rails-soap/75681/2 "2005-12-25T06:19:56Z")

</div>

On Sun, Dec 25, 2005 at 05:42:43AM +0100, Jake J. wrote:  
} Hello-  
}  
} I have a Rails web app that is database-centric (go figure). What I  
} would like to do is expose certain parts of this database to an  
} application running on a Windows box (or whatever). For the moment,  
} let’s consider the read-only case, but authentication will be  
required.  
}  
} Is SOAP what would be used for something like this? Are there better  
} alternatives?  
}  
} The existing Windows app already has an interface to a local database  
} using ODBC. Would it be reasonable to write an ODBC wrapper for the  
} SOAP connection and essentially re-use this existing interface? The  
} alternative (that I see at the moment) is to write the interface to my  
} db as a plugin for that application.  
[…]

It very much depends on your environment. In particular, it depends on  
the  
level of trust and your business requirements. If you have strong  
security  
requirements and do not trust the client (e.g. this client will be  
distributed outside your company), SOAP is a plausible solution.  
Likewise,  
if you don’t trust the transportation mechanism (e.g. you need SSL  
because  
you are going over untrusted network links), SOAP is plausible. If,  
however, this is an intranet client (e.g. a weekly report generator or  
something) that deals with the same database as the web-facing Rails  
app,  
I’d go with a straight connection between the client app and the  
database  
itself, without Rails being involved.

Even if you do have strong security requirements, a direct database  
connection may be the right choice. If you give the client a DB login  
with  
very limited permissions (e.g. can run a limited set of stored  
procedures,  
each of which requires authentication tokens in its arguments) and run  
all  
connections over SSL (or other encrypted network transport), that can  
work  
equally well.

If it’s a matter of business rules that are already implemented in Ruby,  
however, you will want some variety of RPC (remote procedure call, e.g.  
SOAP) implemented in Ruby.

} Jake  
–Greg

---

<div class="post-metadata">

**Author:** ![janovetz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/53a042/32.png) [@janovetz](https://www.ruby-forum.com/u/janovetz)\
**Post date:** [December 26, 2005, 7:21pm UTC](https://www.ruby-forum.com/t/rails-soap/75681/3 "2005-12-26T19:21:19Z")

</div>

Gregory S. wrote:

> It very much depends on your environment. In particular, it depends on  
> the  
> level of trust and your business requirements. If you have strong  
> security  
> …  
> –Greg

Thanks for your comments Greg. In my case, this will be a web  
deployment to a number of businesses and other customers, so security is  
important. Although I’m not very well versed in SOAP, I’ve looked at  
its XML syntax and some very rudimentary implementations and it seems  
quite appropriate for what I’d like to do.

My main questions now are how to develop the server and client software.  
The server would ideally be implemented as a plugin of sorts (or  
first-class citizen, really) to my existing Rails application. Would it  
be implemented in Ruby? Better as another accessor to the MySQL backend  
in some other language?

As for the client, what development environments are favored? .NET?  
C++? Others?

Jake

---

<div class="post-metadata">

**Author:** ![janovetz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/53a042/32.png) [@janovetz](https://www.ruby-forum.com/u/janovetz)\
**Post date:** [December 26, 2005, 7:28pm UTC](https://www.ruby-forum.com/t/rails-soap/75681/4 "2005-12-26T19:28:50Z")

</div>

On Mon, Dec 26, 2005 at 07:21:19PM +0100, Jake J. wrote:  
} Gregory S. wrote:  
} \> It very much depends on your environment. In particular, it depends  
on  
} \> the  
} \> level of trust and your business requirements. If you have strong  
} \> security  
} \> …  
} \> --Greg  
}  
} Thanks for your comments Greg. In my case, this will be a web  
} deployment to a number of businesses and other customers, so security  
is  
} important. Although I’m not very well versed in SOAP, I’ve looked at  
} its XML syntax and some very rudimentary implementations and it seems  
} quite appropriate for what I’d like to do.

Ideally, you shouldn’t have to think about the SOAP syntax at all, and  
the  
Ruby (or other) framework should just deal with it.

} My main questions now are how to develop the server and client  
software.  
} The server would ideally be implemented as a plugin of sorts (or  
} first-class citizen, really) to my existing Rails application. Would  
it  
} be implemented in Ruby? Better as another accessor to the MySQL  
backend  
} in some other language?

Ruby, and part of your Rails app.

} As for the client, what development environments are favored? .NET?  
} C++? Others?

It depends on your taste. If I were writing a Windows app that made SOAP  
calls, I’d almost certainly use .NET. Then again, I develop .NET apps  
for a  
living, so YMMV.

} Jake  
–Greg

---

<div class="post-metadata">

**Author:** ![janovetz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/53a042/32.png) [@janovetz](https://www.ruby-forum.com/u/janovetz)\
**Post date:** [December 26, 2005, 7:36pm UTC](https://www.ruby-forum.com/t/rails-soap/75681/5 "2005-12-26T19:36:23Z")

</div>

Gregory S. wrote:

> It depends on your taste. If I were writing a Windows app that made SOAP  
> calls, I’d almost certainly use .NET. Then again, I develop .NET apps  
> for a  
> living, so YMMV.
> 
> } Jake  
> –Greg

Thanks again, Greg. Last question – any good examples of this? The  
“soap4r” thing that many folks point to is a client-side application.  
Are there any good server side samples?

Jake
