+ Reply to Thread
Results 1 to 4 of 4

Thread: trouble with amfphp 1.9

  1. Join Date
    Jul 2009
    Posts
    6

    trouble with amfphp 1.9

    hi-

    i am using php 5.x amfphp 1.9 flex 3.
    i get send failed error message, channel disconnected, client delivery in doubt.
    i notice i have too many php-cgi.exe processes in task manager.

    please glance at this code and see if you see any glaring errors:
    i put comments in the service code for php.

    i might add that when i goto http://localhost/amfphp/gateway.php i get the correct install message.

    when i go to the php service address i get a blank screen with no errors reported.

    i did have luck doing a hello world type test without adding in mysql/php.

    thanks for any help you can offer. i hit the wall on getting past this
    tonight. mtdew3q (p.s. i am heading for bed and hope to check this
    for new related threads after work tomorrow)

    code is as follows (taken from a book and slightly adapted):

    <?php

    /**
    *
    *
    * @version $Id$
    * @copyright 2009
    */

    /**
    * P
    *
    */
    class ArticleDBV0{
    var $articleId;
    var $description;
    var $category;
    var $topic;
    var $_explicitType = "ArticleDBV0";
    }
    ?>

    <?php

    /**
    *
    *
    * @version $Id$
    * @copyright 2009
    */
    print('a'); OK
    require_once "ArticleDBV0.php";
    print('b'); OK
    /**
    *
    *
    */
    class ArticleService{


    var $mysqli;

    public function ArticleService(){
    print('c'); //does not print

    $mysqli=new mysqli("localhost","u_name","p_word","mydb");


    }


    public function getArticleDBV0(){

    $myArticles = array();
    $query = "SELECT * FROM ARTICLEDB";
    $mysqli = query($query);
    //$result = $mysqli->query($query,MYSQLI_STORE_RESULT);

    while($row = $result->fetch_array(MYSQLI_ASSOC))
    {

    print('testing');
    $article = new ArticleDBV0();
    $article->articleID = $row['ARTICLE_ID'];
    $article = new ArticleDBV0();
    $article->description = $row['ARTICLE_TXT'];
    $article = new ArticleDBV0();
    $article->category = $row['CATEGORY'];
    $article = new ArticleDBV0();
    $article->topic = $row['TOPIC'];
    $myArticles[]=$article;


    }

    return $myArticles;
    }

    }

    ?>

    flex code is as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout = "absolute" creationComplete="myservice.getOperation('getArtic leDBV0').send();">
    <mx:RemoteObject id="myservice" source= "ArticleService"
    destination="amfphp" fault="faultHandler(event)"
    showBusyCursor="true">
    </mx:RemoteObject>
    <mx:ataGrid x="10" y="10" width ="381" id="articles_dg"
    dataProvider="{dp}" change="changeHandler(event)" height="350">
    <mx:columns>
    <mx:dataGridColumn headerText="ArticleId" dataField="articleId"/>
    <mx:dataGridColumn headerText="ArticleTxt" dataField="description"/>
    <mx:dataGridColumn headerText="Category" dataField="category"/>
    <mx:dataGridColumn headerText="Topic" dataField="topic"/>
    </mx:columns>
    </mxataGrid>

    <mx:Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    import mx.controls.Alert;
    import mx.rpc.events.FaultEvent;
    import ArticleDBV0;
    import mx.collections.ArrayCollection;
    import mx.utils.ArrayUtil;

    [Bindable]
    private var dp:ArrayCollection;

    [Bindable]
    private var article:ArticleDBV0;

    private function faultHandler(fault:FaultEvent):void
    {
    Alert.show(fault.fault.faultString, fault.fault.faultDetail.toString());
    Alert.show(fault.fault.faultString, fault.fault.faultCode.toString());
    Alert.show(fault.fault.faultString, fault.fault.faultString.toString());

    }

    private function getArticlesHandler(event:ResultEvent):void{
    dp = new mx.collections.ArrayCollection(ArrayUtil.toArray(e vent.result));
    }
    ]]>
    </mx:Script>

    <mx:Button x="10" y="368" label="Get Articles"
    click="myservice.getOperation('getArticleDBV0').se nd();"/>
    <mx:Form x="399" y="10" width="329" height="320">
    <mx:FormHeading label = "Article Updater" width="99"/>
    <mx:FormItem label="Id">
    <mx:TextInput id="article_id" text="{article.articleId}"
    width="200"/>
    </mx:FormItem>
    <mx:FormItem label="Topic">
    <mx:TextInput id="article_topic" text="{article.topic}"
    width="200"/>
    </mx:FormItem>
    <mx:FormItem label="Description">
    <mx:TextArea id="article_text" text="{article.description}"
    width="200" height="121" />
    </mx:FormItem>
    <mx:FormItem label="Category">
    <mx:TextInput id="article_category" text="{article.category}"
    width="200"/>

    </mx:FormItem>
    </mx:Form>
    </mx:Application>

    package
    {
    [Bindable]
    [RemoteClass(alias = "ArticleDBV0")]

    public class ArticleDBV0
    {
    public var articleId:int;
    public var description:String;
    public var topic:String;
    public var category:String;

    public function ArticleDBV0() {

    }

    }


    }

  2. Join Date
    Jul 2009
    Posts
    6

    re: trouble with amfphp 1.9

    hi-

    i just found the service browser.
    it is telling me which lines might be the problem.
    the service browser didnt like my require_once php line.
    when i commented that line out it told me that my method
    getArticleDBV0 had no description given.

    so that is where i will focus tomorrow.

    as for too many php-cgi.exe processes, i dont know.
    not really cool.
    thanks, mtdew3q

  3. Join Date
    Jul 2009
    Posts
    6

    re: trouble with amfphp 1.9

    hi-

    i found this link for charles.
    http://ubergeek.tv/article.php?pid=92

    since i need more error msg to troubleshoot, that will be next.

    it will have to wait until tomorrow. i already stayed up a little too late.

    thanks,
    later

  4. Join Date
    Jul 2009
    Posts
    6

    re: trouble with amfphp 1.9

    hi-

    i've all but given up my approach as i received the error message cant find amf3broker in classpath. i used a diagnostic tool (service capture) i have on loan for up to 15 days. it did give me more feedback but i couldnt get past this one. i tried yahoo and google and couldnt get things to work. i didnt get a sense that it was an easy error or that people had a lot of confidence or success in solutions to overcome that error.now i will try as3flexdb kit and hope things improve.

    http://www.alivelearn.net/?p=814

    i am rather frustrated that i dropped 16 dollars on advice that chapter 7 from a book on php services and amfphp was a good tutorial and i cant get it up and running. but it will be a small price to pay if i ever do figure it out after revisiting the error at some point in the future.

    things could get really cool in a hurry if i get as3flexdb kit to work.

    later

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts