Home » Developer & Programmer » Forms » Call procedure inside package
Call procedure inside package [message #184083] Tue, 25 July 2006 04:46 Go to next message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
Hi,
In my form I imported some Java classes. As a result of this , some program units were added to the form. There are some packages. I want to call one procedure which is in one of the packages in my form. example..callwebsvc package has a procedure called CallWebService.In when-button-pressed od one of the items, I want to call this procedure and pass a parameter into it.
How can I do it?Kindly help.

[Updated on: Tue, 25 July 2006 04:47]

Report message to a moderator

Re: Call procedure inside package [message #184089 is a reply to message #184083] Tue, 25 July 2006 05:06 Go to previous messageGo to next message
pragatimathur
Messages: 42
Registered: July 2006
Location: DELHI
Member
To call the procedure of the package
write down, packagename.procedure(parameter);
for eg :callwebsvc.callwebservice('abc');
Re: Call procedure inside package [message #184098 is a reply to message #184089] Tue, 25 July 2006 06:23 Go to previous messageGo to next message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
Hi,
The package is like this:
PACKAGE BODY CallWebSvc IS

--
-- DO NOT EDIT THIS FILE - it is machine generated!
--

args JNI.ARGLIST;

-- Constructor for signature ()V
FUNCTION new RETURN ORA_JAVA.JOBJECT IS
BEGIN
args := NULL;
RETURN (JNI.NEW_OBJECT('soa/CallWebSvc', '()V', args));
END;

-- Method: main ([Ljava/lang/String;)V
PROCEDURE main(
a0 ORA_JAVA.JARRAY) IS
BEGIN
args := JNI.CREATE_ARG_LIST(1);
JNI.ADD_OBJECT_ARG(args, a0, '[Ljava/lang/String;');
JNI.CALL_VOID_METHOD(TRUE, NULL, 'soa/CallWebSvc', 'main', '([Ljava/lang/String;)V', args);
END;

-- Method: CallWebService (Ljava/lang/String;)V
PROCEDURE CallWebService(
obj ORA_JAVA.JOBJECT,
a0 VARCHAR2) IS
BEGIN
args := JNI.CREATE_ARG_LIST(1);
JNI.ADD_STRING_ARG(args, a0);
JNI.CALL_VOID_METHOD(FALSE, obj, 'soa/CallWebSvc', 'CallWebService', '(Ljava/lang/String;)V', args);
END;


BEGIN
NULL;
END;



In the when-button-pressed of one item I wrote,
CALLWEBSVC.CallWebService(xmlData);

It says:
Wrong number or types of arguments in call to CALLWEBSERVICE

xmldata is a form builder variable which has all the form data in XML format. I want to pass this data in XML format to call webservice.


Kindly guide me.



Re: Call procedure inside package [message #184224 is a reply to message #184098] Tue, 25 July 2006 15:11 Go to previous message
RJ.Zijlstra
Messages: 104
Registered: December 2005
Location: Netherlands - IJmuiden
Senior Member
Hi,
I read

'PROCEDURE CallWebService(obj ORA_JAVA.JOBJECT,a0 VARCHAR2)'

so I suppose one should call the procedure as follows:

CallWebService( A,B) and not like CallWebService(A).

I don't know much of Java, but it seems logical...

Regards

Rob Zijlstra
Previous Topic: Only one CheckBox should be checked at a time.
Next Topic: Problem on Combo Box
Goto Forum:
  


Current Time: Sat Dec 10 16:37:29 CST 2016

Total time taken to generate the page: 0.13026 seconds