logo       

Re: nusoap : array parameter: msg#00048

php.nusoap.general

Subject: Re: nusoap : array parameter

The int type is defined by XML Schema, not your WSDL. Therefore, the lines

array(
array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:int[]')
),
'tns:int'

should be

array(
array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:int[]')
),
'xsd:int'

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: "Philippe BOUDIN " <pboudin@xxxxxxxxxxxx>
To: <nusoap-general@xxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, April 13, 2004 7:37 AM
Subject: [Nusoap-general] nusoap : array parameter


hello,

first i apologize for my bad english.
I would like to do a service with a function which have an integer array for
parameter. I did a complex type in
service which name is NotesArray :

$server->wsdl->addComplexType(
'NotesArray',
'complexType',
'array',
'',
'SOAP-ENC:Array',
array(),
array(
array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:int[]')
),
'tns:int'
);

*********************************
I use NotesArray as parameter in my function service. There is something like
that :

$server->register('myFunction', // method name
array('notes'=>'tns:NotesArray'), // input parameters
array('return' => 'xsd:string'), // output parameters
'urn:myService', // namespace
'urn:myService#myFunction', // soapaction
'rpc', // style
'encoded', // use
'My documentation' // documentation
);
// Define the method as a PHP function
function myFunction($notes) {
$moy = "".$notes[0]; //just for exemple return the first number as a string
return $moy;
}


*********************************
I'm not able to use it in a client. My browser show me this message :
"wsdl error: urn:calcul:int (int) is not a supported type."

I have this source :
$theArray = array(10, 11, 12, 13);
// Call the SOAP method
$result = $client->call('moyenne', array('notes' => $theArray));


Anyone understands me and can resolve my probleme ?
Thanks a lot
Philippe

Incroyable ! des SMS offerts avec CaraMail Premium - http://www.caramailmax.com




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click


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

News | FAQ | advertise