SoapFormat.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2020 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of the MIT License.
7  *
8  * See the LICENSE file distributed with this work for
9  * additional information.
10  */
12 
16 
17 /**
18  * SoapFormat implements the SOAP request/response format. Nodes are serialized
19  * into an array (the nusoap library creates the XML).
20  *
21  * @author ingo herwig <ingo@wemove.com>
22  */
24 
25  protected $serializer = null;
26 
27  /**
28  * Constructor
29  * @param $serializer NodeSerializer instance
30  */
32  $this->serializer = $serializer;
33  }
34 
35  /**
36  * @see Format::getMimeType()
37  */
38  public function getMimeType(Response $response=null) {
39  return 'application/soap+xml';
40  }
41 
42  /**
43  * @see Format::isCached()
44  */
45  public function isCached(Response $response) {
46  return false;
47  }
48 
49  /**
50  * @see Format::getCacheDate()
51  */
52  public function getCacheDate(Response $response) {
53  return null;
54  }
55 
56  /**
57  * Set the NodeSerializer instance to use
58  * @param $serializer NodeSerializer
59  */
61  $this->serializer = $serializer;
62  }
63 
64  /**
65  * @see HierarchicalFormat::isSerializedNode()
66  */
67  protected function isSerializedNode($value) {
68  return $this->serializer->isSerializedNode($value);
69  }
70 
71  /**
72  * @see HierarchicalFormat::serializeNode()
73  */
74  protected function serializeNode($value) {
75  $node = $this->serializer->serializeNode($value);
76  return $node;
77  }
78 
79  /**
80  * @see HierarchicalFormat::deserializeNode()
81  */
82  protected function deserializeNode($value) {
83  $result = $this->serializer->deserializeNode($value);
84  return $result;
85  }
86 }
87 ?>
Response holds the response values that are used as output from Controller instances.
Definition: Response.php:20
SoapFormat implements the SOAP request/response format.
Definition: SoapFormat.php:23
NodeSerializer implementations are used to serialize Nodes into an array representation or deserializ...
HierarchicalFormat is used as base class for formats that are able to represent hierarchical data lik...
setSerializer(NodeSerializer $serializer)
Set the NodeSerializer instance to use.
Definition: SoapFormat.php:60
__construct(NodeSerializer $serializer)
Constructor.
Definition: SoapFormat.php:31