Total members 11890 |It is currently Thu Apr 25, 2024 3:53 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Hi,
I have a function in my SOAP server that returns an array. When the client calls this function, it only receives "array", and when I use foreach to print each member of this array, it tells me that this is not an array. If I change the returned value of the function to a string or integer type everything works fine though, so I don't think that there is any problem with the client.

I am using NuSOAP library on php to achieve that.

I had doubt when declaring the type of return value of the function. In XML schema there is no array type, so I specified the return value as a string like this:
PHP Code:
$server->register("getLocation",
array('country_population' => 'xsd:string',
'city_population' => 'xsd:string'),
array ('return' => 'xsd:string'),
'urn:world',
'urn:worldquote#getLocation');
The return values is a result of a query from database.

Any idea how I can declare array element in XML schema?




Author:
Newbie
User avatar Posts: 23
Have thanks: 1 time

Hi,
I have a function in my SOAP server that returns an array. When the client calls this function, it only receives "array", and when I use foreach to print each member of this array, it tells me that this is not an array. If I change the returned value of the function to a string or integer type everything works fine though, so I don't think that there is any problem with the client.


Author:
Newbie
User avatar Posts: 29
Have thanks: 0 time

You can send get reponse as an array from SOAP if you serialize() the array before returning it.
Hope it helps!
Thanks.....


Author:
Newbie
User avatar Posts: 1
Have thanks: 1 time

For this message the author vishonly has received gratitude : DrRakha

@vishonly , thanks for help .

_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 4 posts ] 

  Related Posts  to : PHP SOAP server returns array using NuSOAP Library
 PHP SOAP server returns array using NuSOAP Library     -  
 Java and SOAP     -  
 Get SOAP response     -  
 Trace soap message     -  
 Image I/O library     -  
 Library Sort     -  
 Math Function Library     -  
 Java Library Database Management System Project     -  
 Sql server or windows server question?     -  
 simple Ajax library solving back button and bookmarks     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com