try
{
/**
* Create a new stored procedure execution request.
*/
StoredProcedureRequestImpl req = new StoredProcedureRequestImpl( 0, procedureName, language );
/**
* For each argument UTF-8-encode the type name
* and Java-serialize the value
* and add them to the request as a parameter object.
*/
for ( int i = 0; i < arguments.length; i++ )
{
byte[] type;
byte[] value;
type = arguments[i].getClass().getName().getBytes( "UTF-8" );
value = SerializationUtils.serialize( ( Serializable ) arguments[i] );
req.addParameter( type, value );
}
/**
* Call the stored procedure via the extended operation
* and get back its return value.