PL/SQL Web Service: return object with object containing an array
Date: Fri, 29 Oct 2004 13:40:53 +0200
Message-ID: <clta85$9um$1_at_news.tue.nl>
hello,
I'm trying to creat a PL/SQL Web Service using JDeveloper 10g. It's intended to return the following structure:
array 1 (of objects)
object - array 2 (of objects) object object ......... object - array 2 object object .........
When I generate the Web Service in JDeveloper it doens't recognize the array
2.
Is it possible to return such a structure?
See the attached code for more info.
Thanks in advance!
Dictis2
create type status as object(o_status_id number(3), o_status_omschr_kort
varchar2(20));
/
create type tt_alg01ws1_statussen is table of to_alg01ws1_status;
/
create type beheerder as object(o_beheerder_id number(3), o_beheerder_naam
varchar2(50), o_statussen tt_alg01ws1_statussen);
/
create type tt_alg01ws0_beheerders is table of to_alg01ws0_beheerder;
/
create package alg01_ws as
function f_alg01ws return tt_alg01ws0_beheerders;
end alg01_ws;
/
create package body alg01_ws as
function f_alg01ws return tt_alg01ws0_beheerders is out tt_alg01ws0_beheerders;
o_statussen tt_alg01ws1_statussen := tt_alg01ws1_statussen(); o_beheerders tt_alg01ws0_beheerders:= tt_alg01ws0_beheerders(); o_beheerder to_alg01ws0_beheerder;
i number;
j number;
cursor c_alg01_1 is
select *
from bit_xbeheerders xbr
order by xbr.beheerder_id;
cursor c_alg01_2(beheerder_id number) is
select *
from bit_xstatussen xss
where xss.xbr_beheerder_id = beheerder_id
order by xss.status_id;
out_c_alg01_1 c_alg01_1%rowtype;
out_c_alg01_2 c_alg01_2%rowtype;
begin
j := 0;
open c_alg01_1;
fetch c_alg01_1 into out_c_alg01_1; while c_alg01_1%found loop i := 0; open c_alg01_2(out_c_alg01_1.beheerder_id); fetch c_alg01_2 into out_c_alg01_2; while c_alg01_2%found loop i := i + 1; o_statussen.extend; o_statussen(i) :=to_alg01ws1_status(out_c_alg01_2.status_id, out_c_alg01_2.status_omschr_kort); fetch c_alg01_2 into out_c_alg01_2; end loop;
close c_alg01_2;
o_beheerder :=to_alg01ws0_beheerder(out_c_alg01_1.beheerder_id, out_c_alg01_1.beheerder_naam, o_statussen); o_statussen.delete;
fetch c_alg01_1 into out_c_alg01_1;
end loop;
out := o_beheerder;
close c_alg01_1;
return out;
end f_alg01ws;
end alg01_ws;
/
Received on Fri Oct 29 2004 - 13:40:53 CEST