473,811 Members | 3,687 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SOLVED: nuSOAP returns empty object

33 New Member
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 8182
flydev
33 New Member
Client software developer got it to bring in filled arrays, sorry for post.
Dec 14 '09 #2
elkhunter69
1 New Member
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
2385
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 generate the a SOAP message as follow instead of a WSDL file. So, my question is 1.) Can I use excel or .Net as a client to call the nusoap server?
0
2969
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 service. When I click it, php barfs this : Cannot modify header information - headers already sent by \nusoap.php on line 2421.
5
5390
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 2004/06/25 13:17:56 snichol Exp $. I am running PHP version 4.2.2 on RedHat 9.0 I presume I need to unallocated something other than the soapclient, but I'm nor sure what. This is the code that is called in the loop and the error message...
0
1687
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 receiving) between nuSOAP client and Axis Server: a) primitive types b) HashMap c) Object (defined in WSDL as ComplexType) = Java Class d) nested HashMap e) Array of Array or Array of HashMap or Array of Object (defined in WSDL as
2
4722
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 service set a cookie in the client browser as the first output. Works fine in IE6 and the service returns the state of the cookie in the client browser but in firefox 1.0 the exact same service gives a notice error about an undefined variable...
2
5567
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 of anyone pullling data from a database in PHP then using NuSoap to send it to a .NET application and have the .NET proxy class recognize the return datatype as a dataset so that i can cache the dataset on the desktop application. Gary...
0
1850
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 array that is the account data. E.G.
1
3971
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 create NuSOAP call like this. $arguments = array("aNumber" => 10,"testObjects" => $testObjects);
1
10025
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.. here is the code i've used to call the service. It returns a kind of big array so i'm so much lost inside it.. I would be grateful if someone help me out on reading the array values into variables so that i can do something depends on the result...
0
9605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10384
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10395
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7667
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6887
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5553
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4338
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3865
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3017
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.