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&#39;ve created a signature that looks like this:<br><br>signature&#39; =
=3D&gt;=20
array(array($xmlrpcArray, $xmlrpcInt, $xmlrpcInt, $xmlrpcString,=20
$xmlrpcInt, $xmlrpcInt))),<br><br>and set=A0 $GLOBALS[&#39;xmlrpc_null_exte=
nsion&#39;]=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&#39;t be passed t=
o
 a no-nil parameter? What&#39;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>&lt;x=
ml&gt;<br>&lt;methodCall&gt;<br>=A0
 &lt;methodName&gt;gymlog.getExercises&lt;/methodName&gt; <br>
&lt;params&gt;<br>&lt;param&gt;<br>&lt;value&gt;<br>=A0=20
&lt;int&gt;62&lt;/int&gt; <br>=A0 &lt;/value&gt;<br>=A0 &lt;/param&gt;<br>&=
lt;param&gt;<br>&lt;value&gt;<br>=A0
 &lt;int&gt;2&lt;/int&gt; <br>=A0 &lt;/value&gt;<br>=A0 &lt;/param&gt;<br>
<b>&lt;param&gt;<br>&lt;value&gt;<br>=A0 &lt;nil /&gt; <br>=A0=20
&lt;/value&gt;<br>=A0 &lt;/param&gt;<br></b>&lt;param&gt;<br>&lt;value&gt;<=
br>=A0
 &lt;int&gt;0&lt;/int&gt; <br>=A0 &lt;/value&gt;<br>=A0 &lt;/param&gt;<br>&=
lt;param&gt;<br>
&lt;value&gt;<br>=A0 &lt;int&gt;10&lt;/int&gt; <br>=A0 &lt;/value&gt;<br>=
=A0=20
&lt;/param&gt;<br>=A0 &lt;/params&gt;<br>=A0 &lt;/methodCall&gt;<br>&lt;/xm=
l&gt;<br><br><b>The
 response:<br></b><br>&lt;?xml version=3D&quot;1.0&quot;?&gt;<br>
&lt;methodResponse&gt;<br>&lt;fault&gt;<br>&lt;value&gt;<br>&lt;struct&gt;&=
lt;member&gt;&lt;name&gt;faultCode&lt;/name&gt;<br>&lt;value&gt;&lt;int&gt;=
15&lt;/int&gt;&lt;/value&gt;<br>&lt;/member&gt;<br>&lt;member&gt;<br>&lt;na=
me&gt;faultString&lt;/name&gt;<br>

&lt;value&gt;&lt;string&gt;Invalid request payload found not-xmlrpc xml=20
element NIL&lt;/string&gt;&lt;/value&gt;<br>&lt;/member&gt;<br>&lt;/struct&=
gt;<br>&lt;/value&gt;<br>&lt;/fault&gt;<br>&lt;/methodResponse&gt;</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==--