by A W.
Hi Eloy,
Thanks for the post. To test your theory I tried using the working code but just changed the label 'enrolements' to 'NOTenrolments' i.e.
$enrols[] = $enrolobj;
$params = array('NOTenrolments' => $enrols);
and that alone stopped it working (same error as before) so clearly the label has to exact.
I think the take away IMHO is that maybe the error message could be improved, as in if you see:
[faultString] => Invalid parameter value detected | DEBUG INFO: enrolments => Invalid parameter value detected: Missing required key in single structure: roleid | ERRORCODE: invalidparameterI'm not sure its obvious that the issue is actually that you need a top level array label rather than an issue with the roleid.
Anyway thanks for the input folks, hopefully this post will help some people in the future
Cheers,
Alex