Zend AMF Data Service Return Problem

Hi Folks,
I am working with FB4 and Zend AMF/PHP and MySQL.  I began integrating the PHP stuff using the great article by Mihai Corlan called 'Working in Flash Builder 4 with Flex and PHP.  I followed all the steps exactly, aside from creating my own app-specific PHP classes and functions, etc...  I 'hooked up' the Zend stuff just like the article, created a text datagrid, just like the article, and viola!, it worked.  I then tweaked it a bit and interwove it into my 'real' component.  So far, so good.
Then I created a second PHP class with a different 'get data' type of function.  It queries a different table in MySQL, but is essentially the 'same' as the query/function in the initial PHP class.
In FB, in the Data Services window, I choose the 'Connect to Data/Services' function, just like the first time.  I then find/select my PHP class file and FB 'interrogates it' enough to show me the function that exists in the class.  I 'finish' the operation and it adds a new 'service' to the list of services in that window.  Again, so far, so good.
The problem comes when I try to 'test' the service or 'configure return types' (which basically requires a 'test' operation anyway).  I can enter the 'input' params just fine, but when I try to execute the call, I get the following error:
InvocationTargetException:There was an error while invoking the operation. Check your operation inputs or server code and try invoking the operation again.
Reason: An error occured while reading response sent by server. Try encoding the response suitably before sending it. e.g. If a database column contains UTF-8 characters then use utf8_encode() to encode its value before returning it from the operation.
I don't know where to go after this.  Again - the 2nd PHP class is essentially identical to the 1st.  The function in it is essentially identical, differing only by the input params, the name of the function and the actual SQL it sends to MySQL.  There is no special text, no special characters, no image stuff, nothing.  I do not 'encode' the results of the function in the first class - in fact the code in the second class is practically identical to the first.  I do not know what the error is talking about.  My guess is that it's more of a generic message.
I can debug the PHP code just fine from within a seperate instance of Eclipse.  The function runs/returns just fine - an array of PHP-defined objects (simple strings).
Any insights or advice would be welcomed.   Thank you,
-David Baron

