Skip to content

Mantis #46258: Fix SOAP Service Argument Type Error – Fetch User Data for Roles#10506

Open
GitHamo wants to merge 1 commit intoILIAS-eLearning:release_9from
GitHamo:fix/46258-soap-service-ilUserXMLWriter-type-error
Open

Mantis #46258: Fix SOAP Service Argument Type Error – Fetch User Data for Roles#10506
GitHamo wants to merge 1 commit intoILIAS-eLearning:release_9from
GitHamo:fix/46258-soap-service-ilUserXMLWriter-type-error

Conversation

@GitHamo
Copy link
Contributor

@GitHamo GitHamo commented Nov 21, 2025

This PR addresses the issue outlined in Mantis ticket #46258, where a SOAP request to the getUsersForContainer endpoint was returning a SOAP-ENV:Server error due to an incorrect argument type.
The code has been updated to fetch user data instead of just user IDs for each role, resolving the type mismatch.


⚠️ PR is for release_9 but should be cherry-picked in release_10, release_11 and trunk.


CURL example Replace placeholder values to your values:

curl --location 'http://<ILIAS_URL>/webservice/soap/server.php' \
--header 'SOAPAction;' \
--header 'Content-Type: text/xml; charset=utf-8' \
--data '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:ilUserAdministration">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:getUsersForContainer soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <sid xsi:type="xsd:string"><REPLACE_WITH_SID>::<REPLACE_WITH_CLIENT_NAME></sid>
         <ref_id xsi:type="xsd:int"><REPLACE_WITH_EXISTING_REF_ID></ref_id>
         <attach_roles xsi:type="xsd:int">1</attach_roles>
         <active xsi:type="xsd:int">1</active>
      </urn:getUsersForContainer>
   </soapenv:Body>
</soapenv:Envelope>
'

Test Steps:

  • Enable SOAP on the ILIAS server.
  • Make a SOAP request with the following body:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:ilUserAdministration">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:getUsersForContainer soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <sid xsi:type="xsd:string">REPLACE_WITH_SID::REPLACE_WITH_CLIENT_NAME</sid>
         <ref_id xsi:type="xsd:int">REPLACE_WITH_EXISTING_REF_ID</ref_id>
         <attach_roles xsi:type="xsd:int">1</attach_roles>
         <active xsi:type="xsd:int">1</active>
      </urn:getUsersForContainer>
   </soapenv:Body>
</soapenv:Envelope>

Expected Result:

A 200 OK response with the following XML:

<ns1:getUsersForContainerResponse><user_xml xsi:type="xsd:string">ENCODED_XML</user_xml></ns1:getUsersForContainerResponse>

Actual Result Before Fix:

The request results in the following error:

<SOAP-ENV:Fault>
    <faultcode>SOAP-ENV:Server</faultcode>
    <faultstring>ilUserXMLWriter::__handleUser(): Argument #1 ($row) must be of type array, int given, called in /var/www/html/ilias9/Services/User/classes/class.ilUserXMLWriter.php on line 82</faultstring>
</SOAP-ENV:Fault>

@sKarki999
Copy link
Contributor

Hi @GitHamo ,

Thanks for the PR. I have tested. Looks good to me. However, since we are not fixing for release 9 anymore, but this occurs in latest versions, we will need to pick this to other versions. Will you provide PRs for ilias 10, 11 and trunk ?
Thank you :)

Kind regards,
Sagun

@GitHamo
Copy link
Contributor Author

GitHamo commented Mar 23, 2026

@sKarki999 I have created a PR #11315 for trunk, then we could cherry-pick it in ilias_10 and ilias_11, then close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants