Java custom types in soap calls problem

I am testing a suite of java web services(axis) with rspec1.1 and
I will describe below my problem giving a short generic example :

  • MyCustomObject - is a custom java object
  • MyService - it’s a java web service
  • myServiceMethod(MyJavaObject obj) it’s the method that service

On ruby side I am using a driver = SOAP::RPC::Driver configured
accordingly which
has defined myServiceMethod (driver.add_method(“myServiceMethod”,

In my spec file I am doing the following call :

require ‘java’
include_class ‘example.MyCustomObject’

custObj =
cutomObj.someProp = ‘Test’

#first call
driver.myServiceMethod(custObj) #Exception : SOAP::FAULT Error -
Invalid element in example.MyCustomObject - java_object

another call

driver.myServiceMethod(custObj.java_object) or
driver.myServiceMethod(Java.ruby_to_java(custObj)) - no exception on
server side I have a valid instance but no props set.

another call

myCustomObject = anotherService.get #returns a SOAP::Mapping::Object
driver.myServiceMethod(myCustomObject) # Exception : Bad types (class
java.lang.Object -> class example.MyCustomObject Jruby sends an Object
instead of MyCustomObject.

There is a way of calling a method with custom parameter types in order
to avoid above issues or somehow map the custom java types ?

Thanks in advance