473,581 Members | 5,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error creating WSDL: no class found with the name 'array'

1 New Member
Hi every one!

I need your help to solve this problems.
I'm trying to creat a wsdl file to a webservice but i'm getting an erros.

"Error creating WSDL document:Error creating WSDL: no class found with the name 'array' / array : , so how should we know the structure for this datatype?"

now i will show u the code and hope someone discover the bug!

webservice.clas s.php

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. /**
  3.  * WebServices Handler
  4.  *
  5.  * This class will be used in the SOAP Server.
  6.  * To use all the available options on the SOAP Server we need to use
  7.  * a WSDL file.
  8.  *
  9.  * @author 
  10.  * @version 
  11.  * @package 
  12.  */
  13.  
  14. /**
  15.  * Classes needed to web service
  16.  */
  17. include_once("DB.class.php");
  18. include_once("Maquinas.class.php");
  19.  
  20. /**
  21.  * ipTicketWS class
  22.  *
  23.  * This class has all methods to use on web service
  24.  * @package 
  25.  */
  26. class ipTicketWS extends dbHandler
  27. {
  28.     /**
  29.      * Set Maquinas info
  30.      *
  31.      * Function to get Maquinas info
  32.      * @param Integer $idmaquina maquinaID
  33.      * @return array of objects
  34.      */
  35.     public function getMaquinas($idmaquina)
  36.     {
  37.             $res = new Maquina(array("db" => $this->__dbinfo));
  38.             return $res->getMaquinas($idmaquina);
  39.     }
  40.  
  41.  
  42. }
  43.  
  44. ?>
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. include_once ("DB.class.php");
  4.  
  5. class Maquina extends dbHandler
  6. {
  7.     /** @var integer */
  8.     var $res;
  9.     var $tmp;
  10.     public $idmaquina;
  11.  
  12.     public function __construct($__dbinfo, $idmaquina)
  13.     {
  14.         parent::__construct($__dbinfo);
  15.         $this->idatributo = $idmaquina;
  16.     }
  17.  
  18.  
  19. public function getMaquinas($idmaquina) 
  20.     {
  21.     $query = "select * from maquinas order by idmaquina";
  22.     $tmp = $this->dbHandlerquery($query);
  23.         return $tmp;
  24.     }
  25. }
  26. ?>
DB.class.php

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. /**
  4.  * Database Handler Class
  5.  * HVasconcelos
  6.  */
  7.  
  8. /**
  9.  * Class to handle all database communications
  10.  * @package dbHandler
  11.  */
  12. class dbHandler
  13. {
  14.   /**
  15.    * Database Information
  16.    * @access public
  17.    * @var array
  18.    */
  19.   public $__dbinfo = array ();
  20.  
  21.   /** 
  22.    * Debug Status
  23.    * @var boolean
  24.    */
  25.   public $__debugStatus = false;
  26.  
  27.   /** 
  28.    * Logfile for Debug
  29.    * @var string
  30.    */
  31.   public $__logfilename = "";
  32.  
  33.   /**
  34.    * Handles DB open connection
  35.    *
  36.    * Options format:
  37.    * <code>
  38.    * $opts = array {
  39.    *   "db" => array {
  40.    *                  "conn" => resource,
  41.      *                  "type"   => 'POSTGRES', // MYSQL | ORACLE | POSTGRES
  42.    *   },
  43.    *   "debug" => true, // true|false
  44.    *   "logfile" => '/tmp/dblog.log'
  45.    * }
  46.    * </code>
  47.    *
  48.    * @access public
  49.    * @param array $opts
  50.    * @return int
  51.    */
  52.   public function __construct ( $opts = array () )
  53.   {
  54.     $this->__dbinfo['connected'] = ( ( $opts['db']['conn'] ) ? true : false );
  55.         $this->__dbinfo['conn'] = $opts['db']['conn'];
  56.  
  57.     $this->__debugStatus = ( ( $opts['debug'] === true ) ? true : false );
  58.     $this->__logfilename = ( ( strlen ( $opts['logfile'] ) ) ? $opts['logfile'] : "" );
  59.  
  60.     switch ( $opts['db']['type'] )
  61.       {
  62.       case 'MYSQL':
  63.         $this->__dbinfo['type'] = 'MYSQL';
  64.         break;
  65.       case 'ORACLE':
  66.         $this->__dbinfo['type'] = 'ORACLE';
  67.         break;
  68.       case 'POSTGRES':
  69.         $this->__dbinfo['type'] = 'POSTGRES';
  70.         break;
  71.       default:
  72.         $this->__dbinfo['type'] = 'POSTGRES';
  73.         break;
  74.       }
  75.  
  76.     return $this->__dbinfo['connected'];
  77.   }
  78.  
  79.   /**
  80.    * Parse DB results
  81.    * @access private
  82.    * @param object resource
  83.    * @return array of objects
  84.    */
  85.   private function parseDBResults ( $res )
  86.   {
  87.     if (! $res ) {
  88.       return false;
  89.     }
  90.  
  91.     if ( $this->__dbinfo['type'] == 'MYSQL' ) {
  92.       // ...
  93.     } else if ( $this->__dbinfo['type'] == 'ORACLE' ) {
  94.  
  95.       $i = 0;
  96.       while ( $row = @oci_fetch_object ( $res ) ) {
  97.         foreach ( $row as $key => $value)
  98.         {
  99.             $row_object->{strtolower($key)} = $value;
  100.         }
  101.         $results[$i++] = $row_object;
  102.       }
  103.  
  104.     } else if ( $this->__dbinfo['type'] == 'POSTGRES' ) {
  105.  
  106.       $count = @pg_num_rows( $res );
  107.       $results = array ();
  108.       for ( $i = 0; $i < $count; $i++ ) {
  109.         $results[$i] = @pg_fetch_object ( $res, $i );
  110.       }
  111.     }
  112.  
  113.     return $results;
  114.   }
  115.  
  116.   /**
  117.    * Secure user data for SQL statements
  118.    * @access public
  119.    * @param array $args
  120.    * @return array Filtered arguments
  121.    */
  122.   public function parseDBArrayArgs ( $args )
  123.   {
  124.     $safeArgs = array ();
  125.  
  126.     $count = count ( $args );
  127.     for ( $i = 0; $i < $count; $i++ ) {
  128.       if ( $this->__dbinfo['type'] == 'MYSQL' ) {
  129.         // ...
  130.       } else if ( $this->__dbinfo['type'] == 'ORACLE' ) {
  131.         // ...
  132.       } else if ( $this->__dbinfo['type'] == 'POSTGRES' ) {
  133.         $safeArgs[$i] = @pg_escape_string ( $args[$i] );
  134.       }
  135.     }
  136.  
  137.     return $safeArgs;
  138.   }
  139.  
  140.   /**
  141.    * Secure user data for SQL statements
  142.    * @access public
  143.    * @param string $arg
  144.    * @return string Filtered string
  145.    */
  146.   public function parseDBStringArg ( $arg )
  147.   {
  148.     $safeStr = "";
  149.  
  150.     if ( $this->__dbinfo['type'] == 'MYSQL' ) {
  151.       // ...
  152.     } else if ( $this->__dbinfo['type'] == 'ORACLE' ) {
  153.       // ...
  154.     } else if ( $this->__dbinfo['type'] == 'POSTGRES' ) {
  155.       $safeStr = @pg_escape_string ( $arg );
  156.     }
  157.  
  158.     return $safeStr;
  159.   }
  160.  
  161.   /**
  162.    * Handles DB query (SQL SELECT)
  163.    * @access public
  164.    * @param string $sql
  165.    * @return array Object resource | false
  166.    */
  167.   public function dbHandlerquery ( $sql )
  168.   {
  169.     $res = false;
  170.  
  171.  
  172.     if ( $this->__dbinfo['connected'] === true ) {
  173.  
  174.       $this->__debug ( "(QUERY) " . htmlentities ( $sql ) );
  175.  
  176.       if ( $this->__dbinfo['type'] == 'MYSQL' ) {
  177.  
  178.         // ...
  179.       } else if ( $this->__dbinfo['type'] == 'ORACLE' ) {
  180.  
  181.         $res = @oci_parse ( $this->__dbinfo['conn'], rtrim ( $sql, ';' ) );
  182.         $resource = @oci_execute ( $res );
  183.  
  184.       } else if ( $this->__dbinfo['type'] == 'POSTGRES' ) {
  185.         $res = @pg_query ( $sql );
  186.       }
  187.  
  188.       if (! $res) {
  189.         $this->__debugLastDBError ();
  190.       }
  191.  
  192.     } else {
  193.       $this->__debug ( "There's no database connection..." );
  194.     }
  195.  
  196.     return $this->parseDBResults ( $res );
  197.   }
  198.  
  199.   /**
  200.    * Handles DB execute (SQL UPDATE | INSERT | DELETE )
  201.    * @access public
  202.    * @param string $sql
  203.    * @return array Object resource | false
  204.    */
  205.   public function dbHandlerexecute ( $sql )
  206.   {
  207.     $res = false;
  208.  
  209.     if ( $this->__dbinfo['connected'] === true ) {
  210.  
  211.       $this->__debug ( "(QUERY) " . htmlentities ( $sql ) );
  212.  
  213.       if ( $this->__dbinfo['type'] == 'MYSQL' ) {
  214.         // ...
  215.       } else if ( $this->__dbinfo['type'] == 'ORACLE' ) {
  216.  
  217.         $res = @oci_parse ( $this->__dbinfo['conn'], rtrim ( $sql, ';' ) );
  218.         $resource = @oci_execute ( $res );
  219.  
  220.       } else if ( $this->__dbinfo['type'] == 'POSTGRES' ) {
  221.         $res = @pg_query ( $sql );
  222.       }
  223.  
  224.       if (! $res) {
  225.         $this->__debugLastDBError ();
  226.       }
  227.  
  228.     } else {
  229.       $this->__debug ( "There's no database connection..." );
  230.     }
  231.  
  232.     return $res;
  233.   }
  234.  
  235.   /** 
  236.    * Prints Database Information
  237.    * @access public
  238.    * @param void
  239.    * @return void
  240.    */
  241.   public function __prtDBInfo ( )
  242.   {
  243.     echo "<pre>";
  244.     var_dump ( $this->__dbinfo );
  245.     var_dump ( $this->__debugStatus );
  246.     var_dump ( $this->__logfilename );
  247.     echo "</pre>";
  248.   }
  249.  
  250.   /**
  251.    * Generic Debug Function
  252.    *
  253.    * Inserts timestamp in the debug string.
  254.    * Timestamp format: YYYMMDDHHMMSS
  255.    *
  256.    * @access private
  257.    * @param string $dbgStr
  258.    * @return void
  259.    */
  260.   private function __debug ( $dbgStr )
  261.   {
  262.     if ( $this->__debugStatus === true ) {
  263.       echo "<pre>DBGSTR: $dbgStr</pre>";
  264.       $this->__debug2Logfile ( $dbgStr );
  265.     }
  266.   }
  267.  
  268.   /**
  269.    * Debug Database Communications
  270.    * @access private
  271.    * @param void
  272.    * @return void
  273.    */
  274.   private function __debugLastDBError ( )
  275.   {
  276.     if ( $this->__debugStatus === true ) {
  277.  
  278.       if ( $this->__dbinfo['type'] == 'MYSQL' ) {
  279.         // ...
  280.       } else if ( $this->__dbinfo['type'] == 'ORACLE' ) {
  281.         // ...
  282.       } else if ( $this->__dbinfo['type'] == 'POSTGRES' ) {
  283.         $dbgStr = @pg_last_error ( $this->__dbinfo['conn'] );
  284.         $this->__debug2Logfile ( $dbgStr );
  285.         echo "<pre>DBGSTR: $dbgStr</pre>";
  286.       }
  287.     }
  288.   }
  289.  
  290.   /**
  291.    * Debug Database Communications to Logfilename
  292.    *
  293.    * Inserts timestamp in the debug string.
  294.    * Timestamp format: YYYMMDDHHMMSS
  295.    *
  296.    * @access private
  297.    * @param string $dbgStr
  298.    * @return void
  299.    */
  300.   private function __debug2Logfile ( $dbgStr )
  301.   {
  302.     if ( ( $this->__debugStatus === true ) && ( $this->__logfilename ) ) {
  303.       $tstamp = date ( "YmdHis" );
  304.       @error_log ( $tstamp." - " . $dbgStr . "\n", 3, $this->__logfilename );
  305.     }
  306.   }
  307. }
  308.  
  309. ?>

