class not found in zend services folder

I make services folder in my Zend project and i create new php file in that folder. My folder structure is there.

<project name>/
    application/
        configs/
            application.ini
        controllers/     
            IndexController.php      
        models/   
            Test.php        
        services/
            SoapClient.php
        views/                
            helpers/
            scripts/
        Bootstrap.php       
    docs/
    library/
    public/          
        .htaccess
        index.php       
    tests/

I can use Test.php file using Application_Model_Test class. But I can use SoapClient.php file using Application_Service_SoapClient or Application_Services_SoapClient class name.

Always it show following message.

Fatal error: Class 'Application_Services_SoapClient' not found in /home/dinuka/workspace/testzend/application/controllers/IndexController.php on line 13 

Please help me. What class should i use in SoapClient.php?

Answers


The path is correct, but the class should be named, Application_Service_SoapClient.

Service is one of the module resource classes that are mapped automatically.

To get it working, just rename the class to Application_Service_SoapClient and update all the references to that class if any. The file name is fine.

These are the default mappings as of 1.11.11:

    $this->addResourceTypes(array(
        'dbtable' => array(
            'namespace' => 'Model_DbTable',
            'path'      => 'models/DbTable',
        ),
        'mappers' => array(
            'namespace' => 'Model_Mapper',
            'path'      => 'models/mappers',
        ),
        'form'    => array(
            'namespace' => 'Form',
            'path'      => 'forms',
        ),
        'model'   => array(
            'namespace' => 'Model',
            'path'      => 'models',
        ),
        'plugin'  => array(
            'namespace' => 'Plugin',
            'path'      => 'plugins',
        ),
        'service' => array(
            'namespace' => 'Service',
            'path'      => 'services',
        ),
        'viewhelper' => array(
            'namespace' => 'View_Helper',
            'path'      => 'views/helpers',
        ),
        'viewfilter' => array(
            'namespace' => 'View_Filter',
            'path'      => 'views/filters',
        ),
    ));

Need Your Help

Match width of different elements on web page. HTML IE7 & IE8

html css

In the following code I need to match the width when shrinking the window :

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.