/usr/share/ada/adainclude/aws/soap-message.adb is in libaws3.3.2.2-dev 17.2.2017-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | ------------------------------------------------------------------------------
-- Ada Web Server --
-- --
-- Copyright (C) 2000-2015, AdaCore --
-- --
-- This library is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
-- Free Software Foundation; either version 3, or (at your option) any --
-- later version. This library is distributed in the hope that it will be --
-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
------------------------------------------------------------------------------
with SOAP.Types;
package body SOAP.Message is
----------------
-- Name_Space --
----------------
function Name_Space (M : Object'Class) return SOAP.Name_Space.Object is
begin
return M.Name_Space;
end Name_Space;
----------------
-- Parameters --
----------------
function Parameters (M : Object'Class) return SOAP.Parameters.List is
begin
return M.P;
end Parameters;
--------------------
-- Set_Name_Space --
--------------------
procedure Set_Name_Space
(M : in out Object'Class;
NS : SOAP.Name_Space.Object) is
begin
M.Name_Space := NS;
end Set_Name_Space;
--------------------
-- Set_Parameters --
--------------------
procedure Set_Parameters
(M : in out Object'Class;
P_Set : SOAP.Parameters.List) is
begin
M.P := P_Set;
end Set_Parameters;
----------------------
-- Set_Wrapper_Name --
----------------------
procedure Set_Wrapper_Name
(M : in out Object'Class;
Name : String) is
begin
M.Wrapper_Name := To_Unbounded_String (Name);
end Set_Wrapper_Name;
------------------
-- Wrapper_Name --
------------------
function Wrapper_Name (M : Object'Class) return String is
begin
return To_String (M.Wrapper_Name);
end Wrapper_Name;
---------------
-- XML_Image --
---------------
function XML_Image
(M : Object;
Schema : WSDL.Schema.Definition := WSDL.Schema.Empty)
return Unbounded_String
is
use type WSDL.Schema.Binding_Style;
procedure Add_Namespace (NS : SOAP.Name_Space.Object);
procedure Add_Namespaces (O : Types.Object'Class);
-- Add name space reference into Message_Header
New_Line : constant String := ASCII.CR & ASCII.LF;
NS : constant SOAP.Name_Space.Object := Name_Space (M);
NS_Name : constant String :=
SOAP.Name_Space.Name (NS);
Encoding : constant Types.Encoding_Style :=
WSDL.Schema.Get_Encoding_Style
(Schema, To_String (M.Wrapper_Name));
Style : constant WSDL.Schema.Binding_Style :=
WSDL.Schema.Get_Binding_Style (Schema);
Message_Header : Unbounded_String;
Message_Body : Unbounded_String;
Message_NS : Unbounded_String;
--------------------
-- Add_Namespaces --
--------------------
procedure Add_Namespace (NS : SOAP.Name_Space.Object) is
use SOAP.Name_Space;
begin
if NS /= No_Name_Space
and then NS /= SOAP.Name_Space.AWS
and then Index
(Message_NS, ':' & SOAP.Name_Space.Name (NS) & '=') = 0
then
if Message_NS /= Null_Unbounded_String then
Append (Message_NS, New_Line);
end if;
Append (Message_NS, " " & Image (NS));
end if;
end Add_Namespace;
--------------------
-- Add_Namespaces --
--------------------
procedure Add_Namespaces (O : Types.Object'Class) is
use SOAP.Types;
NS : constant SOAP.Name_Space.Object := Types.Name_Space (O);
begin
Add_Namespace (NS);
-- If this is a composite object, check components
if O in Types.Composite'Class then
declare
OS : constant Object_Set := V (Composite'Class (O));
begin
for K in OS'Range loop
Add_Namespaces (-OS (K));
end loop;
end;
end if;
end Add_Namespaces;
begin
-- Procedure
-- We are called with the Body node opened
if Style = WSDL.Schema.RPC then
Append (Message_Header, '>' & New_Line);
Append (Message_Header, '<');
if NS_Name /= "" then
Append (Message_Header, NS_Name & ':');
end if;
Append (Message_Header, Wrapper_Name (M));
else
-- Namespaces are to be put into the Body node
Append (Message_Header, New_Line);
end if;
if SOAP.Name_Space.Value (NS) /= "" then
Append (Message_NS, " xmlns");
if NS_Name /= "" then
Append (Message_NS, ":" & NS_Name);
end if;
Append
(Message_NS,
"=""" & SOAP.Name_Space.Value (NS) & """");
end if;
-- Procedure's parameters
declare
P : constant SOAP.Parameters.List := Parameters (M);
begin
for K in 1 .. SOAP.Parameters.Argument_Count (P) loop
Add_Namespaces (SOAP.Parameters.Argument (P, K));
Types.XML_Image
(SOAP.Parameters.Argument (P, K), Message_Body,
Encoding, Schema);
Append (Message_Body, New_Line);
end loop;
-- User's Namespaces
for K in 1 .. M.Index loop
Add_Namespace (M.Users_NS (K));
end loop;
end;
Append (Message_NS, ">" & New_Line);
-- Close payload objects
if Style = WSDL.Schema.RPC then
Append (Message_Body, "</");
if NS_Name /= "" then
Append (Message_Body, NS_Name & ':');
end if;
Append (Message_Body, Wrapper_Name (M));
Append (Message_Body, ">" & New_Line);
end if;
return Message_Header & Message_NS & Message_Body;
end XML_Image;
end SOAP.Message;
|