473,385 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

SOLVED: nuSOAP returns empty object

33
Hello, I have very little knowledge when it comes to SOAP, but a developer I'm working with says it will make things easier when passing data to/from client software and the mySQL database. Anyhow, I created this SOAP server per examples and instructions on various websites, and the server appears to be functioning (Server). However, the client software developer says they are getting the "Schedule" object back empty, regardless of what argument they pass to the pilotSchedule method. I have no way to check their code, so I have to assume it's correct. Can someone with SOAP experience take a look for an error here? Below is the server markup.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3.     // ACARS SOAP FORMATTED METHODS 
  4.  
  5.     require "nusoap/nusoap.php";                                                                             
  6.  
  7.     $server = new soap_server;                                                                               
  8.     $ns = "urn:fdxvaACARS";                                                                                  
  9.     $server->soap_defencoding = 'utf-8';                                                                     
  10.     $server->configureWSDL('fdxvaACARS',$ns);                                                                
  11.     $server->wsdl->schemaTargetNamespace=$ns;                                                                
  12.     $server->wsdl->addComplexType(                                                                           
  13.         'Flight',                                                                                            
  14.         'complexType',                                                                                       
  15.         'struct',                                                                                            
  16.         'all',                                                                                               
  17.         '',                                                                                                  
  18.         array(                                                                                               
  19.             'uID'           =>  array('name'=>'uID','type'=>'xsd:string'),                                   
  20.             'MID'           =>  array('name'=>'MID','type'=>'xsd:string'),                                   
  21.             'routeNum'      =>  array('name'=>'routeID','type'=>'xsd:string'),                               
  22.             'origin'        =>  array('name'=>'origin','type'=>'xsd:string'),                                
  23.             'destination'   =>  array('name'=>'destination','type'=>'xsd:string'),                           
  24.             'depTime'       =>  array('name'=>'depTime','type'=>'xsd:int'),                                  
  25.             'acType'        =>  array('name'=>'acType','type'=>'xsd:int'),                                   
  26.             'flightType'    =>  array('name'=>'flightType','type'=>'xsd:string'),                            
  27.             'note'          =>  array('name'=>'note','type'=>'xsd:string'),                                  
  28.             'flightPlan'    =>  array('name'=>'flightPlan','type'=>'xsd:string'),                            
  29.             'oCharts'       =>  array('name'=>'oCharts','type'=>'xsd:string'),                               
  30.             'oName'         =>  array('name'=>'oName','type'=>'xsd:string'),                                 
  31.             'oCity'         =>  array('name'=>'oCity','type'=>'xsd:string'),                                 
  32.             'oState'        =>  array('name'=>'oSate','type'=>'xsd:string'),                                 
  33.             'oCoor'         =>  array('name'=>'oCoor','type'=>'xsd:string'),                                 
  34.             'dCharts'       =>  array('name'=>'dCharts','type'=>'xsd:string'),                               
  35.             'dName'         =>  array('name'=>'dName','type'=>'xsd:string'),                                 
  36.             'dCity'         =>  array('name'=>'dCity','type'=>'xsd:string'),                                 
  37.             'dState'        =>  array('name'=>'dSate','type'=>'xsd:string'),                                 
  38.             'dCoor'         =>  array('name'=>'dCoor','type'=>'xsd:string'),                                 
  39.             'aMake'         =>  array('name'=>'aMake','type'=>'xsd:string'),                                 
  40.             'aModel'        =>  array('name'=>'aModel','type'=>'xsd:string')                                 
  41.         )                                                                                                    
  42.     );                                                                                                       
  43.     $server->wsdl->addComplexType(                                                                           
  44.         'Schedule',                                                                                          
  45.         'complexType',                                                                                       
  46.         'array',                                                                                             
  47.         '',                                                                                                  
  48.         'SOAP-ENC:Array',                                                                                    
  49.         array(),                                                                                             
  50.         array(                                                                                               
  51.             array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Flight[]')                              
  52.         ),
  53.         'tns:Flight'                                                                                         
  54.     );                                                                                                                                                                                                             ////
  55.     $server->register(                                                                                       
  56.         'pilotSchedule',                                                                                     
  57.         array('pilotID'=>'xsd:string'),                                                                      
  58.         array('return'=>'tns:Schedule'),                                                                     
  59.         'fdxvaACARS',                                                                                        
  60.         'fdxvaACARS#pilotSchedule',                                                                          
  61.         'rpc',                                                                                               
  62.         'encoded',                                                                                           
  63.         'Returns an array of scheduled flights.'                                                             
  64.     );                                                                                                       
  65.                                                                                                                                                                                                                     ////
  66.  
  67.     // DB CONNECTION                                                                                         
  68.     function connect(){                                                                                      
  69.  
  70.       // CONNECT TO DB                                                                                       
  71.       if(mysql_connect("localhost","username","password")){}                   
  72.       else{ return false; }                                                                                  
  73.       if(mysql_select_db("database")){}                                          
  74.       else{ return false; }                                                                                  
  75.  
  76.       return true;                                                                                           
  77.  
  78.     }                                                                                                        
  79.  
  80.  
  81.  
  82.     // GET ALL SCHEDULED FLIGHTS FOR A PILOT  
  83.     function pilotSchedule($pilotID){
  84.  
  85.         // SQL STRING
  86.         $sql =  "SELECT s.uID,s.MID,s.routeNum,s.origin,s.destination,s.depTime,s.acType,s.flightType,
  87.                 s.note,r.route AS flightPlan,o.charts AS oCharts, o.name AS oName, o.city AS oCity, o.state AS 
  88.                 oState, o.coor AS oCoor, d.charts AS dCharts, d.name AS dName, d.city AS dCity, d.state AS dState, 
  89.                 d.coor AS dCoor, a.make AS aMake, a.model AS aModel FROM scheduled AS s JOIN aircraft AS a 
  90.                 ON s.acType = a.ID LEFT OUTER JOIN routesSuggested AS r ON r.ID = s.routeNum LEFT OUTER JOIN 
  91.                 airports AS o ON o.ICAO = s.origin LEFT OUTER JOIN airports AS d ON d.ICAO = s.destination
  92.                 WHERE s.MID = '" . $pilotID . "'";    
  93.  
  94.         // CONNECT TO DB
  95.         if(!connect()){
  96.           echo "Couldn't Connect";
  97.         } 
  98.  
  99.         // GET DATA
  100.         $result = mysql_query($sql);      
  101.         $schedule = array();
  102.  
  103.         while($flight = mysql_fetch_assoc($result)){
  104.             array_push($schedule,$flight);
  105.         }
  106.  
  107.         return $schedule;
  108.  
  109.     }
  110.  
  111.  
  112.  
  113.     $request = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';                                        
  114.     $server->service($request);                                                                              
  115.  
  116. ?>
Dec 14 '09 #1
2 8137
flydev
33
Client software developer got it to bring in filled arrays, sorry for post.
Dec 14 '09 #2
Did the developer say how he solved the problem? I'm having the same issue now with both a NuSOAP client and from SoapUI.
Dec 21 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Unbreakable | last post by:
I am using the nusoap client and nusoap server without any problem. However, once I change the client to the excel, I am not sure how to call the nusoap server. Especially the nusoap server only...
0
by: Ward G | last post by:
Hi, Below is a basic webservice using the NuSOAP class. When I run the code to register the service, I get the nice html page generated by nusoap, offering a link to view the WSDL for my...
5
by: Mark C | last post by:
I have a memory allocation problem in PHP using NuSOAP and the built in XML parser. The code below is called in a loop and executed about 1900 times before it failed. I am using nusoap.php,v 1.76...
0
by: Dom | last post by:
Where can I find resources and documentation about interoperability problems between nuSOAP PHP client and Apache Axis Server? Have you experienced problems in transmitting over SOAP (sending and...
2
by: Johnny | last post by:
Searched on google for any info relating to this before posting here but found none. I set up a web service using nusoap on apache php 4.3.8 on windows with error_reporting = E_ALL and had that...
2
by: Gary Townsend | last post by:
I am writing an app in vb .net that will use an XML webservice written in PHP NuSoap. I want to have the NuSoap server send a dataset to my VB .NET application i am trying to find any documentation...
0
by: Treefrog | last post by:
Hi, I'm using NuSOAP to call a web method, that returns an array of "accounts". The trouble is, when there's only one account, NuSOAP doesn't return an array, it just returns the associative...
1
by: Treefrog | last post by:
Hi, I'm having a bit of trouble with NuSOAP. I'm calling a web method that looks like this (excuse the strange sytax) public testItem GetTestItem (int aNumber, testObjects) So, I need to...
1
by: neoblitz | last post by:
Hi Guys, I'm very new to NuSoap. I'm able to call a webservice which actually returned me results.. But I'm having trouble to read the response or I simply don't understand how to read the response.....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.