Thank Jorge, but that was not the issue, though, it may be related.
I checked the mySQL my.ini file, and there was already an entry for:
[mysql]
default-character-set=utf8
I added the 'default-collation=utf8_unicode_ci', like you suggested, but that didn't do anything.
I checked the Apache httpd.conf file, and added the following line 'under' the "DefaultType text/plain" line:
AddDefaultCharset UTF-8    but that did not do anything.
I checked my mySQL database, all the tables involved.  They were already at UTF-8 (default).  However, some of the 'varchar' columns were defined as 'latin 1-default collation'.   I changed them all to utf-8 (default table collation), but that did not help either.
Finally, I found the problem, though I don't really know if it is "my" problem, or ZendAMF's problem, or Adobe's problem.
It turned out that 'some' of my data had a 'bad' character in it.  Specifically, I had 'copied and pasted' some data from MS Word into mySQL Workbench.  Some of the data included the 'elipsis' character - you know, when you type "..." (dot dot dot) in MS Word, it replaces the three periods with a single elipsis character.  Although PHP could easily query and assemble this data into a nice object array, I noticed that that character showed up (in PHP's debugger) as a 'box' character, meaning "bad character".  Thus, I guess, Zend AMF and/or FlashBuilder could not 'bring over' and/or deal with this type of character.  As soon as I replace the few instances of that character with three periods, everything began to work perfectly.
So... what to do about this?  I thought I was through with silly encoding/decoding of data when I left JavaScript and HTML behind in moving to FlashBuilder technology.  Am I really going to have to worry about this kind of thing?  Or might this be a bug/deficiency somewhere in the stack?
Thanks for your help,
-David

Similar Messages

  • Data service returning an empty object

    Hi
    I am trying to call a data service from the flex to load my
    data grid. In the debug, i saw that the arrraycollection in the
    fill method is being returned empty. here are the details....
    My .java file has the same names with the set and get
    functions which are set by my java assembler class.
    I am calling other fill methods and they seems to be working
    fine except this one....

    The problem was that the name of the destination
    "codecoverage" was same as that of one of the packages where my
    .java file was there. Changed this name and things started to
    work..:-)

  • How can I get rid of a type generated by the Data/Services return type wizard?

    Hi All,
    I have a JSON service that returns an object called "error".  The Data/Services "Configure Return Type" wizard automatically turned this into a class "Error".
    However, this caused over a hundred errors to show up inside the generated classes, "Call to a possibly undefined method Error."  That's because of lines like this:
    throw new Error(propertyName + " is not a data property of entity Agreements"); 
    It's trying to throw a regular "Error" object, but now that there's an "Error" class in the same package, that is taking precedence--and that Error object doesn't have a constructor with a single parameter.  At least, that's what I think is going on.
    I tried to fix it by deleting _ErrorEntityMetadata.as, _Super_Error.as, and Error.as from the valueObjects package.  I then opened the FML file and deleted the definition for the entity "Error" and every reference to the Error entity (class) in my FML file.
    I then changed my JSON service so that it returns an object called "serviceError" instead of just "error".
    But, whenever I re-run the "Configure Return Type" wizard, it regenerates the Error class, even though I've deleted it from everywhere I can find it.  That breaks my project completely!  How can I end this and get Flash Builder to *stop* generating this type!
    In the "Configure Return Type" wizard I very carefully inspected the type of every bit of data coming back to make sure none of them show up as type "Error."  And they don't (as expected, since I changed the object's name to serviceError--now the type of that object is ServiceError.
      -Josh

    I think you are facing this known issue https://bugs.adobe.com/jira/browse/FB-29770
    Please vote it.
    Thanks for the link--I just voted for it.
    To avoid this, in the last page of "Configure Return Type", edit return type name to something else (You can also edit subnodes's name too in the wizard).
    Actually, that's exactly what I saw doing; I apologize if that wasn't clear in my post.
    I closed and restarted Flash Builder, and once I did that Flash Builder stopped generating the Error class.  My guess is that the FML file, even though I had updated it (by deleting all references to the Error class), was cached in some fashion by Flash Builder, and restarting Flash Builder forced it to reread the FML file?
    Additional point of clarification: my understanding is that the FML file stores all the metadata about the services that Flash Builder has been able to figure out so far, and when you run the Configure Return Type wizard, it will regenerate *every* type in the FML file, even if that type is not mentioned anywhere in the particular return value that you are working with.
    Edited to provide additional thoughts on FML file.

  • Data Services Designer - Problem when inserting rows in a database

    Hi everyone!!!
    I created a simple job that queries an Oracle database and writes the data returned from the query in a database as mysql.
    The problem is that only one row is being written in the database, being that the return of my query has more than one row.

    What product ad what version you are running and what environment you are in?
    Are you also getting some error?
    BAshir Awan

  • Data Services Installation problem

    Hi Experts
    My present scenario , I have to build Business objects Enterprise,Webi.Portal and Dataservices.Ou server Enviornment is
    1. Windows 2003 Enterprise X64 Edition
    2. SQL Server 2008.
    Both BI and BO will be in same machine / server
    I have installed the follwoing components and with the sequence as given.
    Before installing BOE as per the guide i had created a Database (DBSID: BOB) in MS SQL Server and a user with ( OS level Adminstrator and Users group added). And created an user SERVERNAME\bobadm. and odbc DSN was cerated from c:\windows\syswow64 as well as from contraol panel also thro windows authentication which test data was successful.
    Now
    1. Installed BO 3.1
    2. Installed SAP GUI 7.1 ( with BW and BI addon)
    3. Installed Java Connector and placed the library files as required.
    4. Installed Crystal Reports 2008 V1.
    5. Installed Integration Kit for SAP and Configured.
    Here when i check at the MS SQL Server cud see the tables were created by the CMS application and all my data were stored.And i cud do logon from CMC,InfoView,Webi to my BI SAP server. I cud able to see the roles which i have created in BI server.
    HERE now my next requirement is to install BO DataServices and BO Portal. which were new to me as above.
    For BO Dataservices i started installation i had given thro Windows authentication and after the Configure Metadata Integarator step i had provided the details of the Database with port number as 6400 ( CMS default port) which triggered the following error
    An I/O error occurred while receiving the TDS prelogin response.
    and the next err:
    The database exists but the repository tables are not valid. (BODI-300032)
    and the next err
    (12.1) 09-07-10 14:05:41 (E) (8784:8684) CON-120302: ODBC call <SQLDriverConnect> for data source <SERVERNAME> failed: <MicrosoftODBC SQL Server DriverSQL ServerLogin failed for user 'bobadm'.>. Notify Customer Support.
    (12.1) 09-08-10 14:39:16 (E) (3208:8608) CON-120302: ODBC call <SQLDriverConnect> for data source <SERVERNAME> failed: <MicrosoftODBC SQL Server DriverSQL ServerLogin failed for user 'bobadm'.>. Notify Customer Support.
    (12.1) 09-08-10 14:39:26 (E) (8492:1636) CON-120302: ODBC call <SQLDriverConnect> for data source <SERVERNAME> failed: <MicrosoftODBC SQL Server DriverSQL ServerLogin failed for user 'SERVERNAME\bobadm'.>. Notify Customer Support.
    (12.1) 09-08-10 14:40:16 (E) (6192:8380) CON-120302: ODBC call <SQLDriverConnect> for data source <SERVERNAME:6400> failed: <MicrosoftODBC SQL Server DriverDBNETLIBInvalid connection.>. Notify Customer Support.
    I think the err is the application coudl; not loginn through the SQL Authentication. and what is the issue.

    Hi
    Yes i selected "Windows Authentication" but it gave the following error.
    that is the start of my issue.
    (12.1) 09-07-10 14:05:41 (E) (8784:8684) CON-120302: ODBC call <SQLDriverConnect> for data source <SERVERNAME> failed: <[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'bobadm'.>. Notify Customer Support.
    errorlog.txt:
    (12.1) 09-08-10 14:39:16 (E) (3208:8608) CON-120302: ODBC call <SQLDriverConnect> for data source <SERVERNAME> failed: <[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'bobadm'.>. Notify Customer Support.
    (12.1) 09-08-10 14:39:26 (E) (8492:1636) CON-120302: ODBC call <SQLDriverConnect> for data source <SERVERNAME> failed: <[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'SERVERNAME\bobadm'.>. Notify Customer Support.
    (12.1) 09-08-10 14:40:16 (E) (6192:8380) CON-120302: ODBC call <SQLDriverConnect> for data source <SERVERNAME:6400> failed: <[Microsoft][ODBC SQL Server Driver][DBNETLIB]Invalid connection.>. Notify Customer Support.
    repoManBatch.txt:
    The database exists but the repository tables are not valid. (BODI-300032)
    TestDbConnectionErr.txt:
    An I/O error occurred while receiving the TDS prelogin response.
    TestDbConnectionLog.txt:
    09/08/2010 14:38:22 [  SEVERE ] Unable to create connection factory for Informix:com.acta.db.ActaInformixConnectionFactory. null (BODI-3013019)
    09/08/2010 14:38:22 [    INFO ] Delaying the loading of DB2 JDBC driver classes. (BODI-3013011)
    09/08/2010 14:38:54 [  SEVERE ] Unable to create connection factory for Informix:com.acta.db.ActaInformixConnectionFactory. null (BODI-3013019)
    09/08/2010 14:38:54 [    INFO ] Delaying the loading of DB2 JDBC driver classes. (BODI-3013011)
    09/08/2010 14:39:43 [  SEVERE ] Unable to create connection factory for Informix:com.acta.db.ActaInformixConnectionFactory. null (BODI-3013019)
    09/08/2010 14:39:43 [    INFO ] Delaying the loading of DB2 JDBC driver classes. (BODI-3013011)
    09/08/2010 14:40:42 [  SEVERE ] Unable to create connection factory for Informix:com.acta.db.ActaInformixConnectionFactory. null (BODI-3013019)
    09/08/2010 14:40:42 [    INFO ] Delaying the loading of DB2 JDBC driver classes. (BODI-3013011)
    09/08/2010 14:40:53 [  SEVERE ] Unable to create connection factory for Informix:com.acta.db.ActaInformixConnectionFactory. null (BODI-3013019)
    09/08/2010 14:40:53 [    INFO ] Delaying the loading of DB2 JDBC driver classes. (BODI-3013011)
    09/08/2010 14:50:41 [  SEVERE ] Unable to create connection factory for Informix:com.acta.db.ActaInformixConnectionFactory. null (BODI-3013019)
    09/08/2010 14:50:41 [    INFO ] Delaying the loading of DB2 JDBC driver classes. (BODI-3013011)
    regards
    bala

  • IPhone 5 cellular data services failing

    ISSUE/SYMPTOMS:  iPhone 5 ONLY: Cellular Data stops intermittingly, cellular data locks up without warning, Wi-Fi data connection not working on occasion, iCloud contacts, calendar and reminders not updating, Find My Phone not working, mail or Internet not available or server time-outs. No error messages though. All of these are symptoms of no data service. Problems seem to be related to iPhone 5 failing to switch between LTE and 4G or 3G data services on AT&T.
    My iPhone 5 32GB AT&T version (iOS 6.0.2) along with my clients and family using iPhone 5 in the state of Oklahoma are having this issue on their AT&T iPhone 5's:  no cellular data connection re-established if at anytime the LTE connection is lost or weak.  As with iPhone's prior to iPhone 5, the iPhone 5 is supposed to drop down to the next tier of data service and re-connect to cellular data service when the higher speed cellular data service is not available.  Apparently this is not working well on the iPhone 5.
    What led me to research this LTE issue was that my iPhone was not syncing on iCloud with contacts, calendars and reminders with my other iOS devices.  Other times this issue became apparent was when iMessage quit sending and receiving until I would reboot my iPhone (sometimes it would finally send the message as a “text message”). When I had these problems I also found out I was not getting any cellular data service for Internet browsing, mail, Maps, Find My iPhone, etc.  This would happen without notice. In other words I would not receive any notice or error message that data service had stopped other than the fact I was not receiving any mail, iMessages, or iCloud sync updates. My only resolution was to reset or reboot my iPhone several times a day, and that would resolve it about 70% of the time. 
    I have talked to Apple Support on 2-3 occasions in the last week and AT&T Support twice in the last 2 days.  If it is really true, only the AT&T Technical Support Advisor informed me of a nationwide issue relating to iPhone 5 and LTE:  iPhone 5's are not re-connecting to 4G or 3G cellular data service once the LTE data connection is lost or dropped... the voice calls continue to work, but cellular data service fails and stays locked up without an error message until the customer reboots the iPhone.
    Obviously this is very unacceptable. We depend on these data services and at minimum need to know when it stops working instead of finding out from a phone call that someone sent us an important email or something.
    The AT&T representative also said that both AT&T and Apple are aware of and are working on the issue as it is a nationwide problem with iPhone 5 and LTE. The Apple Support Advisors I talked to made no mention of this "known" issue. AT&T said that it is partly AT&T responsibility because the capacity of LTE is overloaded and cellular data connections are dropping because of the lack of coverage and/or capacity. They actually refunded my data service for a whole month in apology for the inconvenience (I did not even ask for that--I just want my data service to work).  But they also said that Apple has responsibility in this issue because the iPhone 5 should drop down and re-connect to the next lower tier of data service when LTE is not available or lost; instead, it is locking up somehow or it still thinks it is connected to LTE when it is actually not. I don't know how accurate these statements are, but my problem is real.
    TEMPORARY WORK-AROUND / FIX FROM AT&T:  Disable LTE on the iPhone 5.  Or when you figure out that data is not coming to your iPhone, use Airplane Mode ON/OFF for a few seconds to force re-connection to a tower without rebooting the iPhone.  You can Disable LTE on the iPhone 5 in SETTINGS/GENERAL/CELLULAR. I have disabled LTE on my iPhone 5 and have not had any of these cellular data issues since. 
    Disabling LTE is not acceptable either, but it is working. At least I seem not be losing connection or locking up without knowing it.  In my office over the course of a day, my iPhone 5 will jump back and forth on LTE and 4G sitting in the same place.  Disabling LTE has stopped this and the problem, but the iPhone 5 should switch cellular data services seemlessly just like the phone switches towers on a phone voice call seemlessly (most of the time).
    WI-FI ALSO STOPS WORKING SOMETIMES AFTER THIS LTE disconnect / lock-up issue:  That has been my experience along with my clients and family as well. If you use Wi-Fi a lot on your iPhone it will hide this LTE issue until you leave your Wi-Fi and get on LTE and then drop LTE (silently) and then go back to your Wi-Fi.  My experience has been I have to reboot the iPhone to even get Wi-Fi working again after that happens.
    I do not know if some of these comments and analysis are really accurate or valid or not... all I know for sure is since I upgraded my iPhone to the 5 along with my other family members and clients, we have had "no data" on many occasions and are continually rebooting our iPhones and looking for what is wrong. 
    My questions to the support community are these:
         1. Is anyone else having this issue? Or is it just me and my few? Maybe a lot of people do not realize they are not getting their data because they are on Wi-Fi most of the time or they are just rebooting and not trying to identify the real problem. AT&T said it was nationwide iPhone 5/LTE issue.  Anyone else heard that from either Apple or AT&T?
         2. Is this an iPhone 5 / Apple issue or is AT&T solely responsible? Or is it both? Where do we get a solution??? Is AT&T LTE holding false connections with iPhone 5 or is the iPhone 5 failing to recognize a dropped LTE cellular data connection and then failing to attempt to re-connect with 4G or 3G?
         3. Did I miss where this issue is posted? I searched Apple Support and Communities and did not get any hits.  Any updates or further insight on the issue? Any other fixes other than Disabling LTE?
          4. If this is in fact a real issue belonging in part to the iPhone 5, we need to escalate Apple’s attention to it.
    Thanks in advance for your help and feedback.

    Thank you fellow users and experts for your feedback and updates. Sorry about the large font on the original post... accidental via cut and paste.
    I have escalated the issue with both Apple and AT&T.  I actually got senior level troubleshooters from both Apple and AT&T on the phone at the same time... rare moment. Here are the key points of the update:
         1. AT&T did NOT confirm the earlier statement by another AT&T Technical Support Agent that this was an emerging nationwide issue about iPhone 5 and LTE losing data connection and not reconnecting at a lower level or re-connecting to LTE once the signal came back. So that earlier statement was not accurate as suspected by all of us. The senior tech at AT&T said he has seen this issue sporadically over the last month or so, but only with about 3-4 customers.  He said it seems to be location or phone dependent (some phones not all phones).
         2. The Apple Tech was satisfied that all that could be done to eliminate my issues possibly relating to my instance of software / iOS had been accomplished except erasing my iPhone and restoring as a new phone (I have avoided this inconvenience with the argument that other family/clients with the iPhone 5 have had the same problem).
         3. AT&T went so far as to examine which towers I had been connecting to over the last week and looked at other technical data that could possibly explain the issue. I now know I have 3 towers that provide LTE within 4 miles of my home/office, one within a half mile.  But so far there is nothing to explain or even properly identify the issue.  AT&T offered me to take my phone to an AT&T store, try to force replicate the problem there, if so, the store would put my SIM card in a brand new iPhone 5 (just to test) and try tor replicate the problem again. If replicated on a new phone, there is a deeper issue; if resolved on a new phone, the answer is obvious. I have not taken the time to do this yet.
         4. On Friday, Jan 4, 2013 while talking and between the tech support calls (on a different phone), I was able to re-create the problem 2 separate times in my home/office by forcing my iPhone to weaken its connection to service (burying it under electronic gear) and then waiting a few minutes, then trying to browse the Internet--no data service unless I manually reset the connection.  I am only able to cause the issue to occur if there is at least 15 min of idle time after a weak signal condition AND only if I don’t completely lose a connection to cellular voice service. It seems that if you go down to NO SERVICE the phone will do new a search and keep searching until reconnects to LTE or other signals correctly, but a weak connection seems to be strong enough for voice service but can sometimes cause the LTE data service to stop without reconnecting to LTE, 4G or 3G unless I manually intervene. It also seems that idle time with a weak connection is also necessary to re-create the problem manually.  Since Friday, I have not been able to re-create the problem. This has been an intermittent problem, so who knows.
    FYI, I have never had this problem with my new iPad (also on AT&T LTE) that has been with me when the iPhone fails to have data service, but my iPad is never in my pocket or other places with perhaps less signal.
    Again, if you are connected to Wi-Fi on your iPhone 5 most of the time, you may never notice this issue if you are even having it.
    So far no progress on the real issue or resolution, but both Apple and AT&T have put forth very admirable effort.
    If you or others you know are having this issue, please take the time to post a reply to this issue. Thank you.

  • Problems returning complex objects from a php data service

    either the data services tool is buggy or i am doing something wrong. here is the code:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
         xmlns:s="library://ns.adobe.com/flex/spark"
         xmlns:mx="library://ns.adobe.com/flex/halo"
         minWidth="1024" minHeight="768"
         xmlns:personservice="services.personservice.*"
         initialize="init()">
         <fx:Script>
              <![CDATA[
                   import mx.rpc.events.ResultEvent;
                   import mx.controls.Alert;
                   import mx.collections.ArrayCollection;
                   public var people:ArrayCollection;
                   private function init():void {
                        getPeopleInMyWorldResult.token = personService.getPeopleInMyWorld();
                   protected function getPeopleInMyWorldResult_resultHandler(event:ResultEvent):void {
                        people = new ArrayCollection(event.result as Array);
              ]]>
         </fx:Script>
         <fx:Declarations>
              <s:CallResponder id="getPeopleInMyWorldResult" result="getPeopleInMyWorldResult_resultHandler(event)"/>
              <personservice:PersonService id="personService"
                   destination="PersonService"
                   endpoint="http://localhost/photoapp/Test3-debug/gateway.php"
                   fault="Alert.show(event.fault.faultString)"
                   showBusyCursor="true"
                   source="PersonService"/>
         </fx:Declarations>
    </s:Application>
    <?php
    class Person {
         public $name;
         public $cars;
    class Car {
         public $year;
         public $make;
         public $model;
    class PersonService {
         public function getPeopleInMyWorld() {
              $person1 = new Person();
              $person1->name = "John Doe";
              $car1 = new Car();
              $car1->year = 2005;
              $car1->make = 'audi';
              $car1->model = 'A6 Quattro';
              $car2 = new Car();
              $car2->year = 1970;
              $car2->make = 'datsun';
              $car2->model = '510';
              $person1->cars = array($car1, $car2);
              $person2 = new Person();
              $person2->name = "Jane Doe";
              return array($person1, $person2);
    create a new "flex" project in FB Beta1 with a php server. Setup the application and php script as normal, then configure the return type for the getPeopleInMyWorld function. I created a new return type called "Person" and was quite please to see that FB automagically created a "Cars" class with the all the right properties.
    Unfortunately, if you run the code (try debug mode and put a breakpoint on the result handler) you'll notice that "john doe" has lost his cars and that you also get the silent (check console) error:
    TypeError: Error #1034: Type Coercion failed: cannot convert []@1226bc49 to mx.collections.ArrayCollection.
    any ideas??
    i can get this to work by using json, but it's extra work, the com.adobe.serializers.json.JSONDecoder has little documentation, and the method outlined above is just begging to work.
    so, how are the rest of you getting complex data back from your servers? json?? amfphp?? xml (but surely not)??
    also, since i'm here discussing data services, if any adobe ppl are about, please throw one extra voice behind the following feature requests:
    1) support for optional service call arguments (http://bugs.adobe.com/jira/browse/FB-19659)
    2) a button for automatically 'generating service calls' from within the data services panel.
    thanks,
    - e

    Thank you Gaurav for pointing me in the right direction. There was some debate in the blogs as to which data transferring method (amfphp, json, or xml) was best. See
    http://blogs.adobe.com/mikepotter/2006/07/php_and_flex_js.html
    and
    http://www.5etdemi.com/blog/archives/2006/12/clearing-the-fud-on-amfphps-speed-versus-json -and-xml/
    I used json yesterday
    php:  json_encode(array($p1, $p2));   // observation: you only have to encode once as opposed
                                          // to using amf on each array...
    FB:   private var jsonD:JSONDecoder = new JSONDecoder();
          var jsonString:String = {{{return result from service call}}}
          myPeople:ArrayCollection = jsonD.decode(jsonString, services.personservice.Person);
    Note that in FB you can use the services.personservice.Person class as an optional argument in the jsonD.decode function. This class can be automatically generated using FB's built-in data service's panel when you try to configure the return type (as I described above). The json data should unserialize correctly with Cars objects automagically created and everything (a huge time saver!!).
    It worked for me, though I'm not sure how deep the unserialization process is capable of going (objects within objects w/in objects, for example). Also I had some trouble with adobe's jsonDecoder; it had trouble eating (uhm parsing) hollow objects (i.e. objects with null properties), whereas the php_encode / php_decode handled these objects w/o fail.
    Anyway, will be reading up on amf. Tanx again Gaurav,
    - e

  • Zend Amf & Flex 3, problem when many records returned

    I have a project with a start dateField (calendar) and an end dateField (calendar). The user chooses a start date and an end date and the database pulls latitude and longitude coordinates for events that occurred between those dates. If the user chooses dates that produce fewer than roughly 11,200 records, it works perfectly.  If the user chooses dates that produce more than that, it produces the following error message:
    faultCode:Client.Error.DeliveryInDoubt
    faultString:'Channel disconnected'
    faultDetail:'Channel disconnected before an acknowledgement was received'
    The server is my local machine (localhost). I'm running:
    MAMP   (which has  Apache 2.0.59)
    Flex 3
    I tried editing the my.cnf (mySQL options file) and increased the max_allowed_packet to 32M, but that didn't work.
    It's a strange problem as the same code works when a relatively small amount of data is returned, but doesn't work when more data is pulled. Could it be some sort of memory or packet limit or a time-out that is called?
    If anyone has any suggestions, please let me know. 
    -Laxmidi

    Richard Bates of flexandair.com figured it out. In my php.ini file, I had the memory limit set at 8M. After, changing it to 32M, it worked. Thank you, Richard!
    -Laxmidi

  • Problems on Windows 7 Professional 64 with PHP data service

    I've created a data service using PHP in a PHP Eclipse project and I'm trying to connect to it from my new Flash project. When I try to create a custom data type via the Configure Return Type dialog, "Auto detect the return type from sample data" radio button, I get the following error:
    There was an error while invoking the operation. Check  your operation inputs or server code and try invoking the operation again. 
    Reason:
    Warning: mysqli::mysqli() [mysqli.mysqli]: (HY000/2003): Can't connect to MySQL  server on 'localhost' (10061) in  C:\Users\davidk\workspace\php-global-includes\mysqlAccess.inc.php on line  11
        /0/onStatusÿÿÿÿ �SIflex.messaging.messages.ErrorMessage extendedData faultCode faultDetail faultString rootCause correlationId clientId destination messageId timestamp timeToLive headers  body  „m …a#0  C:\Zend\ZendServer\share\ZendFramework\library\Zend\Amf\Server.php(550):  Zend_Amf_Server->_dispatch('getProductVersi...', Array, 'GetPlayData')#1  C:\Zend\ZendServer\share\ZendFramework\library\Zend\Amf\Server.php(626):  Zend_Amf_Server->_handle(Object(Zend_Amf_Request_Http))#2  C:\Zend\Apache2\htdocs\play-debug\gateway.php(69):  Zend_Amf_Server->handle()#3 {main} ‚UError instantiating class GetPlayData to  invoke method getProductVersions: Error connecting to database server as user  via password configured in  config_cdna_testdb.php  IE83D9958-920E-E203-54BC-E5365BD85289 I5496259E-8C36-AC89-E234-00000D37FD49  I7E8A1BD7-9D60-9329-DBFB-00001B5BE8C7  126823334100     
    Note that I've tested the GetPlayData class and the getProductVersions() method with some simple "unit testing" code and it works fine when I execute it directly. It just won't run when called from this dialog.
    I tried to debug the gateway.php process that is used to do this connecting without much success so far.
    Is Windows 7 supported for PHP data service development in this beta release? I'm using Version 4.0 build 253292

    One more clue: the message from the exception shows that the global variables I'm using to configure the MySQL connection parameters are not set somehow. Maybe I need to upgrade my Zend Framework?
    Nope. I upgraded to the latest Zend Framework and it still did not work. The global variables are not working. When I hard coded the connection parameters into the constructor of the GetPlayData class, then it worked fine. I just switched to using define() to create constants instead of using the globals and that worked, too.
    It is as if globals set in one include file are not available in another include file. I agree that using them might be a bad programming practice of sorts, but it seems wrong to disallow / not support something that is part of the core language!
    So, I don't know if this is a Windows 7 thing or just a general behavior. Globals within the same file seem to work fine still, but not from another include file.
    So the answer for me is to not use these cross-include file globals in code that is going to be used from Flash Builder.

  • How to setup Data services to use existing zend application

    The application I'm working on is going to have views created both in Flex and in PHP. Thus, we want to setup the Zend framework so that it can be used for the PHP part of the application and to display views in the browser. We want to setup the AMF gateway so that it's a service provided through a controller in Zend and with the actual service classes hidden from public view in the application folder, and not like the default now seems to assume that you create a folder in your public webroot where the endpoint and all service classes live.
    So the structure we are after is
    Zend_AMF endpoint at http://example.com/services/amf
    Zend folder structure:
    application/controllers/ServiceController.php    // the controller that handles all incoming requests, so acts as the gateway.phpI assume
    application/services/amf/    // contains the actual service classes, e.g. Users.php, Products.php
    public/swf/    // will contain the actual .swf files for the Flex application
    the /public/ folder is set to the webroot with /application/ outside the webroot as per the Zend framework recommendations.
    I would like to use the Data service introspection to generate the Flex code for the services, however the introspection afaik requires the services to be in the /public/ folder or a subfolder there. So how can I make introspection work for a service that lives in /application/services/amf and is accessed through http://example.com/services/amf ?
    Suggestions? links to tutorials?

    Yes, well hopefully this will be supported in the future. In the mean  time, I've noticed that it's only actually when creating the service  and the API for it that you need to have the class inside the web root.  In order to configure the return types and input types you don't need to  go through the standard gateway.php anymore. So, although not ideal,  here's how I do it right now:
    1. I have set up m zend  framework as described in my first post, with my AMF service gateway being a Zend controller and not the gateway.php
    2. I create the service class with the API I need inside the application/services/amf folder. If the service needs to connect to the database then I create a Zend Db Model using the zf command line tool (as per Zend framework practices) and then hook my service class to use that. Which basically means that my service classes are very slim and simple.
    3. When I created the Flex project I created a dummy service using the sample  php, which has set up Flash builder with the default gateway and so on
    4. Once I've created my service class, I copy the file to the default location where Flash Builder wants to create my services. I then strip out any implementing code from the copied file, leaving only the public API and empty methods.
    5. I then create a new service in Flash builder, point it to the stubb class in the default location and let the introspection discover the public api. This will of course mean that all input values and return values are generic objects.
    6. After this is done I delete the stubb class. In the created AS service class I override the service endpoint so that it points to my real gateway controller within the zend framework.
    7. After this is done I can configure the return types and input types using auto discovering. It will connect to the real gateway and ignore the default gateway and thus I can develop against the real endpoint and don't need to create my service classes within the public location of the Zend folder structure.
    It's a bit of a workaround for sure, but since I don't create new services that often and I can have Flash builder update my return types etc. automatically this way, I figure it's worth the extra steps. Still, I would hope that in the future Flash builder will support having the introspection happen on a location outside the projects own web root.

  • Using Data Services (AMF) with Android

    Hello,
    I'm working on Android application which needs to invoke existing AMF service.
    I've read the following post:
    Creating an Android application that invokes Data Services
    ...which states that you need flex-messaging-client-android.jar as part of your build to be able to use Data Services.
    This took me to the following post:
    Create a Data Services application for the Experience Server that returns data
    From there I managed to set up Expesience Server and connect to the Packages, but nowhere can I find the "dataservices-sdk-pkg.zip" which is suppose to contain the flex-messaging-client-android.jar. All I can find is "dataservices-pkg.zip" which does not have "flex-messaging-client-android.jar", but has bunch of other JARs. I've also spend reasnoble amount of time seraching through Package Share, but no luck.
    I've also Googled and read through all other posts relaetd to this topic and none of them seem to lead to success
    So my question is:
    when connecting Android application to AMF backend, do we still need to use the "flex-messaging-client-android.jar" or is there a new JAR that has replased this?
    If "flex-messaging-client-android.jar" needs to be used, could you help me find it.
    Thanks

    Found it...
    In the Package Share found the following package: es-sdk-pkg
    Downleaded that, then saved to local drive, then unzip.
    In "es-sdk-pkg" package you can find "dataservices-sdk-pkg" in the following location:
    ...\jcr_root\etc\packages\adobe\aep\platform\sdk
    Unzip "dataservices-sdk-pkg" and the "flex-messaging-client-android.jar" is in the following location:
    ...\jcr_root\etc\aep\sdks\riaservices\dataservices\4.5.1\android
    Hope this helps someone else.

  • System.InvalidOperationException: Call to Excel Services returned an error. --- Microsoft.AnalysisServices.SPClient.Interfaces.ExcelServicesException: We're sorry. We ran into a problem completing your request

    0
    HI All,
    I  am having problem with the power pivot dashboard.
    power pivot dashboard processing job fails with the follwoing error message.
    SP 2013 with 2008 r2
    SQL 2014 power pivot on new analysis server.
    Data refersh of cube and database works finw form the power pivot gallery.
    The Execute method of job definition Microsoft.AnalysisServices.SPAddin.UsageProcessingTimerJob (ID 726034a7-b9a9-45a6-b720-640b3f785e49) threw an exception. More information
    is included below.  Call to Excel Services returned an error.
    ULS error:
    EXCEPTION: System.InvalidOperationException: Call to Excel Services returned an error. ---> Microsoft.AnalysisServices.SPClient.Interfaces.ExcelServicesException: We're sorry.
    We ran into a problem completing your request. ---> Microsoft.Office.Excel.Server.WebServices.ExcelServerApiException: We're sorry. We ran into a problem completing your request.   
     at Microsoft.Office.Excel.Server.WebServices.ApiShared.ExecuteServerSessionMethod(Boolean hasSessionId, String sessionId, CoreServerSessionMethod coreWebMethod, String name,
    Boolean skipFeatureCheck)   
     at Microsoft.Office.Excel.Server.WebServices.ExcelService.OpenWorkbookInternal(String workbookPath, Boolean editingMode, String uiCultureName, String dataCultureName, Boolean
    newWorkbook, Boolean suppressRefreshOnOpen, Boolean openExclusive, Status[]& status)   
     at Microsoft.Office.Excel.Server.WebServices.ExcelService.OpenWorkbookEx(String workbookPath, String uiCultureName, String dataCultureName, Boolean exclusive, Status[]&
    status)    
     at Microsoft.AnalysisServices.SPClient.ExcelApi.<>c__DisplayClassa.<OpenWorkbookEx>b__9(ExcelService svc, Status[]& status)   
     at Microsoft.AnalysisServices.SPClient.ExcelApi.Call[T](String fileUrl, ExcelServiceCall`1 serviceCall)     -
    -- End of inner exception stack trace ---     -
    -- End of inner exception stack trace ---   
     at Microsoft.AnalysisServices.SPClient.ExcelApi.Call[T](String fileUrl, ExcelServiceCall`1 serviceCall)   
     at Microsoft.AnalysisServices.SPClient.ExcelApi.Call[T](String fileUrl, ExcelServiceCall`1 serviceCall, String methodName, Object[] parameters)   
     at Microsoft.AnalysisServices.SPClient.ExcelApi.OpenWorkbookEx(String fileUrl, String uiCultureName, String dataCultureName, Boolean exclusive)   
     at Microsoft.AnalysisServices.SPClient.ASSPClientProxy.OpenWorkbookModelForRefresh(String workbookPath, SessionLifetimePolicy lifetimePolicy)   
     at Microsoft.AnalysisServices.SPAddin.UsageProcessingTimerJob.RefreshUsageCube(GeminiServiceApplication application)   
     at Microsoft.AnalysisServices.SPAddin.UsageProcessingTimerJob.Execute(Guid targetInstanceId)
    Thanks
    Ravi

    HI Ravi,
    Did you find the solution?
    Thanks in advance
    Regards,
    Faraz Javaid

  • Problem LiveCycle Data Services with Parsley Framework

    Hi All,
    I have problem when using LiveCycle Data Services and Parsley framework.
    Here is my Dynamic command :
    public function execute(message:ServiceMsg):AsyncToken{
                                       return dataservice.fill(...);
    public function result(event:ResultEvent):void
         Alert.show ("run successful");
         // call another method
         xyz(); // this method take a long time (about 1 minutes)
    The problem here is the alert message not show until xyz() method finished. It's so odd behavior.
    Anybody can explain this problem.
    I'm using parsley 2.4.0
    Thanks,
    ndt

    Hi All,
    I have problem when using LiveCycle Data Services and Parsley framework.
    Here is my Dynamic command :
    public function execute(message:ServiceMsg):AsyncToken{
                                       return dataservice.fill(...);
    public function result(event:ResultEvent):void
         Alert.show ("run successful");
         // call another method
         xyz(); // this method take a long time (about 1 minutes)
    The problem here is the alert message not show until xyz() method finished. It's so odd behavior.
    Anybody can explain this problem.
    I'm using parsley 2.4.0
    Thanks,
    ndt

  • Problem connecting to Data/Service outside web root

    I'm new to Flash Builder (4.5). I work in an environment where developers have full access to a specified folder and subfolders on a Windows box running IIS 7 and ColdFusion 9.
    So the path to the services-config.xml looks like this (server and folder names have been changed, but the structure is the same):
    \\servername\flex$
    Path to coldfusion root looks like this
    \\servername\coldfusion9$
    The developers don't have write access to those areas. What we have is
    \\servername\webteam$\webcontent\app1
    \\servername\webteam$\webcontent\app2
    And so on
    Then our server admin sets up virtual servers so that our urls look like http://app1.ourdomain.co, app2.ourdomain.com, etc. 
    I set up a project specifying ColdFusion as the server technology and using the above paths and everything works 
    I've run set up a couple Hello World tests using <mx:RemoteObject destination="ColdFusion" source="app1.flextest"></mx:RemoteObject> and everything works as expected. (No database connections, just a function that returns a string) 
    The problem is when I try to exploit the magic of Flash Builder and use the Connect to Data Service feature to write my queries for me : ) 
    I select ColdFusion 
    In the CFC location I enter 
    \\servername \webteam$\webcontent\app1\cpa\flextest.cfc 
    Which is the same working cfc I connected to manually in my Hello World test. Flash Builder automatically populates the Service Name, Service Package, and Data Type Packages and I click next. I enter my RDS password and I then get this error: 
    The CFC file is invalid. Possible causes can be found by accessing: http://app1.ourdomain.com//CFIDE/componentutils/cfcexplorer.cfc?method=getCFCMetaData&name =flextest&path=%2Fwebcontent%2Fapp1%2Fflextest.cfc 
    Copying and pasting the url into my browser I get this error: 
    The value returned from the getCFCMetaData function is not of type struct. 
    HOWEVER, if I modify the url and remove "%2Fwebcontent%2Fapp1%" I get a response: 
    E:\webteam\webcontent\app1\flextest.cfcE:\ColdFusion9\wwwroot\WEB-INF\cftags\component.cfc WEB-INF.cftags.componentWEB-INF.cftags.componentcomponentcpa.flextestcpa.flextestcomponent remoteflexteststring 
    So I just need to tell Flash Builder to shorten the path and not add "/webcontent/app1" How? 
    Sorry it took so long to explain. I've been googling for days and can't find anything. I'm sure there must be other users who develop on servers outside the root path of their web server, right? 
    P.S. I tried mapping drives but that didn't help
    Thanks,
    Ron
    "Embrace the senile genius"

    Hi ,
        Check if the database server is up and running.The console will have two root nodes .R they both in green?
    Try connecting and entering into the database externally.
    Generally if the DB instance is not running , this error would occur.
    regards,
    aravindh.

  • Data Service - only returning 256 chars on text field

    Using FlashBuilder Data Services - PHP service all working fine.
    Except the service is only returning the first 256 chars of a "text" field of my db table.
    The field has more than 256 chars and is marked up via the RTE component
    <TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="14" COLOR="#000000" LETTERSPACING="0" etc...
    The generated code looks like(memberservice.php)
    public function getAllMember_content() {
            $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename" );       
    etc....
    Have tried a few conversions on the sql statement to no avail
    select *, convert(text,data) as data from members
    Any ideas on why this is happening - debugged in charles and its cut off in the response from ZEND/PHP so it in not Flex doing it
    this one is killing me :-)
    rgds
    m

    ok solved - kind of
    phew - it's the generated service code it appears - not sure why it's working for some and not others! head scratching
    this works
    public function getAllItems() {
        $this->connect();
        $sql = "SELECT * FROM member_content";
        $result = mysql_query($sql) or die('Query failed: ' . mysql_error());
        return $result;
    this does not
    public function getAllMember_content() {
            $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename" );       
            $this->throwExceptionOnError();
            mysqli_stmt_execute($stmt);
            $this->throwExceptionOnError();
            $rows = array();
            mysqli_stmt_bind_result($stmt, $row->id, $row->title, $row->topic, $row->type, $row->data, $row->shortdesc, $row->date_created, $row->date_lastmod, $row->rank, $row->createdby, $row->content_source);
            while (mysqli_stmt_fetch($stmt)) {
              $rows[] = $row;
              $row = new stdClass();
              mysqli_stmt_bind_result($stmt, $row->id, $row->title, $row->topic, $row->type, $row->data, $row->shortdesc, $row->date_created, $row->date_lastmod, $row->rank, $row->createdby, $row->content_source);
            mysqli_stmt_free_result($stmt);
            mysqli_close($this->connection);
            return $rows;
    thanks all for your help
    many thanks
    martin

Maybe you are looking for