Home » Developer & Programmer » Forms » Function in form
Function in form [message #189567] Fri, 25 August 2006 02:27 Go to next message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
Hi
Hi,
My requirement is like this.
I am integrating a webservice in my form.
I imported some Java classes and these are in the form of package in my form.
There is a function in the form like this. This function is created by forms as a result of the webservice.

FUNCTION getTasks(
obj ORA_JAVA.JOBJECT,
a0 VARCHAR2) RETURN ORA_JAVA.JARRAY IS
BEGIN
args := JNI.CREATE_ARG_LIST(1);
JNI.ADD_STRING_ARG(args, a0);
RETURN JNI.CALL_OBJECT_METHOD(FALSE, obj, 'com/bankForms/EmbeddedTasksModuleServiceStub', 'getTasks', '(Ljava/lang/String;)[Ljava/lang/String;', args);
END;


Now I want to use this function in when_new_form_instance of my form.
I have to send a value called "user1" into the webservice using this function.
As a result I have to get array of values.
For example,I send "user1" to the webservice,
3 tasks should be returned from that webservice

21212121@@@subba@@@LOAN@@@34
75767621@@@rames@@@LOAN@@@35
54545464@@@pavan@@@LOAN@@@37

Each value is separated by @@@.
Now I have to write a code to store each of these 4 values in 4 variables and store them in 4 text items.



In the when_new_form_instance of the form,

DECLARE
jo ora_java.jobject;
rv Varchar2(32000) ;
ex ora_java.jobject;
BEGIN
jo := EmbeddedTasksModuleServiceStub.new;
ex:='user1';
rv := EmbeddedTasksModuleServiceStub.getTasks(jo,ex);
:tasklist.text_item40:=rv;

END;

This is giving me errors."wrong number or type of arguments in call to GETTASKS"

How can I achieve my task of sending "user1" and getting array of values and sort them again and place them in their respective textitems?
Kindly guide me
Re: Function in form [message #191726 is a reply to message #189567] Thu, 07 September 2006 23:50 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have you solved your problem?

David
Re: Function in form [message #191729 is a reply to message #189567] Fri, 08 September 2006 00:03 Go to previous message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

u hav defined

**************************************************************
FUNCTION getTasks(obj ORA_JAVA.JOBJECT,a0 VARCHAR2) RETURN ORA_JAVA.JARRAY
**************************************************************

and when calling gettasks, u r proving the following parameters

**************************************************************
rv := EmbeddedTasksModuleServiceStub.getTasks(jo,ex);
**************************************************************
where jo ora_java.jobject, rv is varchar2, ex ora_java.jobject.

while according to ur function defination rv should be ORA_JAVA.JARRAY type and ex should be varchar2. eighter modify ur function or function call.

sandy
Previous Topic: How to Invoke crystal reports from forms 10g? & Calling crystal report viewer from oracle forms
Next Topic: Showing Image on Image ..form deployed on web
Goto Forum:
  


Current Time: Fri Sep 20 13:48:10 CDT 2024