logo       

Re: Quick Question...: msg#00143

php.nusoap.general

Subject: Re: Quick Question...

A response message can have multiple parts. However, only one of those parts
is the return value. The other parts are output parameters. Output parameters
are not supported by NuSOAP (nor by Apache SOAP and I suspect some other SOAP
implementations), so I avoid them.

If you want to return some set of strings, you should either use an associative
array or numerically-indexed array. You should use the latter when the strings
are values of the same sort of thing, such as

function foo() {
$names[] = 'Bill Smith';
$names[] = 'John Doe';
$names[] = 'Jane Doe';
return $names;
}

You use the associative array when the values are different sorts of things,
like

function bar() {
$ret['valid'] = 'yep';
$ret['truelink'] = '#paste';
$ret['falselink'] = '#copy';
$ret['invalidlink'] = '#cut';
return $ret;
}

My previous e-mail showed how to generate WSDL from your service when using a
numerically-indexed array. For an associative array, the WSDL will present the
data as an XML complexType, and you would use something like

$server->wsdl->addComplexType(
'MyStruct',
'complexType',
'struct',
'all',
'',
array(
'valid' => array('name'=>'valid','type'=>'xsd:string'),
'truelink' => array('name'=>'truelink','type'=>'xsd:string'),
'falselink' => array('name'=>'falselink','type'=>'xsd:string'),
'invalidlink' => array('name'=>'invalidlink','type'=>'xsd:string')
)
);

$server->register(
'bar',
array(),
array('return' => 'tns:MyStruct'),
'urn:MyURN'
);

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: "Dennis Morgan" <dennis.morgan@xxxxxxxxxx>
To: <nusoap-general@xxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, May 26, 2004 9:07 AM
Subject: Re: [Nusoap-general] Quick Question...


Let me try and explain this a little clearer thats if i can..
I have a server function which i need to return an array from of which
consists of 3 XSD:String values.. actually what i need to do is pass back 5
values in an array. I know how to pass them to the function from client to
server that was easy its going server to client that is the problem.

<message name="functionResponse">
<part name="valid" type="xsd:string" />
<part name="truelink" type="xsd:string" />
<part name="falselink" type="xsd:string" />
<part name="invaildlink" type="xsd:string" />
</message>

what i need is to be able to do something like above... is it even possible??
or if not what would be the simplist way?

and if it is possible i am guessing i then would do it like normal:
$data=$client->call('function', $parameter);
and just use the dumb_var command???

regards,
Dennis


On Wed, 26 May 2004 22:31, Nergis Kilinç wrote:
> I did not completely understand your question but if you need to know how
> to pull a specific array, use var_dump().
> This function displays structured information about one or more expressions
> that includes its type and value. Then you can
> use the appropriate part.
>
> $data=$client->call('function', $parameter);
>
> var_dump ($data);
>
> Nergis Kilinç
>
> ----- Original Message -----
> From: "Dennis Morgan" <dennis.morgan@xxxxxxxxxx>
> To: <nusoap-general@xxxxxxxxxxxxxxxxxxxxx>
> Sent: Wednesday, May 26, 2004 2:14 AM
> Subject: [Nusoap-general] Quick Question...
>
> > Hi Everyone,
> > this may be a dumb question and probably is straight forward..
> >
> > Is there a way to return an array from a function call.. at present i
>
> need to
>
> > find a way to have a function pass back 3 bits of data. all XSD:String.
> >
> > If anyone as any idea how i could pull this off it would be a big help..
> > regards,
> > Dennis
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by: Oracle 10g
> > Get certified on the hottest thing ever to hit the market... Oracle 10g.
> > Take an Oracle 10g class now, and we'll give you the exam FREE.
> > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
> > _______________________________________________
> > Nusoap-general mailing list
> > Nusoap-general@xxxxxxxxxxxxxxxxxxxxx
> > https://lists.sourceforge.net/lists/listinfo/nusoap-general
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market... Oracle 10g.
> Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id149&alloc_id�66&op=Click
> _______________________________________________
> Nusoap-general mailing list
> Nusoap-general@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/nusoap-general


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id66&op=ick
_______________________________________________
Nusoap-general mailing list
Nusoap-general@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/nusoap-general



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id�66&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise