Issues

ZF-7187: Simple Zend_Amf_Server runing on Zend_Application does not work

Issue Type: Bug Created: 2009-07-02T12:33:30.000+0000 Last Updated: 2009-07-25T04:44:22.000+0000 Status: Resolved Fix version(s): Reporter: Erik Wiesenthal (erikwiesenthal) Assignee: Dolf Schimmel (Freeaqingme) (freak) Tags: - Zend_Amf

  • Zend_Application

Related issues: Attachments:

Description

Triying to set a Zend_Amf end point on the Zend_Application default structure and does not work. I can make it work on brand new plain php framework independent, but not into the MVC structure using the Zend_Application

To reproduce it just:

shell > zf create project newproyect

inside the IndexController add this:

<pre class="highlight">
<?php

class IndexController extends Zend_Controller_Action
{
    protected $_server;

    public function init ()
    {
        //  set the server up 
        $this->_server = new Zend_Amf_Server();
        $this->_server->addDirectory(APPLICATION_PATH . '/services/');
        
        //  turn the renderer off
        $this->_helper->viewRenderer->setNoRender();
    }

    public function postDispatch ()
    {
        //  shut the layout off
        //$this->_helper->layout->disableLayout();
        //  set the correct header if no error or forwarding occurred during dispatch  
        $this->_response->setHeader('Content-Type', 'application/x-amf', true);
    }

    public function indexAction ()
    {
        //  process the request and set the response
        $amfResponse = $this->_server->handle();
        $this->_response->setBody($amfResponse);
        //print_r($amfResponse);
    }


}

(you can try with a simple echo $this->_server->handle(); inside the indexAction) then, on the APPLICATION_PATH . '/services/' create Api.php

<?php
class Api
{
/**
* @return string
*/

    public function getMyText()
    {
        return "hello World";
    }
}

then, a simple flex3 or adobe air project:


www.adobe.com/2006/mxml" layout="absolute">

it returns a [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.BadVersion: : url: 'http://local.newproyect.com/'"]

The entire system is all right: you can test it using this IndexAction:

<pre class="highlight">
public function indexAction ()
    {
        //  process the request and set the response
                 $this->_server->listMethods(); 
                 $this->_server->getFunctions();
    }

Comments

Posted by Erik Wiesenthal (erikwiesenthal) on 2009-07-03T03:17:34.000+0000

It's ok, Zend_Amf works fine with Zend_Application, must be something related to my rerouter, it returns me a simple

End Point

on the amf file.

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-07-25T04:44:21.000+0000

Closing this issue as not an issue based on the last comment.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts