473,785 Members | 2,498 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 2981
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
3095
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 make a webreference in my VS.NET project, so obviously I (or more correct: My VS.NET project) am...
7
4748
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
3731
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 'cmsserverbinding' (it's the name of the binding in my WSDL file) from namesapce 'urn:cms. Impossible to...
1
5053
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. <?xml version="1.0" encoding="utf-8" ?> <xs:schema targetNamespace="http://me.com/xml/xsd/AppSec1.xsd"
5
10337
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 <System.Web.Services.Protocols.SoapDocumentMethodAttribute("capeconnect:AppSec:AppSecPortType#getApplicationUsers",
1
1648
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
1419
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 an abstract class which my webservice inherits from. All has gone well with this until i...
3
6097
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 request/responses of the web service by the .net app and the exception and stack trace. Hoping someone can tell me...
1
1969
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( string
0
1718
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=" http://www.w3.org/2003/05/soap-envelope" xmlns:xsd ="http://www.w3.org/2001/XMLSchema "...
0
9645
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9481
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
10155
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
7502
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
6741
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
5383
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
4054
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
3656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2881
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.