That's the kind of change I like: one line! The original code reflects =
my incomplete understanding of how call_user_func_array expects the =
paramarr to be formatted. Thanks.
Scott Nichol
Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message -----=20
From: "Andr=E9 Mamitzsch" <a.mamitzsch@...>
To: <nusoap-general@...>
Sent: Thursday, September 29, 2005 9:53 AM
Subject: Re: [Nusoap-general] Parameters in SOAP server function
> Scott,
>=20
> I did some more investigations on that issue. It can be solved easily, =
> the only prerequisite is that the paramaters are handed over as an =
array=20
> to the specific function.
>=20
> The problem is, that the soap function is called by the php command : =
> mixed *call_user_func_array* ( callback function, array param_arr )
>=20
> The parameters in the array are "flatened" if the handover to the=20
> function appears. If have modified the source code :
>=20
> --- nusoap.php.org 2005-08-04 18:53:00.000000000 +0200
> +++ nusoap.php 2005-09-29 15:45:42.960060450 +0200
> @@ -3606,7 +3606,7 @@
> $instance =3D new $class ();
> $call_arg =3D array(&$instance, =
$method);
> }
> - $this->methodreturn =3D=20
> call_user_func_array($call_arg, $this->methodparams);
> + $this->methodreturn =3D=20
> call_user_func_array($call_arg, array($this->methodparams));
> }
> $this->debug('in invoke_method, methodreturn:');
> $this->appendDebug($this->varDump($this->methodreturn));
>=20
> and the assoc array is passed to the php function and can be =
processed=20
> there. That's what I wanted to achieve, I can now do parameter checks=20
> based on their XML element names.
>=20
> Regards,
>=20
> Andre
>=20
>=20
> Scott Nichol schrieb:
>=20
> >Because of a limitation of the SOAP parser, the client must place the =
parameters in the array in the order in which the server expects them. =
The server does not attempt to match XML element names for the =
parameters to the names specified for the parameters in the =
->register(...) call.
> >
> >Scott Nichol
> >
> >Do not send e-mail directly to this e-mail address,
> >because it is filtered to accept only mail from
> >specific mail lists.
> >----- Original Message -----=20
> >From: <Mamitzsch>; "Andr=E9" <a.mamitzsch@...>
> >To: <nusoap-general@...>
> >Sent: Wednesday, September 28, 2005 5:29 AM
> >Subject: [Nusoap-general] Parameters in SOAP server function
> >
> >
> >Hi list,
> >
> >
> >I have a very basic problem with passing parameters to a soap server =
function. I' m using an assoc array to pass parameters and would expect =
that the sort order in this array is not significant. This does not seem =
to be true.
> >
> >I have tried to find a documentation reference about parameter =
handling, no success. I have also searched the mailing list archive, the =
only reference to this problem is from 2003 and nobody replied to it =
ever. ( http://sourceforge.net/mailarchive/message.php?msg_id=3D2959151)
> >
> >Example is shown here:=20
> >
> >
> >Server:
> >
> >include('./lib/nusoap.php');
> >
> >function test($ParId =3D "xx", $ParSeqReq =3D "yy", $ParSearch =3D =
"zz")
> > {
> > syslog(LOG_DEBUG, "##########################\n");
> > syslog(LOG_DEBUG, "ParId =3D $ParId \n");
> > syslog(LOG_DEBUG, "ParSeqReq =3D $ParSeqReq \n");
> > syslog(LOG_DEBUG, "ParSearch =3D $ParSearch \n");
> > syslog(LOG_DEBUG, "##########################\n");
> > }
> >
> >
> >$in =3D array( "ParId" =3D> "xsd:string",
> > "ParSeqReq" =3D> "xsd:string",
> > "ParSearch " =3D> "xsd:string");
> >$out =3D array();
> >
> >$soapServer =3D &new Soap_Server();
> >$soapServer->register("test", $in , $out, "http://host130/"); =
$soapServer->service($HTTP_RAW_POST_DATA);=20
> >
> >
> >
> >Client:
> >
> ><?php
> >
> >include('./lib/nusoap.php');
> >
> >$soapClient =3D &new =
SoapClient("http://192.168.10.130/soapDebug/soapServer.php");
> >$parameters =3D array
> > (
> > "ParSeqReq" =3D> "seq34",
> > "ParId" =3D> "123456",
> > "ParSearch " =3D> "soap");
> >
> >$soapClient->call("test", $parameters, "http://host130/");=20
> >
> >
> >In this case the output is:
> >
> >Sep 28 10:10:16 host130 apache: ##########################
> >Sep 28 10:10:16 host130 apache: ParId =3D seq34
> >Sep 28 10:10:16 host130 apache: ParSeqReq =3D 123456 Sep 28 10:10:16 =
host130 apache: ParSearch =3D soap Sep 28 10:10:16 host130 apache: =
##########################
> >
> >If I swap around the parameters in the client file to:
> >
> >$parameters =3D array
> > (
> > "ParId" =3D> "123456",
> > "ParSeqReq" =3D> "seq34",
> > "ParSearch " =3D> "soap");=20
> >
> >The output changes to:
> >
> >=20
> >Sep 28 10:19:50 host130 apache: ##########################
> >Sep 28 10:19:50 host130 apache: ParId =3D 123456
> >Sep 28 10:19:50 host130 apache: ParSeqReq =3D seq34 Sep 28 10:19:50 =
host130 apache: ParSearch =3D soap Sep 28 10:19:50 host130 apache: =
########################## =20
> >
> >
> >Has anybody got an idea?
> >
> >Thanks a lot for your help.
> >
> >Mit freundlichen Gr=FC=DFen,
> >Best regards,
> >=20
> >Andr=E9 Mamitzsch=20
> >
> >
> >-------------------------------------------------------
> >This SF.Net email is sponsored by:
> >Power Architecture Resource Center: Free content, downloads, =
discussions,
> >and more. http://solutions.newsforge.com/ibmarch.tmpl
> >_______________________________________________
> >Nusoap-general mailing list
> >Nusoap-general@...
> >https://lists.sourceforge.net/lists/listinfo/nusoap-general
> >
> >
> >
> >-------------------------------------------------------
> >This SF.Net email is sponsored by:
> >Power Architecture Resource Center: Free content, downloads, =
discussions,
> >and more. http://solutions.newsforge.com/ibmarch.tmpl
> >_______________________________________________
> >Nusoap-general mailing list
> >Nusoap-general@...
> >https://lists.sourceforge.net/lists/listinfo/nusoap-general
> >
> >
> >
> > =20
> >
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, =
discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Nusoap-general mailing list
> Nusoap-general@...
> https://lists.sourceforge.net/lists/listinfo/nusoap-general
>
|