/** * Store avatar picture * @param int $a_vuserid * @param array $a_file_info array('name' => filename, 'type' => 0|1, 'file' => path) */ public function storeAvatar($a_vuserid, $a_file_info) { try { $this->initClient('cid:myid', $a_file_info['file']); $avatar = new stdClass(); $avatar->userid = $a_vuserid; $payload = '<ns1:storeAvatarRequest xmlns:ns1="http://www.vitero.de/schema/mtom">' . '<ns1:userid>' . $a_vuserid . '</ns1:userid>' . '<ns1:filename>' . $a_file_info['name'] . '</ns1:filename>' . '<ns1:type>' . $a_file_info['type'] . '</ns1:type>' . '<ns1:file><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:myid"/></ns1:file>' . '</ns1:storeAvatarRequest>'; $message = new WSMessage($payload, array('inputHeaders' => array(ilViteroSoapWsseAuthHeader::getWSFHeader($this->getSettings()->getAdminUser(), $this->getSettings()->getAdminPass())), 'attachments' => array('myid' => file_get_contents($a_file_info['file'])))); $resp = $this->client->request($message); } catch (Exception $e) { $GLOBALS['ilLog']->write(__METHOD__ . ': ' . $e->getMessage()); $GLOBALS['ilLog']->write(__METHOD__ . ': Last Request: ' . $this->client->getLastRequest()); $GLOBALS['ilLog']->write(__METHOD__ . ': Last Response: ' . $this->client->getLastResponse()); #throw new ilViteroConnectorException($e->getMessage(),0); } }