[AWS] SOAP arrays
Pascal Obry
p.obry@wanadoo.fr
Tue, 8 Apr 2003 17:36:38 +0200
Darren,
> I do not quite understand how to use SOAP_arrays and was hoping for some
> guidance.
>
> I am creating a web service which needs to send its result as an array of
> records. (I have already succesfully created a service to send a record as
> its result).
> I need to create a SOAP_array of SOAP_records. Is this possible?
Yes it is. Here is how to do it:
To build a SOAP_Array you need first to build an Object_Set. The SOAP_Array
construction is SOAP.Types.A.
So in your case you need to declare something like:
Items : Object_Set (1 .. Max_Results);
Now, every Item is an Object_Safe_Pointer. You build such type using the "+"
function on an Object'Class. Every SOAP types are derived from
SOAP.Types.Object. For example:
Items (1) := +I (12, "int_value");
You said you know how to build a SOAP_Record. Let's say that My_Record is one
of your SOAP_Record:
Items (2) := +My_Record;
Last step is to build the array:
My_Array : constant SOAP_Array := A (Items, "my_array");
(All this has not been compiled, I hope there is no typos).
Let me know if this is not clear.
Note that AWS 1.4 will have a WSDL parser/generator, all this will be
transparent. wsdl2aws is a tool that takes a WSDL document and generate all
the code needed to call the Web Service or to build the Web Service server.
Pascal.
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595