From: <a.m...@cc...> - 2005-09-29 13:57:45
|
Scott, 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 to the specific function. The problem is, that the soap function is called by the php command : mixed *call_user_func_array* ( callback function, array param_arr ) The parameters in the array are "flatened" if the handover to the function appears. If have modified the source code : --- 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 = new $class (); $call_arg = array(&$instance, $method); } - $this->methodreturn = call_user_func_array($call_arg, $this->methodparams); + $this->methodreturn = call_user_func_array($call_arg, array($this->methodparams)); } $this->debug('in invoke_method, methodreturn:'); $this->appendDebug($this->varDump($this->methodreturn)); and the assoc array is passed to the php function and can be processed there. That's what I wanted to achieve, I can now do parameter checks based on their XML element names. Regards, Andre Scott Nichol schrieb: >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 ----- >From: <Mamitzsch>; "André" <a.m...@cc...> >To: <nus...@li...> >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=2959151) > >Example is shown here: > > >Server: > >include('./lib/nusoap.php'); > >function test($ParId = "xx", $ParSeqReq = "yy", $ParSearch = "zz") > { > syslog(LOG_DEBUG, "##########################\n"); > syslog(LOG_DEBUG, "ParId = $ParId \n"); > syslog(LOG_DEBUG, "ParSeqReq = $ParSeqReq \n"); > syslog(LOG_DEBUG, "ParSearch = $ParSearch \n"); > syslog(LOG_DEBUG, "##########################\n"); > } > > >$in = array( "ParId" => "xsd:string", > "ParSeqReq" => "xsd:string", > "ParSearch " => "xsd:string"); >$out = array(); > >$soapServer = &new Soap_Server(); >$soapServer->register("test", $in , $out, "http://host130/"); $soapServer->service($HTTP_RAW_POST_DATA); > > > >Client: > ><?php > >include('./lib/nusoap.php'); > >$soapClient = &new SoapClient("http://192.168.10.130/soapDebug/soapServer.php"); >$parameters = array > ( > "ParSeqReq" => "seq34", > "ParId" => "123456", > "ParSearch " => "soap"); > >$soapClient->call("test", $parameters, "http://host130/"); > > >In this case the output is: > >Sep 28 10:10:16 host130 apache: ########################## >Sep 28 10:10:16 host130 apache: ParId = seq34 >Sep 28 10:10:16 host130 apache: ParSeqReq = 123456 Sep 28 10:10:16 host130 apache: ParSearch = soap Sep 28 10:10:16 host130 apache: ########################## > >If I swap around the parameters in the client file to: > >$parameters = array > ( > "ParId" => "123456", > "ParSeqReq" => "seq34", > "ParSearch " => "soap"); > >The output changes to: > > >Sep 28 10:19:50 host130 apache: ########################## >Sep 28 10:19:50 host130 apache: ParId = 123456 >Sep 28 10:19:50 host130 apache: ParSeqReq = seq34 Sep 28 10:19:50 host130 apache: ParSearch = soap Sep 28 10:19:50 host130 apache: ########################## > > >Has anybody got an idea? > >Thanks a lot for your help. > >Mit freundlichen Grüßen, >Best regards, > >André Mamitzsch > > >------------------------------------------------------- >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 >Nus...@li... >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 >Nus...@li... >https://lists.sourceforge.net/lists/listinfo/nusoap-general > > > > > |