passing null to a method
Christian <[email protected]> Tue, 30 Mar 2010 02:34:20 +0200
| Newsgroups | gmane.comp.php.xml-rpc |
|---|---|
| Message-ID | <[email protected]> |
--===============0020167872== Content-Type: multipart/alternative; boundary=001517588ca45eaeef0482f9caec --001517588ca45eaeef0482f9caec Content-Type: text/plain; charset=ISO-8859-1 I've created a signature that looks like this: signature' => array(array($xmlrpcArray, $xmlrpcInt, $xmlrpcInt, $xmlrpcString, $xmlrpcInt, $xmlrpcInt))), and set $GLOBALS['xmlrpc_null_extension']=true to enable null-value parameters. I would like to fill only some of the parameteres. So I try to pass null values to the method. But xml-rpc says that null can't be passed to a no-nil parameter? What's the use for null parameteres then? It seems that I need to make an empty signature to be able to pass variable number of parameteres? But I would prefer a signature that validates the input. So in short: Is it really not legal to pass nil values to a non-nil signature parameter? Thanks in advance. Barsum *My request: * <xml> <methodCall> <methodName>gymlog.getExercises</methodName> <params> <param> <value> <int>62</int> </value> </param> <param> <value> <int>2</int> </value> </param> *<param> <value> <nil /> </value> </param> *<param> <value> <int>0</int> </value> </param> <param> <value> <int>10</int> </value> </param> </params> </methodCall> </xml> *The response: * <?xml version="1.0"?> <methodResponse> <fault> <value> <struct><member><name>faultCode</name> <value><int>15</int></value> </member> <member> <name>faultString</name> <value><string>Invalid request payload found not-xmlrpc xml element NIL</string></value> </member> </struct> </value> </fault> </methodResponse> --001517588ca45eaeef0482f9caec Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I've created a signature that looks like this:<br><br>signature' = =3D>=20 array(array($xmlrpcArray, $xmlrpcInt, $xmlrpcInt, $xmlrpcString,=20 $xmlrpcInt, $xmlrpcInt))),<br><br>and set=A0 $GLOBALS['xmlrpc_null_exte= nsion']=3Dtrue to enable null-value parameters.<br><div id=3D":5g" class=3D"ii gt"> <br>I would like to fill only some of the parameteres. So I try to pass=20 null values to the method. But xml-rpc says that null can't be passed t= o a no-nil parameter? What's the use for null parameteres then?<br><br> It seems that I need to make an empty signature to be able to pass=20 variable number of parameteres? But I would prefer a signature that=20 validates the input.<br><br>So in short: Is it really not legal to pass=20 nil values to a non-nil signature parameter?<br> <br>Thanks in advance.<br>Barsum<br><br><br><b>My request:<br></b><br><x= ml><br><methodCall><br>=A0 <methodName>gymlog.getExercises</methodName> <br> <params><br><param><br><value><br>=A0=20 <int>62</int> <br>=A0 </value><br>=A0 </param><br>&= lt;param><br><value><br>=A0 <int>2</int> <br>=A0 </value><br>=A0 </param><br> <b><param><br><value><br>=A0 <nil /> <br>=A0=20 </value><br>=A0 </param><br></b><param><br><value><= br>=A0 <int>0</int> <br>=A0 </value><br>=A0 </param><br>&= lt;param><br> <value><br>=A0 <int>10</int> <br>=A0 </value><br>= =A0=20 </param><br>=A0 </params><br>=A0 </methodCall><br></xm= l><br><br><b>The response:<br></b><br><?xml version=3D"1.0"?><br> <methodResponse><br><fault><br><value><br><struct>&= lt;member><name>faultCode</name><br><value><int>= 15</int></value><br></member><br><member><br><na= me>faultString</name><br> <value><string>Invalid request payload found not-xmlrpc xml=20 element NIL</string></value><br></member><br></struct&= gt;<br></value><br></fault><br></methodResponse></div> --001517588ca45eaeef0482f9caec-- --===============0020167872== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ phpxmlrpc mailing list [email protected] http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc --===============0020167872==--