File: soap_hotplug_pack_service-cb.adb

package info (click to toggle)
libaws 20.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 16,656 kB
  • sloc: ada: 95,505; python: 2,270; ansic: 1,017; makefile: 829; xml: 235; javascript: 202; java: 112; sh: 106
file content (100 lines) | stat: -rw-r--r-- 2,834 bytes parent folder | download | duplicates (6)
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

--  wsdl2aws SOAP Generator v1.4
--
--  AWS 2.1w - SOAP 1.3
--  This file was generated on Sunday 31 October 2004 at 10:58:27
--
--  $ wsdl2aws -f -cvs -cb -types soap_hotplug_pack.ads soap_hotplug_pack.ads.wsdl

with Ada.Exceptions;

with SOAP.Message.Response.Error;

with SOAP_hotplug_pack;

with SOAP_Hotplug_Pack_Service.Server;
with SOAP_Hotplug_Pack_Service.Types;

package body SOAP_Hotplug_Pack_Service.CB is

   use Ada.Exceptions;
   use SOAP;

   pragma Warnings (Off, SOAP_Hotplug_Pack_Service.Server);
   pragma Warnings (Off, SOAP_Hotplug_Pack_Service.Types);

   pragma Style_Checks (Off);

   function Job1_CB is
     new SOAP_Hotplug_Pack_Service.Server.Job1_CB (SOAP_hotplug_pack.Job1);

   function Job2_CB is
     new SOAP_Hotplug_Pack_Service.Server.Job2_CB (SOAP_hotplug_pack.Job2);

   -------------
   -- SOAP_CB --
   -------------

   function SOAP_CB
     (SOAPAction : String;
      Payload    : Message.Payload.Object;
      Request    : AWS.Status.Data)
      return Response.Data is
   begin
      if SOAPAction = "Job1" then
         return Job1_CB (SOAPAction, Payload, Request);

      elsif SOAPAction = "Job2" then
         return Job2_CB (SOAPAction, Payload, Request);

      else
         return Message.Response.Build
           (Message.Response.Error.Build
             (Message.Response.Error.Client,
              "Wrong SOAP action " & SOAPAction));
      end if;
   exception
      when E : others =>
         return Message.Response.Build
           (Message.Response.Error.Build
             (Message.Response.Error.Client,
              "Error in SOAP_CB for SOAPAction " & SOAPAction
                & " (" & Exception_Information (E) & ")"));
   end SOAP_CB;

   ---------------------
   -- SOAP_Hotplug_CB --
   ---------------------

   function SOAP_Hotplug_CB
     (SOAPAction : String;
      Payload    : Message.Payload.Object;
      Request    : AWS.Status.Data)
      return Response.Data
   is
      P : Message.Payload.Object := Payload;
   begin
      if SOAPAction = "Job1" then
         Message.Payload.Set_Procedure_Name (P, "Job2");
         return Job2_CB ("Job2", P, Request);

      elsif SOAPAction = "Job2" then
         Message.Payload.Set_Procedure_Name (P, "Job1");
         return Job1_CB ("Job1", P, Request);

      else
         return Message.Response.Build
           (Message.Response.Error.Build
             (Message.Response.Error.Client,
              "Wrong SOAP action " & SOAPAction));
      end if;
   exception
      when E : others =>
         return Message.Response.Build
           (Message.Response.Error.Build
             (Message.Response.Error.Client,
              "Error in SOAP_CB for SOAPAction " & SOAPAction
                & " (" & Exception_Information (E) & ")"));
   end SOAP_Hotplug_CB;

end SOAP_Hotplug_Pack_Service.CB;