}
// Only create the payload if it was not created previously
+ /// @todo what if the request's payload was created with a different encoding?
if (empty($req->payload)) {
$req->serialize($this->request_charset_encoding);
}
$this->accepted_charset_encodings = array('UTF-8', 'ISO-8859-1', 'US-ASCII');
// dispMap is a dispatch array of methods mapped to function names and signatures.
- // If a method doesn't appear in the map then an unknown method error is generated
- /* milosch - changed to make passing dispMap optional.
- * instead, you can use the class add_to_map() function
- * to add functions manually (borrowed from SOAPX4)
- */
+ // If a method doesn't appear in the map then an unknown method error is generated.
+ // milosch - changed to make passing dispMap optional. Instead, you can use the class add_to_map() function
+ // to add functions manually (borrowed from SOAPX4)
if ($dispatchMap) {
- $this->dmap = $dispatchMap;
+ $this->setDispatchMap($dispatchMap);
if ($serviceNow) {
$this->service();
}
/// @todo try to move this injection to the resp. constructor or use a non-deprecated access method. Or, even
/// better: just avoid setting this, and set debug info of the received http request in the request
/// object instead? It's not like the developer misses access to _SERVER, _COOKIES though...
+ /// Last but not least: the raw data might be of use to handler functions - but in decompressed form...
$resp->raw_data = $rawData;
}
}
// Do not create response serialization if it has already happened. Helps to build json magic
+ /// @todo what if the payload was created targeting a different charset than $respCharset?
if (empty($resp->payload)) {
$resp->serialize($respCharset);
}
}
+ /**
+ * @param array $dmap
+ * @return $this
+ */
+ public function setDispatchMap($dmap)
+ {
+ $this->dmap = $dmap;
+ return $this;
+ }
+
/**
* @return array[]
*/
/**
* Returns the xml representation of the value. XML prologue not included.
*
- * @param string $charsetEncoding the charset to be used for serialization. if null, US-ASCII is assumed
+ * @param string $charsetEncoding the charset to be used for serialization. If null, US-ASCII is assumed
* @return string
*/
public function serialize($charsetEncoding = '')