f00b4r / nusoap

:smirk: Fixed NuSOAP for PHP 5.6 - 8.2
https://f00b4r.github.io/nusoap/
320 stars 356 forks source link

Migrating from PHP Soap module: Cannot use stdclass as array #111

Open qroac opened 1 year ago

qroac commented 1 year ago

On request of a user I started migrating my Nextcloud auth app for ISPConfig from php-soap to this library. https://github.com/SpicyWeb-de/nextcloud-user-ispconfig/issues/13 Without depending on php-soap, the app can be more easily used in shared hosting environments, so I see nusoap as big enhancement.

Migration went quite smooth so far. I struggle just with one API call that is required to change users passwords. The server responds with

array(2) {
  ["faultcode"]=>
  string(15) "SOAP-ENV:Server"
  ["faultstring"]=>
  string(43) "Cannot use object of type stdClass as array"
}

Here is my migration:

// Original call
// $rowsUpdated = $this->soap->mail_user_update($this->session, $remoteUid, $mailuser['mailuser_id'], $params);
// nusoap call
$rowsUpdated = $this->nusoap->call('mail_user_update', [$this->nusession, $remoteUid, $mailuser['mailuser_id'], $mailuser]);
var_dump($rowsUpdated);

This appears only with the nusoap call. the php-soap call still works as expected. Do you have any Idea what could cause this problem or what I can do to fix it?

This is a var_dump of the params given to the nusoap call. I cannot see anything that looks line a std object.

array(4) {
  [0]=>
  string(32) "7199b31458b...session ID"
  [1]=>
  int(0)
  [2]=>
  string(3) "111"
  [3]=>
  array(41) {
    ["mailuser_id"]=>
    string(3) "111"
    ["sys_userid"]=>
    string(1) "1"
    ["sys_groupid"]=>
    string(1) "2"
    ["sys_perm_user"]=>
    string(4) "riud"
    ["sys_perm_group"]=>
    string(4) "riud"
    ["sys_perm_other"]=>
    string(0) ""
    ["server_id"]=>
    string(1) "3"
    ["email"]=>
    string(17) "some@mail.box"
    ["login"]=>
    string(17) "some@mail.box"
    ["password"]=>
    string(10) "newPassword"
    ["name"]=>
    string(4) "someMailbox"
    ["uid"]=>
    string(4) "5000"
    ["gid"]=>
    string(4) "5000"
    ["maildir"]=>
    string(28) "/var/vmail/mail.box/some"
    ["maildir_format"]=>
    string(7) "maildir"
    ["quota"]=>
    string(1) "0"
    ["cc"]=>
    string(0) ""
    ["sender_cc"]=>
    string(0) ""
    ["homedir"]=>
    string(10) "/var/vmail"
    ["autoresponder"]=>
    string(1) "n"
    ["autoresponder_start_date"]=>
    NULL
    ["autoresponder_end_date"]=>
    NULL
    ["autoresponder_subject"]=>
    string(19) "Out of office reply"
    ["autoresponder_text"]=>
    string(0) ""
    ["move_junk"]=>
    string(1) "n"
    ["custom_mailfilter"]=>
    NULL
    ["postfix"]=>
    string(1) "y"
    ["greylisting"]=>
    string(1) "n"
    ["access"]=>
    string(1) "y"
    ["disableimap"]=>
    string(1) "n"
    ["disablepop3"]=>
    string(1) "n"
    ["disabledeliver"]=>
    string(1) "n"
    ["disablesmtp"]=>
    string(1) "n"
    ["disablesieve"]=>
    string(1) "n"
    ["disablesieve-filter"]=>
    string(1) "n"
    ["disablelda"]=>
    string(1) "n"
    ["disablelmtp"]=>
    string(1) "n"
    ["disabledoveadm"]=>
    string(1) "n"
    ["last_quota_notification"]=>
    NULL
    ["backup_interval"]=>
    string(4) "none"
    ["backup_copies"]=>
    string(1) "1"
  }
}