# How can I handle a java bean in rails?

**URL:** <https://www.ruby-forum.com/t/how-can-i-handle-a-java-bean-in-rails/177149>\
**Category:** Rails\
**Created:** [October 12, 2009, 2:36pm UTC](https://www.ruby-forum.com/t/how-can-i-handle-a-java-bean-in-rails/177149 "2009-10-12T14:36:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [October 12, 2009, 2:36pm UTC](https://www.ruby-forum.com/t/how-can-i-handle-a-java-bean-in-rails/177149/1 "2009-10-12T14:36:49Z")

</div>

Hi,

I have to interface (using SOAP) with an external system. Most of the  
methods respond with a java bean. Look like it was done expecting java  
on the client side always.

My question is, how can I interface with that, how can I take a java  
bean and handle it on the RoR side?

Any hints?

Thanks

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [October 12, 2009, 5:32pm UTC](https://www.ruby-forum.com/t/how-can-i-handle-a-java-bean-in-rails/177149/2 "2009-10-12T17:32:18Z")

</div>

comopasta Gr wrote:

> Hi,
> 
> I have to interface (using SOAP) with an external system. Most of the  
> methods respond with a java bean. Look like it was done expecting java  
> on the client side always.
> 
> My question is, how can I interface with that, how can I take a java  
> bean and handle it on the RoR side?

This is not my area of expertise, but perhaps RJB would be helpful here.

> Any hints?
> 
> Thanks

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [October 12, 2009, 6:48pm UTC](https://www.ruby-forum.com/t/how-can-i-handle-a-java-bean-in-rails/177149/3 "2009-10-12T18:48:19Z")

</div>

On Mon, Oct 12, 2009 at 5:36 AM, comopasta Gr  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have to interface (using SOAP) with an external system. Most of the  
> methods respond with a java bean. Look like it was done expecting java  
> on the client side always.
> 
> My question is, how can I interface with that, how can I take a java  
> bean and handle it on the RoR side?

SOAP requests return XML, which in this case might be a serialized  
representation of a bean – have you looked at the actual response?

–  
Hassan S. ------------------------ removed\_email\_address@domain.invalid  
twitter: @hassan

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [October 12, 2009, 9:17pm UTC](https://www.ruby-forum.com/t/how-can-i-handle-a-java-bean-in-rails/177149/4 "2009-10-12T21:17:02Z")

</div>

Hi,  
Do you use JRuby ?  
You can access java methods (getter and setter for example) with  
jruby .

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [October 15, 2009, 9:30am UTC](https://www.ruby-forum.com/t/how-can-i-handle-a-java-bean-in-rails/177149/5 "2009-10-15T09:30:04Z")

</div>

Thanks guys.

> SOAP requests return XML, which in this case might be a serialized  
> representation of a bean – have you looked at the actual response?

Thanks Hassan. Of course. The java object is being serialized and sent  
as just XML.

I collected what I had to do to generate my SOAP request over HTTPS as  
part of another post I created. Can be found at  
[http://www.ruby-forum.com/topic/196520#new](http://www.ruby-forum.com/topic/196520#new)

Cheers!
