1 /**
2 * Copyright © DiamondMVC 2019
3 * License: MIT (https://github.com/DiamondMVC/Diamond/blob/master/LICENSE)
4 * Author: Jacob Jensen (bausshf)
5 */
6 module diamond.web.soap.service.message;
7 
8 import diamond.web.soap.service.parameter;
9 
10 package(diamond.web.soap.service):
11 /// Wrapper around a soap message.
12 final class SoapMessage
13 {
14   private:
15   /// The input name.
16   string _inputName;
17   /// The output name.
18   string _outputName;
19   /// The input parameters.
20   SoapParameter[] _inputParameters;
21   /// The output parameter.
22   SoapParameter _outputParameter;
23 
24   public:
25   final:
26   /**
27   * Creates a new soap message.
28   * Params:
29   *   inputName =  The name of the input mesage.
30   *   outputName = The name of the output message.
31   */
32   this(string inputName, string outputName)
33   {
34     _inputName = inputName;
35     _outputName = outputName;
36   }
37 
38   /**
39   * Adds an input parameter to the message.
40   * Params:
41   *   name = The name of the input parameter.
42   *   type = The type of the input parameter.
43   */
44   void addInputParameter(string name, string type)
45   {
46     _inputParameters ~= new SoapParameter(name, type);
47   }
48 
49   @property
50   {
51     /// Gets the input name.
52     string inputName() { return _inputName; }
53 
54     /// Gets the output name.
55     string outputName() { return _outputName; }
56 
57     /// Gets the input parameters.
58     SoapParameter[] input() { return _inputParameters; }
59 
60     /// Gets the output parameter.
61     SoapParameter output() { return _outputParameter; }
62 
63     /// Sets the output parameter.
64     void output(SoapParameter newOutput)
65     {
66       _outputParameter = newOutput;
67     }
68   }
69 }