I have this method Answers, that uses this struct:
struct PCLAnswersReq
Members
string | UserName
integer | SessionID
array of struct PCLAnswerUnit | Answers
the struct PCLAnswerUnit looks like:
Members
integer | QuestionID
string | Answer
So the PCLAnswersReq has the username, sessionID, and an array of the structure PCLAnswerUnit,which is fine, but I can’t seem to work out how to get that second struct in.
My request (using php xml-rpc) looks like this:
xmlrpc_encode_request('PCLAnswers', array("UserName"=>$uname,"SessionID"=>$sesid,"Answers"=>xmlrpc_encode_request('PCLAnswerUnit',array("QuestionID"=>'',"Answer"=>$questions))));
This of course is causing a fault:
"request contains string value where array expected [request : parameter 1 : struct mapped to type PCLAnswersReq : member Answers mapped to type PCLAnswerUnit[]]"
I tried removing the second xmlrpc request, and just pointing Answers to an array of QuestionID and Answer, but that did not work either.
Any guidance is helpful.
Thanks!
‘UPDATE’
When the xml-rpc request is modified to this:
xmlrpc_encode_request('PCLAnswers', array("UserName"=>$uname,"SessionID"=>$sesid,"Answers"=>array()));
it works fine. However, when I pass it the array of ‘$questions’ it fails again.
The signature of the input method on the server should be in this order:
return_type,xmlrpcString,xmlrpcString,xmlrpcArray
You probably have it mixed up somewhere. The return type is first followed by your three parameters.