eventsmagentosoapmagento-soap-api

Magento event not caught by observer when fired via SOAP


Despite the multitude of 'my observer isn't triggered' questions on SO, this one has not yet been covered.

I have a working observer set up to catch the event checkout_submit_all_after. The problem is that this only works when I purchase an item via the frontend, and not when I trigger the event via a SOAP call to shopppingCartOrder. The order itself is successful, and I also am able to log the event from Mage.php's dispatchEvent.

Edit: To make this more clear: The event IS being generated and I can log it via Mage.php. The problem is that the observer is not catching it only when SOAP is used to generate the event.

As you will see from my config.xml below, I am using the Global scope, so the observer should be handling it in all cases (if my understanding is correct). Is there something else I need to do to get my observer to fire when i call SOAP? Also, I tried this with various other events and still nothing triggered.

config.xml:

<config>

    <modules>
        <Company_Obsrv>
            <version>0.0.1</version>
        </Company_Obsrv>
    </modules>

    <global>
       <models>
            <!--
                Unique identifier in the model's node.
                By convention, we put the module's name in lowercase.
            -->
            <company_obsrv>
            <!--path-->
                <class>Company_Obsrv_Model</class>
            </company_obsrv>

        </models>

        <events>
            <checkout_submit_all_after>
                <observers>
                    <company_obsrv>
                        <class>company_obsrv/observer</class>
                        <method>observeTest</method>
                        <type>singleton</type>
                    </company_obsrv>
                </observers>
            </checkout_submit_all_after>
        </events>
    </global>   

</config>

Observer.php:

class Company_Obsrv_Model_Observer
{

    public function observeTest(Varien_Event_Observer $observer)
    {
       Mage::log('CALLED!', null, 'newlog.log', true); 
    } 
}

Like I said, the observer works when I'm not using SOAP, so it can't be my function code or naming issues. Please help!


Solution

  • Grrr! It was the damn CACHE. And I was sure I turned it off.