Total members 9952 | Gratitudes |It is currently Sat Feb 11, 2012 2:28 pm Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 4 posts ] 
Author Question
 Question subject: PHP SOAP server returns array using NuSOAP Library
PostPosted: Tue Jun 30, 2009 10:43 am 
Offline
Newbie
User avatar

Joined: Fri Jun 26, 2009 5:50 am
Posts: 23
Has thanked: 0 time
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.

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?

_________________
Thanks & regards
Lokananth
[url "http://www.mioot.com"]Live Chat Software[/url] By miOOt


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: PHP SOAP server returns array using NuSOAP Library
PostPosted: Wed Jul 22, 2009 10:40 am 
Offline
Newbie
User avatar

Joined: Wed Apr 15, 2009 7:18 am
Posts: 32
Has thanked: 0 time
Have thanks: 0 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.

_________________
MySpace Layouts


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: PHP SOAP server returns array using NuSOAP Library
PostPosted: Mon Feb 22, 2010 11:02 am 
Offline
Newbie
User avatar

Joined: Mon Feb 22, 2010 10:59 am
Posts: 1
Has thanked: 0 time
Have thanks: 1 time
You can send get reponse as an array from SOAP if you serialize() the array before returning it.
Hope it helps!
Thanks.....



For this message the author vishonly has received gratitude : msi_333
TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: PHP SOAP server returns array using NuSOAP Library
PostPosted: Mon Feb 22, 2010 12:23 pm 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2103
Location: Earth
Has thanked: 39 time
Have thanks: 57 time
@vishonly , thanks for help .

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 4 posts ] 
Quick reply


  


 Similar topics
 Topic title   Forum   Author   Comments 
 Library Sort  C++ examples  mileloader  1
 Ajax Source code to Suggest application with JSP Server side  AJAX  msi_333  5
 search for string in a cell array  Matlab Examples  msi_333  0
 RMI EXAMPLE FOR CLIENT SERVER ARCHITECTURE CODE ?????  Java  Anonymous  0
 client server problem  Java  bablu1790  0

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 2 guests



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team