Function in form [message #189567] |
Fri, 25 August 2006 02:27  |
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 #191729 is a reply to message #189567] |
Fri, 08 September 2006 00:03  |
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
|
|
|