I think the error is somewhere here but i can't find it. Hope u con help me!

Thanks.
Mar 16 '10 #1
1 2975
Atli
5,058 Recognized Expert Expert
Hey.

I can't see any problems in that code. But I don't see anything in there either that would do anything WSDL related. As far as I can tell, all that code just executes a static SQL query when the "ipTicketWS::ge tMaquinas()" method is called, returning the result set as an array.
Mar 16 '10 #2

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

Similar topics

7
3082
by: Jorgen Haukland, Norway | last post by:
Hi, I have created a Java webservice which runs in IBM WebSphere appserver. I take the WSDL-file and create a VS.NET WinForm application and calls the service running on my PC and everything works fine. So I deploy the webservice on a remote machine (Linux box) and I get an error when calling the service. BUT: I can retrieve the WSDL and...
7
4739
by: John Grandy | last post by:
My ASP.NET Web Service project has a Web Method that returns an array filled with instances of a custom class. The custom class is defined in a Class Library that is included in the web-service project. The same class lib is included in the ASP.NET Web Application that calls the web-method I can successfully call the web-method with
4
3714
by: glebur | last post by:
Hi, I'm trying to create a web service client in C# but I get stuck at one of the first steps. When adding a Web reference to the Visual Studio project; I get this error (this is a translation, the English terms might not be exact) : "Error in the custom tool : Impossible to import WebService/Schema. Impossible to import binding...
1
5042
by: Mike Logan | last post by:
I have a schema that defines my messages and objects. I then have a WSDL that defines the web services. I have my sample XSD, sample WSDL, and the code generated from WSDL.exe. In the generated code from WSDL.exe, the "applicationList" object is not a array or "application", which is what it should be, correct? Thanks for the help. ...
5
10319
by: Mike Logan | last post by:
I used WSDL.exe to generate a client side web proxy for a web service, called the web service, got the results but an array returned by the web service is not in the results. However if I use "Add Web Reference" for the same service the same function works appropriately. Here is the client proxy generated from WSDL.exe ...
1
1640
by: Vishuonline | last post by:
Guys, I have had some experience in working with webservices created in .NET but this is the first time I am trying out one made in Java. When I run the wsdl exe to create a proxy class for the wsdl provided it throws the following error. Error: Unable to import binding 'CosmosXXXXXBinding' from namespace 'urn :XXXXX'.
0
1385
by: Andrew Brook | last post by:
Hi everyone, I've been going through an article i found on MSDN (http://msdn.microsoft.com/msdnmag/issues/02/12/WebServicesDesign/) concerning designing the messages for a webservice in a schema (xsd) first and then writing a .wsdl file that imports the schema. Following this i have used wsdl.exe (that comes with framework 1.1) to generate...
3
6093
by: Jeremy Chapman | last post by:
I've writtin a very simple web service in axis which returns an array of classes. I consume it in a .net app. When receiving the response, my .net app generates an error "Cannot assign object of type System.Object to an object of type PersonWS.WorkGroupData.". I've included the wsdl of the consumed axis web service, the...
1
1953
by: =?Utf-8?B?QWNl?= | last post by:
hi all, we are trying to hook up with a web service provided by one of our vendors. i got their wsdl file and generated a proxy class using wsdl.exe. below is the method signature as well as the class associated with it: public partial class WSProxy : System.Web.Services.Protocols.SoapHttpClientProtocol { .... public MyArray SearchThis(...
0
1707
by: santycalde | last post by:
Hi!! I am executing a call to a webservice with SOAP and the following mistake takes place: The XML of the wsdl is: <?xml version="1.0" encoding="UTF-8" ?> - <wsdl:definitions targetNamespace ="http://PkgFechaSistemaSync" xmlns:tns ="http://PkgFechaSistemaSync" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/ " xmlns:soap12="...
0
7854
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8296
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...
0
8157
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6539
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5665
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...
0
5350
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...
0
3794
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...
0
3807
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1394
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.