This is a discussion on Simple Nusoap Problem within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hello. I am having what is probably the simplest problem there is with Nusoap. I have to admit I'm ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello. I am having what is probably the simplest problem there is with
Nusoap. I have to admit I'm new to this stuff, but I have some programming experience and what I'm doing *shouldn't* be hard. First thing I tested the Hello (sample server and client) that are in the Readme file. No problem. Then I tried to accepting the data from the URL string (GET). That worked. Then I tried two parameters and the only output I get is the word "Array". I've tried it with two completely different scripts. I've tried all kinds of ways of loading the arrays, and I tried echoing the array values in the client script just to be sure they are there and they are. I'm sure I have the latest version of nusoap.php. I searched the newsgroups for anyone with a similar problem and couldn't find it. Any clues you could provide would be greatly appreciated. Here's the script I'm using. <?php require_once('nusoap.php'); $parameters = array('name1'=>$_GET['name1'], 'name2'=>$_GET['name2]); $soapclient = new soapclient('http://www.myserver.net/soapserverhello.php'); echo $soapclient->call('hello', $parameters); ?> Thank you. -Larry. |
|
|||
|
hi larry,
the soap client is looking fine. please make sure that the method of the soap server is taking more then one parameter. require_once "nusoap.php"; function hello($arg1, $arg2) { $res = $arg1 . $arg2; return $res; } $soap = new soap_server; $soap->register("args"); $soap->service($HTTP_RAW_POST_DATA); cheers, moe. ><?php > >require_once('nusoap.php'); >$parameters = array('name1'=>$_GET['name1'], 'name2'=>$_GET['name2]); >$soapclient = new soapclient('http://www.myserver.net/soapserverhello.php'); >echo $soapclient->call('hello', $parameters); > >?> > > |
|
|||
|
Thanks. I did include two arguments to the function. I even commented
out the faults. Here's what I have. I swear this is the toughest time I've had with a simple program. <?php require_once('nusoap.php'); function hello($name1, $name2){ // optionally catch an error and return a fault /*if($name1 == ''){ return new soap_fault('Client','','Must supply a valid name.'); } if($name2 == ''){ return new soap_fault('Client','','Must supply a valid name.'); }*/ $res_str = "hello " . $name1 . " " . $name2; return $res_str; } $s = new soap_server; $s->register('hello'); $s->service($HTTP_RAW_POST_DATA); ?> Timo Schäfer <timo.schaefer@media-art.net> wrote in message news:<c1j79l$l6d$07$1@news.t-online.com>... > hi larry, > > the soap client is looking fine. > > please make sure that the method of the soap server is taking more then one parameter. > > require_once "nusoap.php"; > > function hello($arg1, $arg2) > > { > > $res = $arg1 . $arg2; > > return $res; > > } > > $soap = new soap_server; > > $soap->register("args"); > > $soap->service($HTTP_RAW_POST_DATA); > > > cheers, > moe. > > > ><?php > > > >require_once('nusoap.php'); > >$parameters = array('name1'=>$_GET['name1'], 'name2'=>$_GET['name2]); > >$soapclient = new soapclient('http://www.myserver.net/soapserverhello.php'); > >echo $soapclient->call('hello', $parameters); > > > >?> > > > > |
![]() |
| Thread Tools | |
| Display Modes | |
|
|