[flexcoders] HTTPService retrieves no data within itemrenderere
I have an Horizontal list that is connected to patients arraycollection. I've created an Canvas Itemrenderer for the horizontal list that lists the patient's medical information. Within the itemrenderer, I am calling out to a PHP HTTPService call to retrieve the visits for each patient. However I am not getting any data returned. If I run the HTTPService in the main application, it works. My main app code below: mx:HorizontalList id=h_compare width=100% height=100% dataProvider={myCompare} labelField=name itemRenderer=comparerenderer columnWidth=500 rowHeight={hbox_compare.height} borderColor=haloBlue scrollTipFunction=horizontalList_scrollTipFunc showScrollTips=true alternatingItemColors=[#FF, #EE] backgroundAlpha=.5 removedEffect={fadeOut}/ Itemrenderer code below (Screenshot also attached). ?xml version=1.0 encoding=utf-8? !-- http://blog.flexexamples.com/2008/03/08/creating-a http://blog.flexexamples.com/2008/03/08/creating-a -simple-image-gallery-with-the-flex-tilelist-contr ol/ -- mx:VBox xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml horizontalAlign=center verticalAlign=middle xmlns:flexiframe=http://code.google.com/p/flex-i http://code.google.com/p/flex-i frame/ width=100% height=100% backgroundColor=#DBD8CC preinitialize=srv_visit_rend.send(); xmlns:creativesource=it.creativesour ce.* m x:Script ![CDATA[ import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; import mx.collections.ArrayCollection; import com.adobe.serialization.json.JSON; import mx.controls.Alert; public function initapp():void { //parentDocument.get_user(data .patient_id.toString()); srv_visit_rend.send(); } [Bindable] var myVisits_rend:ArrayCollection; private function resultHandler_visit_rend(e:ResultEvent):void { // myData.source = ArrayCollection(e.result.data.row).toArray(); var sample:String = data.patient_id; var rawArray:Array; var rawData:String = String(e.result); rawArray = JSON.decode(rawData) as Array; myVisits_rend = new ArrayCollection(rawArray); myVisits_rend.refresh( ); } private function handle(e:Event):void{ parentDocument.alert_parent _remove_panel(data); //Alert.show('Hello from the titleBar Button!!'); } ]] /mx:Script mx:HTTPServic e id=srv_visit_rend url=http://localhost/test_visit.php http://localhost/test_visit.php result=resultHandler_visit_rend(event) showBusyCursor=true mx:request xmlns= patient_id {data.patient_id} /patient_id /mx:request /mx:HTTPService creativesource :CustomPanel width=100% height=100% titleBtnClick={handle(event)} mx:HBox width=100% height=30% mx:Panel width=100% height=100% alpha=1.0 headerHeight=0 backgroundAlpha=0 borderStyle=none mx:VBox width=100% height=100% mx:Label text={data.patient_id} fontAntiAliasType=advanced fontSize=20 fontWeight=bold/ mx:Label text={data.diagnosis} fontAntiAliasType=advanced fontSize=20 fontWeight=bold/ mx:TextInput id=lname width=100% text={data.name}/ mx:TextInput id=city text={data.Eitology}/ mx:TextInput id=zip width=100% text={data.cause_of_injury}/ mx:TextInput width=100% text={data.cortical_injury}/ mx:TextInput width=100% text={data.thalamic_injury}/ /mx:VBox /mx :Panel /mx:HBox mx:HBox width=100% height=70% mx:VBox width=10% height=100% mx:DataGrid width=100% height=100% dataProvider={myVisits_rend} mx:columns mx :DataGridColumn headerText=Visit dataField=visit_start_date width=20 color=#33/ /mx:columns /mx:DataGrid /mx:VBox mx:VBox width=90% height=100% mx:TabNavigator width=100% height=100% mx:Canvas width=100% height=100% label=Summary /mx:Canvas mx:Canvas width=100% height=100% label=Imaging flexiframe:IFrame id=slowLoadingIFrameWithLoadIndicator source=http://ric.uthscsa.edu/mango/MangoUsingLo http://ric.uthscsa.edu/mango/MangoUsingLo ader.html loadIndicatorClass=SampleLoadIndicator width=100% height=100%/ /mx:Canvas mx:Canvas width=100% height=100% label=File Directory mx:DataGrid dataProvider= width=100% height=100% mx:columns mx:DataGridColumn dataField=length headerText=Files/Folders width=100 mx:itemRenderer mx:Component mx :LinkButton label= click= fontWeight=normal/ /mx:Component /mx:itemRe nderer /mx:DataGridColumn /mx:columns /mx: DataGrid /mx:Canvas mx:Canvas width=100% height=100% label=Audit /mx:Canvas /mx:TabNavigator / mx:VBox /mx:HBox /creativesource:CustomPanel /mx:VBox
[flexcoders] httpservice url - not use host
Since the Flex crossdomain policy would normally restrict you to the server that launched Flex, is there any way to avoid specifying the whole http://myserver.mydomain.com prefix in the httpservice.url parameter similar to the action in html forms? I'm trying to make it easier to move my solution from one server to another.
[flexcoders] HTTPService in Proxy with authentication.
Greetings! I use HTTPServices to access our server, but in some clients the internet access is by authenticated proxy. How do I set my HTTPService to access using a specific port and proxy connections to exit? The proxy / firewall uses port 3128. All browsers must be configured to use that port and I need to implement this in flex. Another detail: When trying to access out, still have to inform login and password! -- Wemerson Guimarães Rio Verde - Go - Brasil
[flexcoders] HttpService resultHandler in different Window
I am working on an AIR application with 2 windows: One to create a new customer and another to display some information about the customer. On window 1, there is also a textfield to search for a customer by Id or name. These are the steps to create a new customer: with an add button on window 1, I open window 2. on window 2, the user completes a form to create a new customer. the information is saved in a MySQL Database over an HttpService. The result handler method calls a public function on window 1: result = new wWin1().resultSaveCustomer(event) This part works well - the new customer Id is received. In some cases, according customer data, I change the component color - this operation works well, if I load a customer after a using the search field, but if I search directly from the resultSaveCustomer function (after completion of step 3), a message appears: Cannot access a property or method of a null object reference. I don't understand why, because all the components in window 1, have an Id name! Or the property is a label with Id Name. Thanks for helping me.
Re: [flexcoders] HTTPService post to return an image?
You can use base64 to encode your image on the server side, and then decode in flex to display it. Regards, Rogério Gonzalez On Tue, Nov 1, 2011 at 5:20 PM, claudiu ursica the_bran...@yahoo.comwrote: ** HTTPService cannot handle binary data and images fall under this category. U have top go URLLoader. C -- *From:* method_air loudj...@hotmail.com *To:* flexcoders@yahoogroups.com *Sent:* Tuesday, November 1, 2011 7:03 PM *Subject:* [flexcoders] HTTPService post to return an image? Is it possible to return an image object using HTTPService? The fault method executes when I attempt to do this: var http:HTTPService = new HTTPService(); http.url = myScript.ashx; http.method = POST; http.resultFormat = object; Should URLLoader be used instead? Cheers, Philip
Re: [flexcoders] HTTPService post to return an image?
Hello You cant send raw binaries via a http api two things i suggest you may do 1) convert your binary data to hexadecimal (hex) Xters at the server site and send it across the web as hex data then reconvert your hex data to binaries on the browser. 2) Save the image on a path on the server, obtain the url to the path of the image return the url with httpservice (as a string offcourse) and set as imagepath to your image control. All the best ! Warm RegardsTunde Majolagbe+2348028320370, 018782170. *Exchange a Dollar, we still have ONE each, exchange an idea, we have TWO each.*Calm Down!!! It’s just a mirage, like other worries it will soon fade away. --- On Tue, 1/11/11, method_air loudj...@hotmail.com wrote: From: method_air loudj...@hotmail.com Subject: [flexcoders] HTTPService post to return an image? To: flexcoders@yahoogroups.com Date: Tuesday, 1 November, 2011, 19:03 Is it possible to return an image object using HTTPService? The fault method executes when I attempt to do this: var http:HTTPService = new HTTPService(); http.url = myScript.ashx; http.method = POST; http.resultFormat = object; Should URLLoader be used instead? Cheers, Philip
[flexcoders] HttpService error handling
I'm using Flex 4.1 with a django backend. Django provides a really useful HTML error traceback when it fails. Currently I then have to manually insert the offending url into the browser url to see the error details when debugging. That's a pain. I would like to subclass HttpService to provide a generic automatic solution, but I'm having trouble. My typical pattern is Var parms:Object = new Object() Parms.a=3 Parms.b=4 MyHttpService.url = http://yadda.yadda.yadda/root/function; MyHttpService.send(parms) When the faultHandler is called I would like to do something like this navigateToURL( new URLRequest( Configure.getServer()+'getpdf?id='+parms.id+resid=+parms.resid ) ); but I cannot find a way to get the parms back from the HttpService in order to create the URLRequest string. I've tried the MyHttpService.request object but that appears to be empty. It won't expand in debugger view and a for loop does not iterate through it. Can anyone offer a suggestion? Thanks, Fred.
[flexcoders] HTTPService post to return an image?
Is it possible to return an image object using HTTPService? The fault method executes when I attempt to do this: var http:HTTPService = new HTTPService(); http.url = myScript.ashx; http.method = POST; http.resultFormat = object; Should URLLoader be used instead? Cheers, Philip
Re: [flexcoders] HTTPService post to return an image?
HTTPService cannot handle binary data and images fall under this category. U have top go URLLoader. C From: method_air loudj...@hotmail.com To: flexcoders@yahoogroups.com Sent: Tuesday, November 1, 2011 7:03 PM Subject: [flexcoders] HTTPService post to return an image? Is it possible to return an image object using HTTPService? The fault method executes when I attempt to do this: var http:HTTPService = new HTTPService(); http.url = myScript.ashx; http.method = POST; http.resultFormat = object; Should URLLoader be used instead? Cheers, Philip
[flexcoders] HttpService results inconsistent
If I have multiple records in the response I get an ArrayCollection however if I have only 1 record I get an ObjectProxy. I'm not sure if specifying the resultFormat would resolve this and if so, which format is appropriate. I typically map the results to an ArrayCollection which is the dataProvider for a datagrid. Perhaps I should just map the datagrid .dataProvider to the HttpService.lastResult... Any suggestions or experience with this. My code is below: mx:HTTPService id=QueryService result=QueryService_resultHandler(event) / ... protected function QueryService_resultHandler(event:ResultEvent):void { try { GridDataArray = event.result.resultset.record; }catch (e:*) { GridDataArray = new ArrayCollection(); } mydatagrid.dataProvider = GridDataArray; }__,_ -- results with std xml header removed - resultset record order__therapy=OT name=Landers, Ivee time__id=3 time__label=08:00 id=3 order__resident__payor=3/ /resultset ._,___
Re: [flexcoders] HttpService results inconsistent
http://blogs.adobe.com/aharui/2007/03/arraycollection_arrays_and_ser.html On 8/24/11 6:22 AM, Sells, Fred fred.se...@adventistcare.org wrote: If I have multiple records in the response I get an ArrayCollection however if I have only 1 record I get an ObjectProxy. I’m not sure if specifying the resultFormat would resolve this and if so, which format is appropriate. I typically map the results to an ArrayCollection which is the dataProvider for a datagrid. Perhaps I should just map the datagrid .dataProvider to the HttpService.lastResult… Any suggestions or experience with this. My code is below: mx:HTTPService id=QueryService result=QueryService_resultHandler(event) / … protected function QueryService_resultHandler(event:ResultEvent):void { try { GridDataArray = event.result.resultset.record; }catch (e:*) { GridDataArray = new ArrayCollection(); } myda tagrid.dataProvider = GridDataArray; }__,_ -- results with std xml header removed - resultset record order__therapy=OT name=Landers, Ivee time__id=3 time__label=08:00 id=3 order__resident__payor=3/ /resultset ._,___ -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
Re: [flexcoders] HTTPService DELETE/PUT automatically got changed to GET??
Fwiw... As far as I know that is indeed still the case. The doc (http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/rpc/http/mxml/HTTPService.html) says You use the mx:HTTPService tag to represent an HTTPService object in an MXML file. When you call the HTTPService object's send() method, it makes an HTTP request to the specified URL, and an HTTP response is returned. Optionally, you can pass parameters to the specified URL. When you do not go through the server-based proxy service, you can use only HTTP GET or POST methods. However, when you set the useProxy property to true and you use the server-based proxy service, you can also use the HTTP HEAD, OPTIONS, TRACE, and DELETE methods. In general, unless you can get somewhere some server/proxy control, I have found Flex not very useful to talk to a REST like service. Some people have reported success by using http://code.google.com/p/as3httpclientlib/ iso the Flex provided stuff. Personally I have not tried that. As far as I remember it gets tricky as you cannot typically reuse browser managed http resources (cookies, cache, ...). As it might be of interest to you as well.besides the limited HTTP verb support I have lost numerous hours getting HTTP headers across. That is also a non trivial endeavor. What eventually worked out best in my case is to just bite the bullet , shove a proxy in between, and use GET and POST to communicate tunneled real HTTP requests, that are then transformed and forwarded. That is still not perfect if you care about caching and have a need for custom headers, but at least most of it is working. I have always found it a bit ironic that a platform that started it's life as a toolset to develop Rich Internet Applications has such limited support for the internet standard as old as HTTP. Anyway, hth, Peter On 20 Aug 2011, at 00:43, handitan wrote: Hi all, I just would like to get a confirmation. Right now, I have to use 3rd party REST APIs in our Flex app. A bunch of the REST APIs are using DELETE and PUT method. As the title said, they got changed automatically to GET. And from what I gather from this forum somebody said this in 2008: It's a limitation of the browser plugin API unfortunately. Is this still true in Flash Player 10.3? My app is still Flex 3 app with 3.5 SDK. I appreciate any input. Handi @Alex: Yes..yes..I am still using Flex 3.
[flexcoders] HTTPService DELETE/PUT automatically got changed to GET??
Hi all, I just would like to get a confirmation. Right now, I have to use 3rd party REST APIs in our Flex app. A bunch of the REST APIs are using DELETE and PUT method. As the title said, they got changed automatically to GET. And from what I gather from this forum somebody said this in 2008: It's a limitation of the browser plugin API unfortunately. Is this still true in Flash Player 10.3? My app is still Flex 3 app with 3.5 SDK. I appreciate any input. Handi @Alex: Yes..yes..I am still using Flex 3.
[flexcoders] HTTPService e4x Error #1095: XML parser failure: Unterminated attribute
Dear Flexer, I'd like to load data from my database with an httpservice and result on e4x format. If on php side, I add only 12 row all works well, but if I try to load more than 12 rows this errror appear Error #1095: XML parser failure: Unterminated attribute. Can you help me to solve that? Thanks ** My Php code ** ?php require_once ('MySQL.php'); require_once ('conf.php'); include('functions.php'); // On commence par récupérer les champs //if(isset($_POST['idPatient'])) //$id=$_POST['idPatient']; $link = mysql_connect(DB_HOST,DB_USER, DB_PWD); mysql_select_db(DB_DATABASE, $link); $query = SELECT 20Customer_1012.paIndex, 20Customer_1012.paNomU, 20Customer_1012.paPrenom,20Customer_1012.paDossier1, 20Customer_1012.paDossier2, 20Customer_1012.paNaissance, 20Customer_1012.paSexe, 20Customer_1012.paT_Qualite_P, 20Customer_1012.paNomPar,20Customer_1012.paPrenomPar, 20Customer_1012.T_AdrDefaut_P, 20Customer_1012.paAdress1,20Customer_1012.paAdress2,20Customer_1012.paCodePostal,20Customer_1012.paT_Ville_P,20Customer_1012.paPays,20Customer_1012.pa1T_TypeTel_P,20Customer_1012.paSMS1,20Customer_1012.paNumTel1,20Customer_1012.paRemTel1,20Customer_1012.pa2T_TypeTel_P,20Customer_1012.paSMS2,20Customer_1012.paNumTel2,20Customer_1012.paRemTel2,20Customer_1012.pa3T_TypeTel_P,20Customer_1012.paSMS3,20Customer_1012.paNumTel3,20Customer_1012.paRemTel3,20Customer_1012.paFax,20Customer_1012.paEMail, 20Customer_1012.paProfMere, 20Customer_1012.paProfPatient, 20Customer_1012.paProfParent, 20Customer_1012.paUserZoneA1, 20Customer_1012.paUserZoneA2, 20Customer_1012.paUserZoneA3, 20Customer_1012.paUserZoneA4, 20Customer_1012.paUserZoneA5, 20Customer_1012.paUserZoneA6, 30Traitemnt_201223.ttTStatutP, 30Traitemnt_201223.ttDateStatut, 12Praticien_02.prInitiales, 20Customer_1012.pa2T_Qualite_P FROM 20Customer_1012 JOIN 30Traitemnt_201223 ON 20Customer_1012.paIndex = 30Traitemnt_201223.ttIndex JOIN 12Praticien_02 ON 30Traitemnt_201223.ttPraticien = 12Praticien_02.prIndex WHERE 20Customer_1012.paIndex='16'; $recordset = mysql_query($query, $link); $dom = new DOMDocument('1.0', 'UTF-8'); $rootNode= $dom-appendChild($dom-createElement('OrthoExpertDB')); while($row_recordset = mysql_fetch_array($recordset)) { $record = new DomElement(p, ); $rootNode-appendChild($record); $record-SetAttribute(id, $row_recordset[0]); //index $record-SetAttribute(nU, $row_recordset[1]);//nom U $record-SetAttribute(pr, $row_recordset[2]);//prenom $record-SetAttribute(d1, $row_recordset[3]);//dossier1 $record-SetAttribute(d2, $row_recordset[4]);//dossier2 $record-SetAttribute(dn, datefr($row_recordset[5]));//naissance $record-SetAttribute(sx, $row_recordset[6]); //sexe $record-SetAttribute(paQ, $row_recordset[7]); //qualite patient $record-SetAttribute(nPar, $row_recordset[8]); $record-SetAttribute(pPar, $row_recordset[9]); $record-SetAttribute(adD, $row_recordset[10]); $record-SetAttribute(ad1, $row_recordset[11]); $record-SetAttribute(ad2, $row_recordset[12]); $record-SetAttribute(cp, $row_recordset[13]);//code postal $record-SetAttribute(vi, $row_recordset[14]); $record-SetAttribute(pi, $row_recordset[15]); $record-SetAttribute(tT1, $row_recordset[16]); $record-SetAttribute(sms1, $row_recordset[17]); $record-SetAttribute(nT1, $row_recordset[18]); $record-SetAttribute(rT1, $row_recordset[19]); $record-SetAttribute(tT2, $row_recordset[20]); $record-SetAttribute(sms2, $row_recordset[21]); $record-SetAttribute(nT2, $row_recordset[22]); $record-SetAttribute(rT2, $row_recordset[23]); $record-SetAttribute(tT3, $row_recordset[24]); $record-SetAttribute(sms3, $row_recordset[25]); $record-SetAttribute(nT3, $row_recordset[26]); $record-SetAttribute(rT3, $row_recordset[27]); $record-SetAttribute(fax, $row_recordset[28]); $record-SetAttribute(mail, $row_recordset[29]); $record-SetAttribute(prPa, $row_recordset[30]); $record-SetAttribute(prP, $row_recordset[31]); $record-SetAttribute(prMe, $row_recordset[32]); $record-SetAttribute(zA1, $row_recordset[33]); $record-SetAttribute(zA2, $row_recordset[34]); $record-SetAttribute(zA3, $row_recordset[35]); $record-SetAttribute(zA4, $row_recordset[36]); $record-SetAttribute(zA5, $row_recordset[37]); $record-SetAttribute(zA6, $row_recordset[38]); $record-SetAttribute(st, $row_recordset[39]);//statut $record-SetAttribute(dst, $row_recordset[40]);//date statut $record-SetAttribute(pr2, $row_recordset[41]);//initiale prat $record-SetAttribute(parQ, $row_recordset[42]);//qualité parent } mysql_free_result($recordset); mysql_close(); print $dom-saveXML(); //echo $xmlStr; ? ** End of php
[flexcoders] HTTPService timeout?
Hello, I have very simple code to call a simple PHP page. PHP page will insret 2000 records to mysql table, takes about 2 minutes. On PHP side, it is fine, I tested the php page within browser, it ran for 2 minutes and stoped. (I have configured on PHP to run longer than normal.) One Flex side, I call PHP page using HTTPService with requestTimeout = 300 to avoid timeout. Here is the code: var ws:HTTPService = new HTTPService(); ws.requestTimeout = 300; ws.useProxy = false; ws.url = http://localhost:85/test.php http://localhost:85/test.php ; ws.addEventListener(FaultEvent.FAULT, fault ); ws.addEventListener(ResultEvent.RESULT, result); ws.send(); However, after 30 seconds, it return fault event. I really don't understand. Can anyone let me know how I do this correctly? Thank you! George
Re: [flexcoders] HTTPService timeout?
Have you check the network monitor in flash builder 4? Sent from my iPhone On Aug 2, 2011, at 5:16 PM, georgemeng2011 georgemeng2...@gmail.com wrote: Hello, I have very simple code to call a simple PHP page. PHP page will insret 2000 records to mysql table, takes about 2 minutes. On PHP side, it is fine, I tested the php page within browser, it ran for 2 minutes and stoped. (I have configured on PHP to run longer than normal.) One Flex side, I call PHP page using HTTPService with requestTimeout = 300 to avoid timeout. Here is the code: var ws:HTTPService = new HTTPService(); ws.requestTimeout = 300; ws.useProxy = false; ws.url = http://localhost:85/test.php;; ws.addEventListener(FaultEvent.FAULT, fault ); ws.addEventListener(ResultEvent.RESULT, result); ws.send(); However, after 30 seconds, it return fault event. I really don't understand. Can anyone let me know how I do this correctly? Thank you! George
[flexcoders] HTTPService not updating...
Ok. I have the following HTTP Service declared: mx:HTTPService id=reportDataRPC url=reports/xml/{_reportInfo.fileName}.xml result=rdHandler(event); fault=rpcFaultHandler(event);/ In the init() function (which is called when the 'show' event happens, because the page it's on happens to be part of a ViewStack) I have the following line: reportDataRPC.send(); This loads the data from the .xml file and in the rdHandler function lets me put that data into my various ArrayCollections and whatnot... That's working fine... At least, the FIRST time... Every subsequent time, the result-set is exactly the same as the first time -- even if the .xml file it's reading has changed in the interim. If I completely shut-down the program and re-load it, then I finally get the new .xml file in there. So, how do I get it to give me a complete refresh of the data? I've tried calling 'reportDataRPC.clearResult()' and 'reportDataRPC.disconnect()' after storing the data in my ArrayCollections, but that didn't seem to do anything at all... I'm at a complete loss -- it's totally unacceptable to not be able to get the new data when the underlying .xml file changes. Can someone point me in the right direction? Thanks, Laurence MacNeill Mableton, Georgia, USA
Re: [flexcoders] HTTPService not updating...
It might be getting cached. nbsp;Try adding a timestamp to the end of the url (ie url/myfile.xml?timestamp={currentTimeStamp} ). Before you all the .send() method, reset the timestamp variable to the current time. nbsp; -Jake -- Sent from my Palm Pre On Aug 17, 2010 6:23 PM, Laurence lt;lmacne...@comcast.netgt; wrote: nbsp; Ok. I have the following HTTP Service declared: lt;mx:HTTPService id=reportDataRPC url=reports/xml/{_reportInfo.fileName}.xml result=rdHandler(event); fault=rpcFaultHandler(event);/gt; In the init() function (which is called when the 'show' event happens, because the page it's on happens to be part of a ViewStack) I have the following line: reportDataRPC.send(); This loads the data from the .xml file and in the rdHandler function lets me put that data into my various ArrayCollections and whatnot... That's working fine... At least, the FIRST time... Every subsequent time, the result-set is exactly the same as the first time -- even if the .xml file it's reading has changed in the interim. If I completely shut-down the program and re-load it, then I finally get the new .xml file in there. So, how do I get it to give me a complete refresh of the data? I've tried calling 'reportDataRPC.clearResult()' and 'reportDataRPC.disconnect()' after storing the data in my ArrayCollections, but that didn't seem to do anything at all... I'm at a complete loss -- it's totally unacceptable to not be able to get the new data when the underlying .xml file changes. Can someone point me in the right direction? Thanks, Laurence MacNeill Mableton, Georgia, USA
Re: [flexcoders] HTTPService not updating...
it's prob accessing it from the cache. instead of this, url=reports/xml/{_reportInfo.fileName}.xml use this: url=reports/xml/{_reportInfo.fileName}.xml?time={getTimer()} that snippet might not be bindable so add the time in code whenever you access that file On Tue, Aug 17, 2010 at 6:17 PM, Laurence lmacne...@comcast.net wrote: Ok. I have the following HTTP Service declared: mx:HTTPService id=reportDataRPC url=reports/xml/{_reportInfo.fileName}.xml result=rdHandler(event); fault=rpcFaultHandler(event);/ In the init() function (which is called when the 'show' event happens, because the page it's on happens to be part of a ViewStack) I have the following line: reportDataRPC.send(); This loads the data from the .xml file and in the rdHandler function lets me put that data into my various ArrayCollections and whatnot... That's working fine... At least, the FIRST time... Every subsequent time, the result-set is exactly the same as the first time -- even if the .xml file it's reading has changed in the interim. If I completely shut-down the program and re-load it, then I finally get the new .xml file in there. So, how do I get it to give me a complete refresh of the data? I've tried calling 'reportDataRPC.clearResult()' and 'reportDataRPC.disconnect()' after storing the data in my ArrayCollections, but that didn't seem to do anything at all... I'm at a complete loss -- it's totally unacceptable to not be able to get the new data when the underlying .xml file changes. Can someone point me in the right direction? Thanks, Laurence MacNeill Mableton, Georgia, USA
[flexcoders] HTTPService
I am having difficult in sending an XML request from flex application. The request sent in the server log replace all , , and with lt;, gt; and amp; , respectively, in an XML before passing it as parameter to a HTTPservice call Here is sample code mx:HTTPService id=CCAPI_discover_Search result=handleXML(event) fault=handleFault(event) resultFormat=e4x url=http://ccqasvr2001:8080/CCRestAPI_1_0/cc/getInstitution/v1; method=POST contentType=application/xml mx:request obj{input.text}/obj /mx:request /mx:HTTPService Can anybody help me? I am new to flex. I just need this call to work that is all.
[flexcoders] httpService useProxy
I have an app which accesses quite a few php urls returning XML that sit in the same directory and domain as the main app. I use a common prefix to the file paths yet for some reason I have flex moaning to me about setting useProxy to false yet it seems to be false already - much time with the debugger and explicit setting makes me think that is certainly the case. Is it some form of voodo? - never really had this kind of problem when using URLLoader and the like. This is Flex 3.0 (with FB 3.0) and I have not moved forward to later versions of the SDK. Paul
Re: [flexcoders] httpService useProxy
On 01/05/2010 09:16, Paul Andrews wrote: I have an app which accesses quite a few php urls returning XML that sit in the same directory and domain as the main app. I use a common prefix to the file paths yet for some reason I have flex moaning to me about setting useProxy to false yet it seems to be false already - much time with the debugger and explicit setting makes me think that is certainly the case. Is it some form of voodo? - never really had this kind of problem when using URLLoader and the like. This is Flex 3.0 (with FB 3.0) and I have not moved forward to later versions of the SDK. Paul OK, the vodoo was mine, after all..
[flexcoders] HTTPService not returning ArrayCollection...
I'm trying to read data from an XML file, and put that data into an ArrayCollection. This works great when I have more than one object in the XML file. But when there's only one object in there, my HTTPService RPC returns it as an Object instead of an ArrayCollection of Objects. So when I assign the event.result to my ArrayCollection I get a Cannot Convert to ArrayCollection error message... Let me give an example: MyXMLFile.xml: people person firstNameJoe/firstName lastNameSmith/lastName /person /people If I have more than one person/person pair in my XML file, then they get returned as an ArrayCollection in event.result.people.person. But with only one person/person pair in my XML file, event.result.people.person is an ObjectProxy -- which can't be converted to an ArrayCollection, apparently. If event.result.people had a length property, I could just loop over it for {length} number of times and addItem() each person to my ArrayCollection -- but I see no length property on the event.result... So how do I get this to work? I won't know in advance how many person/person pairs are in the XML file, so I can't make any assumptions about the length... Could be 1, could be 100... Is there a way to programmatically tell whether or not event.result.people.person is an ArrayCollection or an ObjectProxy? If I could tell what it was, then I could use that information to let the program decide how to deal with it... Thanks for any suggestions... Laurence MacNeill Mableton, Georgia, USA
Re: [flexcoders] HTTPService return times Air vs Flash (Solved - Kinda)
Lee Jenkins wrote: Web based flex applications seem to take magnitudes longer to return a result than do Air based application. I've tried with HTTPService and URLLoader components and it is the same. I've created one small air application and one small web based flex app identical. Air app is almost instantaneous while the web page based app (Firefox) takes noticeably longer. My guess is that browser mechanics (security, etc) is the culprit. It always turns out to be the small things. Turns out that using localhost in the url of HTTPService (or URLLoader) was the problem with Firefox. Replacing localhost with my development computer's ip address removes the delay. Judging from the status bar messages of Firefox when making a call using localhost, Firefox is resolving localhost on every request, resulting in a average (subjective) delay of 250 to 500ms before the request hits the server (which I wrote and can debug/break point). Changing the URL fed to HTTPService to using the IP address resolves the problem. -- Warm Regards, Lee
[flexcoders] HTTPService return times Air vs Flash
Web based flex applications seem to take magnitudes longer to return a result than do Air based application. I've tried with HTTPService and URLLoader components and it is the same. I've created one small air application and one small web based flex app identical. Air app is almost instantaneous while the web page based app (Firefox) takes noticeably longer. My guess is that browser mechanics (security, etc) is the culprit. Any suggestions or comments? Thanks, -- Warm Regards, Lee
Re: [flexcoders] HTTPService return times Air vs Flash
Lee Jenkins wrote: Web based flex applications seem to take magnitudes longer to return a result than do Air based application. I've tried with HTTPService and URLLoader components and it is the same. I've created one small air application and one small web based flex app identical. Air app is almost instantaneous while the web page based app (Firefox) takes noticeably longer. My guess is that browser mechanics (security, etc) is the culprit. Any suggestions or comments? I take this back. My mistake and should have checked it before posting, but the truth is that Air applications run from the IDE are magnitudes faster that web page based flex app run from the IDE. When testing response times with the COMPILED web based flex app OUTSIDE of the IDE, the difference was noticeable, but negligent. -- Warm Regards, Lee
Re: [flexcoders] HTTPService return times Air vs Flash
Lee Jenkins wrote: Lee Jenkins wrote: Web based flex applications seem to take magnitudes longer to return a result than do Air based application. I've tried with HTTPService and URLLoader components and it is the same. I've created one small air application and one small web based flex app identical. Air app is almost instantaneous while the web page based app (Firefox) takes noticeably longer. My guess is that browser mechanics (security, etc) is the culprit. Any suggestions or comments? I take this back. My mistake and should have checked it before posting, but the truth is that Air applications run from the IDE are magnitudes faster that web page based flex app run from the IDE. When testing response times with the COMPILED web based flex app OUTSIDE of the IDE, the difference was noticeable, but negligent. OK, I'll get my head screwed on right today sometime. It appears that its Firefox (3.5.7) that causes the delay. Two test applications with exactly the same code. One is deployed to AIR and the other to a basic webpage, letting FlexBuilder create the html page, etc. SWF running directly in flash player: - Little to no difference, fast AIR app (either in debug mode or not): - Little to no difference, fast SWF running in Internet Explorer 8.0: - Little to no difference, fast FireFox 3.5.7 - Noticeably slower. Everything including server is running local on my computer (3 Gigs of RAM, Vista 32bit) and just to be sure, I disabled all add-ins and plug-ins for Firefox and the result is consistently the same. Using either a URLLoader or HTTPService to pull down xml, Firefox takes a while longer to send the request to the server, once the URLLoader or HTTPService sends methods have been called, than the other methods mentioned above. The server application is my own Delphi/FreePascal based server so I could set a break point on the socket creation line to see exactly when the server received the request from the flex application. With Firefox (as opposed to Air application, Internet Explorer or running the naked swf file in Flash Player) the time it takes for the server to get the request is significantly longer (1.5 secs on average subjective speed) thus providing an overall and significantly longer delay to process the request from click to response. -- Warm Regards, Lee
Re: [flexcoders] HTTPService return times Air vs Flash
On 2/11/10, Lee Jenkins wrote: Everything including server is running local on my computer (3 Gigs of RAM, Vista 32bit) and just to be sure, I disabled all add-ins and plug-ins for Firefox and the result is consistently the same. Using either a URLLoader or HTTPService to pull down xml, Firefox takes a while longer to send the request to the server, once the URLLoader or HTTPService sends methods have been called, than the other methods mentioned above. Did you disable the feature where Firefox checks an online list of reported attack / forgery sites before connecting to a site? Jochem -- Jochem van Dieten http://jochem.vandieten.net/
Re: [flexcoders] HTTPService return times Air vs Flash
I've been told that Firefox limits the amount of processor power that the flash player plugin is allowed to use. That may be your problem. Perhaps it also limits network usage/bandwidth. I can't confirm this is true but your results seem to point that direction. FYI, FF 3.6 was recently released. Maybe try that to see if they have done anything under the hood to help flash performance. -Jake On Thu, Feb 11, 2010 at 11:08 AM, Lee Jenkins l...@datatrakpos.com wrote: Lee Jenkins wrote: Lee Jenkins wrote: Web based flex applications seem to take magnitudes longer to return a result than do Air based application. I've tried with HTTPService and URLLoader components and it is the same. I've created one small air application and one small web based flex app identical. Air app is almost instantaneous while the web page based app (Firefox) takes noticeably longer. My guess is that browser mechanics (security, etc) is the culprit. Any suggestions or comments? I take this back. My mistake and should have checked it before posting, but the truth is that Air applications run from the IDE are magnitudes faster that web page based flex app run from the IDE. When testing response times with the COMPILED web based flex app OUTSIDE of the IDE, the difference was noticeable, but negligent. OK, I'll get my head screwed on right today sometime. It appears that its Firefox (3.5.7) that causes the delay. Two test applications with exactly the same code. One is deployed to AIR and the other to a basic webpage, letting FlexBuilder create the html page, etc. SWF running directly in flash player: - Little to no difference, fast AIR app (either in debug mode or not): - Little to no difference, fast SWF running in Internet Explorer 8.0: - Little to no difference, fast FireFox 3.5.7 - Noticeably slower. Everything including server is running local on my computer (3 Gigs of RAM, Vista 32bit) and just to be sure, I disabled all add-ins and plug-ins for Firefox and the result is consistently the same. Using either a URLLoader or HTTPService to pull down xml, Firefox takes a while longer to send the request to the server, once the URLLoader or HTTPService sends methods have been called, than the other methods mentioned above. The server application is my own Delphi/FreePascal based server so I could set a break point on the socket creation line to see exactly when the server received the request from the flex application. With Firefox (as opposed to Air application, Internet Explorer or running the naked swf file in Flash Player) the time it takes for the server to get the request is significantly longer (1.5 secs on average subjective speed) thus providing an overall and significantly longer delay to process the request from click to response. -- Warm Regards, Lee
Re: [flexcoders] HTTPService return times Air vs Flash
Jochem van Dieten wrote: On 2/11/10, Lee Jenkins wrote: Everything including server is running local on my computer (3 Gigs of RAM, Vista 32bit) and just to be sure, I disabled all add-ins and plug-ins for Firefox and the result is consistently the same. Using either a URLLoader or HTTPService to pull down xml, Firefox takes a while longer to send the request to the server, once the URLLoader or HTTPService sends methods have been called, than the other methods mentioned above. Did you disable the feature where Firefox checks an online list of reported attack / forgery sites before connecting to a site? Jochem Hi, Yes. Tools Options Security Unchecked: Block Reported Attach Sites Block Reported Web Forgories (and restarted FF) -- Warm Regards, Lee
Re: [flexcoders] HTTPService token: a bug or by design?
To answer my own dumb question. var token: AsyncToken; token = send(); var myResponder : AsyncResponder= new AsyncResponder(onResult, onFault, token); token.addResponder(myResponder); function onResult(e:ResultEvent , token:Object=null):void {} On 2/8/2010 6:05 PM, Tim Romano wrote: I've run into one bug in the mx.rpc.http.HTTPService class in FB4 beta 2 -- the AsyncResponder's onResult function fires *twice* unless you wire up a dummy eventhandler. And so I am wondering if the following is not also a bug: var myResponder : AsyncResponder= new AsyncResponder(onResult, onFault); var token: AsyncToken; token = send(); token.addResponder(myResponder); function onResult(e:ResultEvent , token:Object=null):void {} The token parameter is always null in the onResult function. Isn't that parameter supposed to contain the token to which the Responder was added? Thanks Tim Romano
[flexcoders] HTTPService token: a bug or by design?
I've run into one bug in the mx.rpc.http.HTTPService class in FB4 beta 2 -- the AsyncResponder's onResult function fires *twice* unless you wire up a dummy eventhandler. And so I am wondering if the following is not also a bug: var myResponder : AsyncResponder= new AsyncResponder(onResult, onFault); var token: AsyncToken; token = send(); token.addResponder(myResponder); function onResult(e:ResultEvent , token:Object=null):void {} The token parameter is always null in the onResult function. Isn't that parameter supposed to contain the token to which the Responder was added? Thanks Tim Romano
Re: [flexcoders] HTTPService Responder ResultEvent -- how to know when the JSON data sent via HTTP are complete?
Tracy, Yes. Thanks for the info. Tim On 1/13/2010 12:51 AM, Tracy Spratt wrote: You are using Firefox, I bet. I have sent this behavior and I think it is just a bug in FF. Tracy Spratt, Lariat Services, development services available The status bar says Transferring data from localhost... and that status message never goes away. sn ip
[flexcoders] HTTPService Responder ResultEvent -- how to know when the JSON data sent via HTTP are complete?
I started learning FlashBuilder/Flex by diving in and writing an AIR application against SQLite with asynchronous connections and Responder objects. The responder's resultsHandler is passed a flash.data.SQLResult object that exposes a complete status property. Lovely. Now I am trying to rewrite that AIR application as a browser-deployed Flex app using an HTTPService against a RESTful webservice that returns JSON data. The webservice is working, and the Flex HTTPService is pulling the JSON string down, but there doesn't seem to be anything analogous to the complete property that was available with the asynch data connection in the AIR app. Not so lovely. The result-handler specified in the HTTPService responder has two parameters, the ResultEvent and the AsyncToken. The ResultEvent exposes a statusCode property. The result-handler can be called more than once. The ResultEvent.statusCode = 200 each time the handler is called. How do you know when the remote data are complete? I will keep googling as I'm sure this question must be commonplace, but so far I haven't found the answer. Thanks for the help.
RE: [flexcoders] HTTPService Responder ResultEvent -- how to know when the JSON data sent via HTTP are complete?
Tim, Maybe I'm missing something here, but to my understanding when the result event of your HTTP service fires, your call IS complete. You should have access to the json string that was pulled back from the service. Is there something else you need that the json string doesn't' supply? Jeff From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Tim Romano Sent: Tuesday, January 12, 2010 2:53 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] HTTPService Responder ResultEvent -- how to know when the JSON data sent via HTTP are complete? I started learning FlashBuilder/Flex by diving in and writing an AIR application against SQLite with asynchronous connections and Responder objects. The responder's resultsHandler is passed a flash.data.SQLResult object that exposes a complete status property. Lovely. Now I am trying to rewrite that AIR application as a browser-deployed Flex app using an HTTPService against a RESTful webservice that returns JSON data. The webservice is working, and the Flex HTTPService is pulling the JSON string down, but there doesn't seem to be anything analogous to the complete property that was available with the asynch data connection in the AIR app. Not so lovely. The result-handler specified in the HTTPService responder has two parameters, the ResultEvent and the AsyncToken. The ResultEvent exposes a statusCode property. The result-handler can be called more than once. The ResultEvent.statusCode = 200 each time the handler is called. How do you know when the remote data are complete? I will keep googling as I'm sure this question must be commonplace, but so far I haven't found the answer. Thanks for the help.
Re: [flexcoders] HTTPService Responder ResultEvent -- how to know when the JSON data sent via HTTP are complete?
Jeff, Thanks for the reply. I am confused by the behavior of my Flex app. The status bar says Transferring data from localhost... and that status message never goes away. But, as you suggested, the data are complete: I pop the raw JSON string returned by the webservice into a TextArea, and it's all there, a string literal representing an array of objects:[{...},{...},{...}], and the string literal decodes into a well-formed ActionScript array. Is there something my results-handler has to do to clear that status message? Tim Maybe I’m missing something here, but to my understanding when the result event of your HTTP service fires, your call IS complete. You should have access to the json string that was pulled back from the service. Is there something else you need that the json string doesn’t’ supply?
RE: [SPAM] Re: [flexcoders] HTTPService Responder ResultEvent -- how to know when the JSON data sent via HTTP are complete?
You are using Firefox, I bet. I have sent this behavior and I think it is just a bug in FF. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Tim Romano Sent: Tuesday, January 12, 2010 4:31 PM To: flexcoders@yahoogroups.com Subject: [SPAM] Re: [flexcoders] HTTPService Responder ResultEvent -- how to know when the JSON data sent via HTTP are complete? Jeff, Thanks for the reply. I am confused by the behavior of my Flex app. The status bar says Transferring data from localhost... and that status message never goes away. But, as you suggested, the data are complete: I pop the raw JSON string returned by the webservice into a TextArea, and it's all there, a string literal representing an array of objects: [{...},{...},{...}], and the string literal decodes into a well-formed ActionScript array. Is there something my results-handler has to do to clear that status message? Tim Maybe I'm missing something here, but to my understanding when the result event of your HTTP service fires, your call IS complete. You should have access to the json string that was pulled back from the service. Is there something else you need that the json string doesn't' supply?
[flexcoders] HTTPService Internet Explorer
I set up a popup TitleWindow which sets up a HTTPService and do a FindAll, I listen for the data coming in and then populate my datagrid. I then make some changes and post them off to the service and then close the popup. When I open the popup again and the data is re-read in Firefox it is read correctly as I have changed it but when its run under Internet Explorer it has not detected the changes. Checking the database the data has changed. Why would I.E. not read the changes made but Firefox does? - Stephen
RE: [SPAM] [flexcoders] HTTPService Internet Explorer
This is almost certainly a caching issue. If you are using GET as the HTTPService method try POST. Then if that does not work, you can append some random string to the url to prevent client side caching. There will be many code examples if you search for them. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of criptopus Sent: Saturday, January 09, 2010 10:55 AM To: flexcoders@yahoogroups.com Subject: [SPAM] [flexcoders] HTTPService Internet Explorer I set up a popup TitleWindow which sets up a HTTPService and do a FindAll, I listen for the data coming in and then populate my datagrid. I then make some changes and post them off to the service and then close the popup. When I open the popup again and the data is re-read in Firefox it is read correctly as I have changed it but when its run under Internet Explorer it has not detected the changes. Checking the database the data has changed. Why would I.E. not read the changes made but Firefox does? - Stephen
Re: [SPAM] [flexcoders] HTTPService Internet Explorer
Yup managed to sort it out. Stuck the time into the URL string to make it unique var dNoCache:Date = new Date(); params.nocache = dNoCache.getTime().toString(); :) - Stephen
Re: [flexcoders] httpservice listener
Not quite sure what's actually going on here. But you can try to remove listener in the corresponding result handler other than do it in another handler. - Original Message - From: advancedonsite To: flexcoders@yahoogroups.com Sent: Sunday, August 23, 2009 10:02 AM Subject: [flexcoders] httpservice listener When using mxml httpservice mx:HTTPService id=hsNutrition url=/main.php/flexnutrition/nutritioncal fault=nutritionFaultHandler(event) resultFormat=e4x/ I call the init on app load private function init():void { hsNutrition.addEventListener(ResultEvent.RESULT, nutritionResultHandler); hsNutrition.send(); } private function nutritionResultHandler(event:ResultEvent):void { nutritionData = event.result as XML; Alert.show(NUTRITION RESULT); } I then later resuse the httpservice another area but this code does not seem to remove the nutritionResultHandler from the result, it actually calls both result events on one http send? Any ideas what might be happening? hsNutrition.removeEventListener(ResultEvent.RESULT, nutritionResultHandler); hsNutrition.request.byo = b; hsNutrition.addEventListener(ResultEvent.RESULT, createYourOwnMeal_result); hsNutrition.send(); }
[flexcoders] httpservice listener
When using mxml httpservice mx:HTTPService id=hsNutrition url=/main.php/flexnutrition/nutritioncal fault=nutritionFaultHandler(event) resultFormat=e4x/ I call the init on app load private function init():void { hsNutrition.addEventListener(ResultEvent.RESULT, nutritionResultHandler); hsNutrition.send(); } private function nutritionResultHandler(event:ResultEvent):void { nutritionData = event.result as XML; Alert.show(NUTRITION RESULT); } I then later resuse the httpservice another area but this code does not seem to remove the nutritionResultHandler from the result, it actually calls both result events on one http send? Any ideas what might be happening? hsNutrition.removeEventListener(ResultEvent.RESULT, nutritionResultHandler); hsNutrition.request.byo = b; hsNutrition.addEventListener(ResultEvent.RESULT, createYourOwnMeal_result); hsNutrition.send(); }
[flexcoders] httpservice what does this error mean?
Hi I am reading a RSS feed and handling the result with the following function: public function toolResultHandler(event:ResultEvent):void { var f_Array:ArrayCollection = new ArrayCollection; f_Array = event.result.RDF.item as ArrayCollection; if (f_Array!=null) toolDataGrid.dataProvider = f_Array; } But the problem is sometime I get the following error. I do not get it all the time but once in a while. Here is the error message - TypeError: Error #1010: A term is undefined and has no properties. at sole1/toolResultHandler()[C:\Users\admin\Documents\Flex Builder 3\siliconsole1\src\com\sisi\Sole\helperFunctions\userPanelHelper\toolHelper.as:10] at sole1/__userToolHTTP_result()[C:\Users\admin\Documents\Flex Builder 3\sole1\src\sole1.mxml:75] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.rpc.http.mxml::HTTPService/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\http\mxml\HTTPService.as:290] at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:193] at mx.rpc::Responder/result()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:43] at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:74] at DirectHTTPMessageResponder/completeHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:403] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete() Why am I getting this error?
[flexcoders] httpservice to arraycollection?
Ok, its late and I am falling asleep. Can someone be another pair of eyes for me? If httpservice call with IResponder how can I turn my result object which is this: mylist entry type=building name=house conn_name= conn_type= /\ entry type=building name=car conn_name= conn_type= / entry type=building name=garage conn_name= conn_type= / /mylist to an array or arraycollection? TIA
[flexcoders] HTTPService HTTPChannel 2032 Channel.Ping.Failed trying to do asimple form post
I must be missing something since I'm trying to do something fairly basic. It really can't be this difficult, can it? I'm trying to use the HTTPService to post to a form. No web services. And I even put a crossdomain.xml policy file on the server for good measure. First I got the dreaded 2032 Stream error, and after some digging saw that the FaultEvent was complaining that no channels were set. So I added a ChannelSet, now I'm getting a ping failure? Here is a sample of my service: mx:HTTPService id=connectPG result=resulthandler(event) fault=fault_handler(event) resultFormat=text showBusyCursor=true url=urlInput.text useProxy=true method=POST mx:channelSet mx:ChannelSet id=pGChannelSet mx:HTTPChannel id=pGChannel pollingEnabled=false mx:url {urlInput.text} /mx:url /mx:HTTPChannel /mx:ChannelSet /mx:channelSet mx:request xmlns= username{userName.text}/username password{userPW.text}/password /mx:request /mx:HTTPService And when I call the send() method, the fault_handler() reports : [FaultEvent fault=[RPC Fault faultString=Send failed faultCode=Client.Error.MessageSend faultDetail=Channel.Ping.Failed error url: 'http://www.my_test_domain.com/beta/db_access.html''] messageId=5BF9E4BD-0CED-145E-B224-8A20D0E36345 type=fault bubbles=false cancelable=true eventPhase=2] Channel.Ping.Failed error url: 'http://www.my_test_domain.com/beta/db_access.html''
RE: [flexcoders] HTTPService HTTPChannel 2032 Channel.Ping.Failed trying to do asimple form post
If you've setup a crossdomain.xml file correctly then there's no need to set useProxy=true for your scenario (you could just leave it as the default, which is false). The HTTPService url property does not appear to be marked with [Bindable] metadata. You can programmatically change its in ActionScript: connectPG.url = urlInput.text; Note: The 'proxy' in useProxy refers to a BlazeDS ProxyService - if you were to use BlazeDS then you'd either need to setup your own ChannelSet programmatically and assign it to your HTTPService instance, or point the compiler to the BlazeDS web application's /WEB-INF/flex/services-config.xml file using the -services option. -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of ciminop Sent: Thursday, May 28, 2009 10:14 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] HTTPService HTTPChannel 2032 Channel.Ping.Failed trying to do asimple form post I must be missing something since I'm trying to do something fairly basic. It really can't be this difficult, can it? I'm trying to use the HTTPService to post to a form. No web services. And I even put a crossdomain.xml policy file on the server for good measure. First I got the dreaded 2032 Stream error, and after some digging saw that the FaultEvent was complaining that no channels were set. So I added a ChannelSet, now I'm getting a ping failure? Here is a sample of my service: mx:HTTPService id=connectPG result=resulthandler(event) fault=fault_handler(event) resultFormat=text showBusyCursor=true url=urlInput.text useProxy=true method=POST mx:channelSet mx:ChannelSet id=pGChannelSet mx:HTTPChannel id=pGChannel pollingEnabled=false mx:url {urlInput.text} /mx:url /mx:HTTPChannel /mx:ChannelSet /mx:channelSet mx:request xmlns= username{userName.text}/username password{userPW.text}/password /mx:request /mx:HTTPService And when I call the send() method, the fault_handler() reports : [FaultEvent fault=[RPC Fault faultString=Send failed faultCode=Client.Error.MessageSend faultDetail=Channel.Ping.Failed error url: 'http://www.my_test_domain.com/beta/db_access.html''] messageId=5BF9E4BD-0CED-145E-B224-8A20D0E36345 type=fault bubbles=false cancelable=true eventPhase=2] Channel.Ping.Failed error url: 'http://www.my_test_domain.com/beta/db_access.html'' -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
Re: [flexcoders] httpservice error #2032
If you are using a windoze machine you can see the request being handled in the command window..i don't think the url is correct On Mon, May 25, 2009 at 9:35 PM, flexaustin flexaus...@yahoo.com wrote: I cannot seem to get my SWF to talk to my rails app. i am getting the following error code: Fault: increment node clicked stat fault[FaultEvent fault=[RPC Fault faultString=HTTP request error faultCode=Server.Error.Request faultDetail=Error: [IOErrorEvent type=ioError bubbles=false cancelable=false eventPhase=2 text=Error #2032: Stream Error. URL: http://localhost:3000/ditto/myfunction;]. URL: http://localhost:3000/ditto/myfunction;] messageId=87ECB54A-4BDB-CF5B-41F0-7B2DEF12A2F7 type=fault bubbles=false cancelable=true eventPhase=2] Here is my crossdomain.xml file (not sure I need one as my swf is in the app running on localhost:3000). ?xml version=1.0? !DOCTYPE cross-domain-policy SYSTEM http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd; cross-domain-policy allow-access-from domain=* / /cross-domain-policy Here is my httservice: _httpservice = new HTTPService(); _httpservice.url = /ditto/myfunction; _httpservice.method = POST; _httpservice.useProxy = false; _httpservice.addEventListener( ResultEvent.RESULT, itemClickedStatsResult ); _httpservice.addEventListener( FaultEvent.FAULT, itemClickedStatsFault ); Always comes back as a FAULT? Anyone have any advice? TIA
Re: [flexcoders] httpservice error #2032
On 26 May 2009, at 05:35, flexaustin wrote: _httpservice.url = /ditto/myfunction; Shouldn't that be _httpservice.url = ditto/myfunction; Cheers Dave Cragg
[flexcoders] httpservice error #2032
I cannot seem to get my SWF to talk to my rails app. i am getting the following error code: Fault: increment node clicked stat fault[FaultEvent fault=[RPC Fault faultString=HTTP request error faultCode=Server.Error.Request faultDetail=Error: [IOErrorEvent type=ioError bubbles=false cancelable=false eventPhase=2 text=Error #2032: Stream Error. URL: http://localhost:3000/ditto/myfunction;]. URL: http://localhost:3000/ditto/myfunction;] messageId=87ECB54A-4BDB-CF5B-41F0-7B2DEF12A2F7 type=fault bubbles=false cancelable=true eventPhase=2] Here is my crossdomain.xml file (not sure I need one as my swf is in the app running on localhost:3000). ?xml version=1.0? !DOCTYPE cross-domain-policy SYSTEM http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd; cross-domain-policy allow-access-from domain=* / /cross-domain-policy Here is my httservice: _httpservice = new HTTPService(); _httpservice.url = /ditto/myfunction; _httpservice.method = POST; _httpservice.useProxy = false; _httpservice.addEventListener( ResultEvent.RESULT, itemClickedStatsResult ); _httpservice.addEventListener( FaultEvent.FAULT, itemClickedStatsFault ); Always comes back as a FAULT? Anyone have any advice? TIA
[flexcoders] HTTPService not behaving properly?
I don't get it. I've got an ArrayCollection being populated by an HTTPService call, and it only works like half the time. If I add a couple of break points to the program, and Debug it, then it works 100% of the time -- it's acting like there's just not enough time to load the thing into memory sometimes. I also get a 100% success rate if I set the ArrayCollection to be the data source for a List Control (like a DataGrid or something). But I don't want to do that -- I want this thing to be loaded in memory without me having to set it as a data source for something else. So is there a way to force my program to stop and wait for this thing to load? Laurence MacNeill Mableton, Georgia, USA
[flexcoders] HTTPService not behaving properly?
I don't get it. I've got an ArrayCollection being populated by an HTTPService call, and it only works like half the time. If I add a couple of break points to the program, and Debug it, then it works 100% of the time -- it's acting like there's just not enough time to load the thing into memory sometimes. I also get a 100% success rate if I set the ArrayCollection to be the data source for a List Control (like a DataGrid or something). But I don't want to do that -- I want this thing to be loaded in memory without me having to set it as a data source for something else. So is there a way to force my program to stop and wait for this thing to load? (Sorry if this winds up being a double-post. I sent it 15 minutes ago and it still hasn't appeared on the list, so I'm sending it again.) -- Laurence MacNeill Mableton, Georgia, USA
[flexcoders] HTTPService mistery
Is it possible that on low end computers HTTPService.send command would take up to 10 or more times longer than on a more or less decent computer? Is there a way of tracking HTTPService.send command? Thanks
RE: [flexcoders] HTTPService mistery
I would not expect the quality of the client to significantly affect the speed of the data service call. However, a slow computer *will* have issues with rendering the content. Have you determined definitively that the speed issue is with the data service call and not the rendering? Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of markgoldin_2000 Sent: Wednesday, April 22, 2009 7:06 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] HTTPService mistery Is it possible that on low end computers HTTPService.send command would take up to 10 or more times longer than on a more or less decent computer? Is there a way of tracking HTTPService.send command? Thanks
[flexcoders] HTTPService using underscores in variable names not working with POST...
Newbie problem, I think, I need to POST to a php script that has underscores in the variables names. Using the code below the underscores are sent as 5F So the result is: http://localhost/admin/index.php?sec=useradmin5Faction=addplace5F=2 mx:HTTPService resultFormat=text result=userResult(event) id=httpAdduser url=http://localhost/admin/index.php?sec=user; showBusyCursor=true useProxy=false method=POST mx:request xmlns= admin_actionadd/admin_action place_next2/place_next /mx:request /mx:HTTPService I will welcome any workaround, Action Script based, mod-rewrite, tin foil and bailing wire...
RE: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1
Thansk for the insightful reply. I'm new to flex and am working on an application that was created long before I started on it. I have been refering to existing code to progress my knowledge and have also been reviewing best practices online. The existing code doesn't use strongly typed objects but that is what I'm used to so my development has been using that methodology, actually the boolean assignment is occurning while mapping to a VO. I will use e4x from now on. Thanks again for taking the time to enlighten me. Greg From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Tracy Spratt Sent: Thursday, March 19, 2009 9:20 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1 This is probably happening because you have left the resultFormat at the default object. The object decoder attempts to be smart and changes the xml strings into what it thinks the data types should be. It often guesses wrong. Set the resultFormat=e4x and you will get your data reliably. It will always be strings, but it will be the strings that were sent. There are other reasons not to use resultFormat=object as well. Best practice (with HTTPService) is to get the XML in pure e4x form, then convert it yourself into an ArrayCollection of strongly typed value objects. Tracy Spratt, Lariat Services, development services available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Gregory Kelley Sent: Thursday, March 19, 2009 7:19 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1 That is the problem with the object being inconsistent. Since any string representation is not 0 it becomes true. So in order to get around the bug I have to do boolean(int(value)); That way if value comes back as a stirng it is properly cast to an int then to a boolean. If it comes back as an int then the int(value) is irrelevant and it is still cast to a boolean correctly. Greg From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Maciek Sakrejda Sent: Thursday, March 19, 2009 3:18 PM To: flexcoders@yahoogroups.com; flexcoders@yahoogroups.com Subject: RE: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1 Could this have something to do with the fact that 0 coerced to a Boolean is false and '0' is true, whereas both 1 and '1' are true? -Original Message- From: flexcoders@yahoogroups.com on behalf of Gregory Kelley Sent: Thu 3/19/2009 9:32 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1 I have the following line in the xml returned from the call. rsp stat=ok typePartner/type object inv_text_end_dt= is_comm_paid=0 override_type_id= / /rsp When I reference event.result.rsp.is_comm_paid the result is 0 Now if I pull a record where the value is 1 then the xml looks like rsp stat=ok typePartner/type object inv_text_end_dt= is_comm_paid=1 override_type_id= / /rsp When I reference event.result.rsp.is_comm_paid the result is 1 Anyone see this before? If I need to create a sample I can but it would be late next week, For now I cast it as int then let it get coerced into a boolean. Thanks, Greg
Re: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1
Thanks Tracy for the wonderfull description, Greg, Use this piece of code cmdHttpService.addEventListener(ResultEvent.RESULT, CmdHandler); cmdHttpService.resultFormat = e4x; cmdHttpService.useProxy = false; cmdHttpService.contentType = text/xml ; cmdHttpService.addEventListener(FaultEvent.FAULT, CmdFaultHandler); // This is the Command Fault Handler public function CmdFaultHandler(event:FaultEvent):void { trace(FaultHandler); trace(Cmd is Invalid ); var faultstring:String = event.fault.faultString; Alert.show(FaultHandler, faultstring); } public function CmdHandler(event:ResultEvent):void { trace(Command ResultHandler); var resultXML:XML = new XML(event.result) as XML; // u can use resultXML as a pure XML } -- Regards, Paresh M. More Software Engineer Nashik/Pune, Maharashtra, India. Email - pareshm...@gmail.com On Fri, Mar 20, 2009 at 9:50 AM, Gregory Kelley gkel...@pngmail.com wrote: Thansk for the insightful reply. I'm new to flex and am working on an application that was created long before I started on it. I have been refering to existing code to progress my knowledge and have also been reviewing best practices online. The existing code doesn't use strongly typed objects but that is what I'm used to so my development has been using that methodology, actually the boolean assignment is occurning while mapping to a VO. I will use e4x from now on. Thanks again for taking the time to enlighten me. Greg -- *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Tracy Spratt *Sent:* Thursday, March 19, 2009 9:20 PM *To:* flexcoders@yahoogroups.com *Subject:* RE: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1 This is probably happening because you have left the resultFormat at the default “object”. The object decoder attempts to be smart and changes the xml strings into what it thinks the data types should be. It often guesses wrong. Set the resultFormat=”e4x” and you will get your data reliably. It will always be strings, but it will be the strings that were sent. There are other reasons not to use resultFormat=”object” as well. Best practice (with HTTPService) is to get the XML in pure e4x form, then convert it yourself into an ArrayCollection of strongly typed value objects. Tracy Spratt, Lariat Services, development services available -- *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Gregory Kelley *Sent:* Thursday, March 19, 2009 7:19 PM *To:* flexcoders@yahoogroups.com *Subject:* RE: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1 That is the problem with the object being inconsistent. Since any string representation is not 0 it becomes true. So in order to get around the bug I have to do boolean(int(value)); That way if value comes back as a stirng it is properly cast to an int then to a boolean. If it comes back as an int then the int(value) is irrelevant and it is still cast to a boolean correctly. Greg -- *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Maciek Sakrejda *Sent:* Thursday, March 19, 2009 3:18 PM *To:* flexcoders@yahoogroups.com; flexcoders@yahoogroups.com *Subject:* RE: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1 Could this have something to do with the fact that 0 coerced to a Boolean is false and '0' is true, whereas both 1 and '1' are true? -Original Message- From: flexcoders@yahoogroups.com on behalf of Gregory Kelley Sent: Thu 3/19/2009 9:32 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1 I have the following line in the xml returned from the call. rsp stat=ok typePartner/type object inv_text_end_dt= is_comm_paid=0 override_type_id= / /rsp When I reference event.result.rsp.is_comm_paid the result is 0 Now if I pull a record where the value is 1 then the xml looks like rsp stat=ok typePartner/type object inv_text_end_dt= is_comm_paid=1 override_type_id= / /rsp When I reference event.result.rsp.is_comm_paid the result is 1 Anyone see this before? If I need to create a sample I can but it would be late next week, For now I cast it as int then let it get coerced into a boolean. Thanks, Greg
[flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1
I have the following line in the xml returned from the call. rsp stat=ok typePartner/type object inv_text_end_dt= is_comm_paid=0 override_type_id= / /rsp When I reference event.result.rsp.is_comm_paid the result is 0 Now if I pull a record where the value is 1 then the xml looks like rsp stat=ok typePartner/type object inv_text_end_dt= is_comm_paid=1 override_type_id= / /rsp When I reference event.result.rsp.is_comm_paid the result is 1 Anyone see this before? If I need to create a sample I can but it would be late next week, For now I cast it as int then let it get coerced into a boolean. Thanks, Greg
RE: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1
Could this have something to do with the fact that 0 coerced to a Boolean is false and '0' is true, whereas both 1 and '1' are true? -Original Message- From: flexcoders@yahoogroups.com on behalf of Gregory Kelley Sent: Thu 3/19/2009 9:32 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1 I have the following line in the xml returned from the call. rsp stat=ok typePartner/type object inv_text_end_dt= is_comm_paid=0 override_type_id= / /rsp When I reference event.result.rsp.is_comm_paid the result is 0 Now if I pull a record where the value is 1 then the xml looks like rsp stat=ok typePartner/type object inv_text_end_dt= is_comm_paid=1 override_type_id= / /rsp When I reference event.result.rsp.is_comm_paid the result is 1 Anyone see this before? If I need to create a sample I can but it would be late next week, For now I cast it as int then let it get coerced into a boolean. Thanks, Greg
RE: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1
That is the problem with the object being inconsistent. Since any string representation is not 0 it becomes true. So in order to get around the bug I have to do boolean(int(value)); That way if value comes back as a stirng it is properly cast to an int then to a boolean. If it comes back as an int then the int(value) is irrelevant and it is still cast to a boolean correctly. Greg From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Maciek Sakrejda Sent: Thursday, March 19, 2009 3:18 PM To: flexcoders@yahoogroups.com; flexcoders@yahoogroups.com Subject: RE: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1 Could this have something to do with the fact that 0 coerced to a Boolean is false and '0' is true, whereas both 1 and '1' are true? -Original Message- From: flexcoders@yahoogroups.com on behalf of Gregory Kelley Sent: Thu 3/19/2009 9:32 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1 I have the following line in the xml returned from the call. rsp stat=ok typePartner/type object inv_text_end_dt= is_comm_paid=0 override_type_id= / /rsp When I reference event.result.rsp.is_comm_paid the result is 0 Now if I pull a record where the value is 1 then the xml looks like rsp stat=ok typePartner/type object inv_text_end_dt= is_comm_paid=1 override_type_id= / /rsp When I reference event.result.rsp.is_comm_paid the result is 1 Anyone see this before? If I need to create a sample I can but it would be late next week, For now I cast it as int then let it get coerced into a boolean. Thanks, Greg
RE: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1
This is probably happening because you have left the resultFormat at the default object. The object decoder attempts to be smart and changes the xml strings into what it thinks the data types should be. It often guesses wrong. Set the resultFormat=e4x and you will get your data reliably. It will always be strings, but it will be the strings that were sent. There are other reasons not to use resultFormat=object as well. Best practice (with HTTPService) is to get the XML in pure e4x form, then convert it yourself into an ArrayCollection of strongly typed value objects. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Gregory Kelley Sent: Thursday, March 19, 2009 7:19 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1 That is the problem with the object being inconsistent. Since any string representation is not 0 it becomes true. So in order to get around the bug I have to do boolean(int(value)); That way if value comes back as a stirng it is properly cast to an int then to a boolean. If it comes back as an int then the int(value) is irrelevant and it is still cast to a boolean correctly. Greg _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Maciek Sakrejda Sent: Thursday, March 19, 2009 3:18 PM To: flexcoders@yahoogroups.com; flexcoders@yahoogroups.com Subject: RE: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1 Could this have something to do with the fact that 0 coerced to a Boolean is false and '0' is true, whereas both 1 and '1' are true? -Original Message- From: flexcoders@yahoogroups.com on behalf of Gregory Kelley Sent: Thu 3/19/2009 9:32 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] httpservice formatted as Object 0 = 0 but 1 = 1 I have the following line in the xml returned from the call. rsp stat=ok typePartner/type object inv_text_end_dt= is_comm_paid=0 override_type_id= / /rsp When I reference event.result.rsp.is_comm_paid the result is 0 Now if I pull a record where the value is 1 then the xml looks like rsp stat=ok typePartner/type object inv_text_end_dt= is_comm_paid=1 override_type_id= / /rsp When I reference event.result.rsp.is_comm_paid the result is 1 Anyone see this before? If I need to create a sample I can but it would be late next week, For now I cast it as int then let it get coerced into a boolean. Thanks, Greg
[flexcoders] HTTPService never returning...
I have an AS3 HTTPService (that is, the HTTPService is all AS3 based, no MXML) which travels off and gets an XML feed, returns and displays the data. There are several (20+) instances where I can click on an item and this happens properly. However, I have 1 (just one) instance where this crashes my AIR app. I've verified the URL, it DOES render in an HTML page (as XML) so, there is no issue with the URL. I can click on ANY other item to load the XML and it loads - every time. My App works fine as long as I never select the one item in particular. I've profiled the app, memory usage actually drops off when I selecte that one item. I've got listeners for every possible event - none of which ever get sent after hitting HTTPService.send(). The app acts as though everything's fine, it's just loading data. I put a timeout of 5 seconds on the HTTPService. After about 2 minutes of still nothing, I manually shut down the app. Anyone have any ideas?
RE: [flexcoders] HTTPService never returning...
Can you try getting an HTTP Sniffer to see what the raw response looks like? Are they HTTPS URLs? Pete -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of nathanpdaniel Sent: Tuesday, March 17, 2009 12:32 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] HTTPService never returning... I have an AS3 HTTPService (that is, the HTTPService is all AS3 based, no MXML) which travels off and gets an XML feed, returns and displays the data. There are several (20+) instances where I can click on an item and this happens properly. However, I have 1 (just one) instance where this crashes my AIR app. I've verified the URL, it DOES render in an HTML page (as XML) so, there is no issue with the URL. I can click on ANY other item to load the XML and it loads - every time. My App works fine as long as I never select the one item in particular. I've profiled the app, memory usage actually drops off when I selecte that one item. I've got listeners for every possible event - none of which ever get sent after hitting HTTPService.send(). The app acts as though everything's fine, it's just loading data. I put a timeout of 5 seconds on the HTTPService. After about 2 minutes of still nothing, I manually shut down the app. Anyone have any ideas? -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
RE: [flexcoders] HttpService headers - age old problem
See: http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security.html For POST requests, the confusion probably arises because it was possible to send Authorization headers in the past, but it was added to the list of restricted headers (I don't have the exact version handy, but it might have been 9.0.124). Even though the crossdomain policy format was expanded to include an allowed header list, I believe the restricted headers are still always ignored. See http://livedocs.adobe.com/flex/3/langref/flash/net/URLRequestHeader.html for a list of restricted headers. For GET requests, headers not being sent is a different issue logged against URLLoader - I believe this is due to a limitation of the plugin APIs exposed to the player. There are several duplicates logged, but one is: https://bugs.adobe.com/jira/browse/FP-209. Pete -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of stevepruitt97 Sent: Wednesday, February 11, 2009 12:31 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] HttpService headers - age old problem This seems to be an age-old issue. I need to set the Authorization header for GET requests. I read it cannot be done and I have read articles that hint it is doable. Which is it? I have no cross-domain issues. Everything is sent to the same server. I found the following adobe TechNote: http://kb.adobe.com/selfservice/viewContent.do? externalId=kb403184sliceId=1 appears to state that post Flash player 9.0.115.0 the Authorization header can be sent with either GET or POST. I have player 9.0.224.0. However, I cannot the Authorization header or a custom header to go across. Has anyone successfully set the Authorization header for any customer header for that matter with the HttpService? Thanks. -S -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] HTTPService POST method weirdness
I make a request to a service using URLLoader and everything works fine. I try the same thing with HTTPService and I get back an error telling me that only POST method is allowed. (My server-side friend tells me that Apache saw it as a GET.) In both cases I am setting the method to POST and sending the exact same data in the request. The service url is an https url. Can that have anything to do with this? -A
[flexcoders] HTTPService vs URLRequest
Surprisingly, I am having a very difficult time finding any discussion on the advantages of using HTTPService instead of URLRequest. I've always used URLRequest to handle my web API calls. What are some of the benefits of using the HTTPService instead? I like URLLoader because my network libraries aren't dependant on flex, but I don't quite understand why Adobe makes very little mention of URLLoader in their Flex documentation, and also doesn't have any articles comparing HTTPService to URLLoader.
RE: [flexcoders] HTTPService vs URLRequest
Of course HTTPService uses URLLoader when you are using a direct connection to your server. HTTPService supports resultFormats, data binding, proxying with blazeDS, channel set failover, MXML tag definition, and AsyncToken's for more flexible code notification. URLLoader is well covered in the flash documentation but there's no reason you can't use it for Flex too. Jeff From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Osman Ullah Sent: Thursday, March 05, 2009 7:57 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] HTTPService vs URLRequest Surprisingly, I am having a very difficult time finding any discussion on the advantages of using HTTPService instead of URLRequest. I've always used URLRequest to handle my web API calls. What are some of the benefits of using the HTTPService instead? I like URLLoader because my network libraries aren't dependant on flex, but I don't quite understand why Adobe makes very little mention of URLLoader in their Flex documentation, and also doesn't have any articles comparing HTTPService to URLLoader. inline: image001.jpginline: image002.jpg
Re: [flexcoders] HTTPService vs URLRequest
One good thing about URLLoader is that you can load binary data with it. HTTPService doesn't seem to allow this, though I could be wrong about that. On 06/03/2009, at 2:56 AM, Osman Ullah wrote: Surprisingly, I am having a very difficult time finding any discussion on the advantages of using HTTPService instead of URLRequest. I've always used URLRequest to handle my web API calls. What are some of the benefits of using the HTTPService instead? I like URLLoader because my network libraries aren't dependant on flex, but I don't quite understand why Adobe makes very little mention of URLLoader in their Flex documentation, and also doesn't have any articles comparing HTTPService to URLLoader.
RE: [flexcoders] HTTPService vs URLRequest
I suppose if you Base64 encode it for transfer it would, but that adds roughly 30% to size of the binary data being transferred. From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Guy Morton Sent: Thursday, March 05, 2009 2:55 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] HTTPService vs URLRequest One good thing about URLLoader is that you can load binary data with it. HTTPService doesn't seem to allow this, though I could be wrong about that. On 06/03/2009, at 2:56 AM, Osman Ullah wrote: Surprisingly, I am having a very difficult time finding any discussion on the advantages of using HTTPService instead of URLRequest. I've always used URLRequest to handle my web API calls. What are some of the benefits of using the HTTPService instead? I like URLLoader because my network libraries aren't dependant on flex, but I don't quite understand why Adobe makes very little mention of URLLoader in their Flex documentation, and also doesn't have any articles comparing HTTPService to URLLoader. This message is private and confidential. If you have received it in error, please notify the sender and remove it from your system.
[flexcoders] HttpService headers
This seems to be an age-old issue. I need to set the Authorization header for GET requests. I have no cross-domain issues. Everything is sent to the same server. I found the following adobe TechNote: http://kb.adobe.com/selfservice/viewContent.do?externalId=kb403184sliceId=1 appears to state that post Flash player 9.0.115.0 the Authorization header can be sent with either GET or POST. I have player 9.0.224.0. However, it appears to work only for POST. Has anyone successfully set the Authorization header for any customer header for that matter with the HttpService? Thanks. -S
[flexcoders] HttpService headers - age old problem
This seems to be an age-old issue. I need to set the Authorization header for GET requests. I read it cannot be done and I have read articles that hint it is doable. Which is it? I have no cross-domain issues. Everything is sent to the same server. I found the following adobe TechNote: http://kb.adobe.com/selfservice/viewContent.do? externalId=kb403184sliceId=1 appears to state that post Flash player 9.0.115.0 the Authorization header can be sent with either GET or POST. I have player 9.0.224.0. However, I cannot the Authorization header or a custom header to go across. Has anyone successfully set the Authorization header for any customer header for that matter with the HttpService? Thanks. -S
[flexcoders] Httpservice proxy?
I built a small stock widget that accesses http://quote.yahoo.com/d/quotes.csv to get the stock information. The app works fine on my desktop but when I upload it to our domain it doesn't work. I have no idea what the issue is but I was thinking maybe it was a proxy issue? Should this just work? Maybe it's a security issue at my company? Thanks! Nate
Re: [flexcoders] Httpservice proxy?
On Wed, Jan 14, 2009 at 10:37 PM, Nate Pearson napearso...@yahoo.com wrote: I built a small stock widget that accesses http://quote.yahoo.com/d/quotes.csv to get the stock information. The app works fine on my desktop but when I upload it to our domain it doesn't work. Yes, it looks like they have a crossdomain.xml that won't allow your app. http://quote.yahoo.com/crossdomain.xml Manish -- Manish Jethani mx:Blog source=/dev/random ... manishjethani.com
[flexcoders] HTTPService Busy Cursor
I am using the mx:HTTPService from Flex and it has a showBusyCursor property that I set to true: mx:HTTPService id=httpService showBusyCursor=true result=handleResult(event) fault=handleFault(event) method=GET url=http://someurl/; / When the HttpService is issued a send request, the busy cursor is shown as an animated clock. I would like to use a custom gif. Is there any easy way to do this? Thanks
[flexcoders] HTTPService and response headers
This topic has probably been beaten to death, but I want to make sure I'm not missing something before writing a new service. Looking through the API docs and Google it seems the only way to access response headers is to use a proxy. Is this still the case? thanks -Ricky
[flexcoders] httpservice to api
Ah-hah. I discovered that I have to use a proxy, otherwise the setRemoteCredentials function is ignored... Using a proxy and a services- config.xml to set parameters, I recokon I can specify https. Certainly I can specify it as destination: destination property destination:String [read-write] An HTTPService destination name in the services-config.xml file. When unspecified, Flex uses the DefaultHTTP destination. If you are using the url property, but want requests to reach the proxy over HTTPS, specify DefaultHTTPS. ,,,but I remain unclear whether that means that I am actually communicating across a secured channel... or just accessing a secure destination. Anyway, some light in the murk.
[flexcoders] httpservice to api
I am a relative newbie in the Flex and development world, trying to extend my design skills. So please forgive any foolish errors. Presently I am attempting to communicate with the photoshelter api via httpservice, and need help. I can successfully log-in and get authorisation - but cannot work out how to actually access albums and galleries via their api xml syntax. (...although it looks as though it should be straightforward...) I have tried adapting code I found on flexexamples - dynamically-loading-xml-files-using-the- httpservice-tag: mx:Script ![CDATA[ import mx.rpc.http.HTTPService; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; import mx.controls.Alert; private var alert:Alert; public function setRemoteCredentials(remoteUsername:String=,remotePassword:String=x, charset:String = null):void { httpService.url=https://www.photoshelter.com/bsapi/1.1/auth;; httpService.send(setRemoteCredentials); } private function loadGallery(src:String):void { httpService.url = https://www.photoshelter.com/bsapi/1.1/alb-qry;; httpService.send(); } private function httpService_fault(evt:FaultEvent):void { var title:String = evt.type + ( + evt.fault.faultCode + ); var text:String = evt.fault.faultString; alert = Alert.show(text, title); xmlListColl.removeAll(); } private function httpService_result(evt:ResultEvent):void { var xmlList:XMLList = XML(evt.result).alb; xmlListColl = new XMLListCollection(xmlList); trace(Done!); } ]] /mx:Script mx:XMLListCollection id=xmlListColl / mx:HTTPService id=httpService resultFormat=e4x showBusyCursor=true fault=httpService_fault(event); result=httpService_result(event) / mx:ApplicationControlBar dock=true mx:Button label=Data click=setRemoteCredentials()/ mx:Button label=Travel click=loadGallery('Travel'); / mx:Button label=Landscapes click=loadGallery('Landscapes UK'); / mx:Button label=gallery 404 click=loadGallery('gallery404.xml'); / /mx:ApplicationControlBar mx:TileList id=tileList dataProvider={xmlListColl} itemRenderer=TileListItemRenderer columnCount=3 columnWidth=150 rowCount=2 rowHeight=100 / /mx:Application -- //TileListItemRenderer// ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; mx:Image source=[EMAIL PROTECTED] horizontalCenter=0 verticalCenter=0 / /mx:Canvas I am unsure what I should put as the source - and have tried [EMAIL PROTECTED] as well as [EMAIL PROTECTED] But I am not sure that I am querying the api correctly... Whatever I am doing wrong, it also prevents the gallery 404 error message appearing anymore... Any help would be greatly appreciated.
Re: [flexcoders] httpservice to api
Can you post a copy of the XML that you are actually receiving from the service? if you put trace(XML(evt.result).toXMLString()); in your httpService_result function, you should get a look at the XML that is being sent to your application from the web service. At a glance here, my guess is that the @ may not be needed, or that you are just asking for the wrong variable. You use the @ symbol to specify XML attributes, if you omit the @ symbol, you are specifying XML elements. So the answer depends on XML that you are receiving. If I had to guess, I would guess you probably need data.url or [EMAIL PROTECTED] Rob function, you should get a dump of the XML that On Nov 27, 2008, at 7:05 PM, spinglittery wrote: I am a relative newbie in the Flex and development world, trying to extend my design skills. So please forgive any foolish errors. Presently I am attempting to communicate with the photoshelter api via httpservice, and need help. I can successfully log-in and get authorisation - but cannot work out how to actually access albums and galleries via their api xml syntax. (...although it looks as though it should be straightforward...) I have tried adapting code I found on flexexamples - dynamically-loading-xml- files-using-the- httpservice-tag: mx:Script ![CDATA[ import mx.rpc.http.HTTPService; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; import mx.controls.Alert; private var alert:Alert; public function setRemoteCredentials (remoteUsername:String=,remotePassword:String=x, charset:String = null):void { httpService.url=https://www.photoshelter.com/bsapi/1.1/auth;; httpService.send(setRemoteCredentials); } private function loadGallery(src:String):void { httpService.url = https://www.photoshelter.com/bsapi/1.1/alb-qry;; httpService.send(); } private function httpService_fault(evt:FaultEvent):void { var title:String = evt.type + ( + evt.fault.faultCode + ); var text:String = evt.fault.faultString; alert = Alert.show(text, title); xmlListColl.removeAll(); } private function httpService_result(evt:ResultEvent):void { var xmlList:XMLList = XML(evt.result).alb; xmlListColl = new XMLListCollection(xmlList); trace(Done!); } ]] /mx:Script mx:XMLListCollection id=xmlListColl / mx:HTTPService id=httpService resultFormat=e4x showBusyCursor=true fault=httpService_fault(event); result=httpService_result(event) / mx:ApplicationControlBar dock=true mx:Button label=Data click=setRemoteCredentials()/ mx:Button label=Travel click=loadGallery('Travel'); / mx:Button label=Landscapes click=loadGallery('Landscapes UK'); / mx:Button label=gallery 404 click=loadGallery('gallery404.xml'); / /mx:ApplicationControlBar mx:TileList id=tileList dataProvider={xmlListColl} itemRenderer=TileListItemRenderer columnCount=3 columnWidth=150 rowCount=2 rowHeight=100 / /mx:Application -- //TileListItemRenderer// ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; mx:Image source=[EMAIL PROTECTED] horizontalCenter=0 verticalCenter=0 / /mx:Canvas I am unsure what I should put as the source - and have tried [EMAIL PROTECTED] as well as [EMAIL PROTECTED] But I am not sure that I am querying the api correctly... Whatever I am doing wrong, it also prevents the gallery 404 error message appearing anymore... Any help would be greatly appreciated.
[flexcoders] HTTPService with mixed parameters
Dear all, I need to call an HTTPService with POST method but I need to transfer some GET parameters too. The tricky part ist, that the GET parameters are transmitted as arrays. Can anyone help me in order to build the correct HTTPService? Currently I am using this code but this one sends everything as POST params to the service: mx:HTTPService method=GET id=jsonRequest2 resultFormat=text showBusyCursor=true result=handleResult(event) url=http://my.url/service; mx:request methodgetMessage/method params{params}/params !-- Should be GET -- preferedMainTextPartTypes{mainTypes}/preferedMainTextPartTypes !-- Should be GET -- /mx:request /mx:HTTPService The params are built in this way: [Bindable] private var params:Object = {folder:INBOX.Drafts, getHeaderFields:1, mainTextPartProcessing:html, uid:1592}; [Bindable] private var mainTypes:Object = {0:html, 1:plain}; Any help highly appreciated! Thanks in advance Reto
[flexcoders] httpservice/save-as question
I already have working code that uses HttpService to send various requests to the backend from my Flex client and process the responses. I also have a customized implementation of the flex DataGrid which implements paging such that the flex client only shows one page of data at a time. The customized control has buttons to issue page forward/backward requests to the backend to get a different page of data. These requests are sent to the backend with HttpService. I have a requirement to save all pages in CSV format on the clients desktop. Prior to flex we had an HTML/Javascript implementation of tables which had the same sort of feature - in that version, the backend would retrieve all of the data, format into csv, and change the content-type on the HTTP response header to text/csv and then setting the content-disposition to attachment, filename=file.csv. The net result was that the browser itself would take care of displaying a dialog that says something like Do you want to open or save this file? I haven't been able to get the same sort of behavior to work with a request generated by the Flash Player. I have my code in the backend modify the HTTP headers in the response to my flex export-to-csv request, but the browser neers displays its open/save dialog - the response always gets directed back to the flash player. Is there a way to make this work? Thanks, Glenn
RE: [flexcoders] httpservice/save-as question
You can keep the Javascript and use an ExternalInterface to communicate with it. Alternatively, use navigateToURL to call the required URL and pass it the correct window so the browser handles it. Gk. Gregor Kiddie Senior Developer INPS Tel: 01382 564343 Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ Registered Number: 1788577 Registered in the UK Visit our Internet Web site at www.inps.co.uk blocked::http://www.inps.co.uk/ The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of INPS or any of its affiliates. If you are not the intended recipient please contact [EMAIL PROTECTED] From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Glenn Jones Sent: 06 November 2008 19:19 To: flexcoders@yahoogroups.com Subject: [flexcoders] httpservice/save-as question I already have working code that uses HttpService to send various requests to the backend from my Flex client and process the responses. I also have a customized implementation of the flex DataGrid which implements paging such that the flex client only shows one page of data at a time. The customized control has buttons to issue page forward/backward requests to the backend to get a different page of data. These requests are sent to the backend with HttpService. I have a requirement to save all pages in CSV format on the clients desktop. Prior to flex we had an HTML/Javascript implementation of tables which had the same sort of feature - in that version, the backend would retrieve all of the data, format into csv, and change the content-type on the HTTP response header to text/csv and then setting the content-disposition to attachment, filename=file.csv. The net result was that the browser itself would take care of displaying a dialog that says something like Do you want to open or save this file? I haven't been able to get the same sort of behavior to work with a request generated by the Flash Player. I have my code in the backend modify the HTTP headers in the response to my flex export-to-csv request, but the browser neers displays its open/save dialog - the response always gets directed back to the flash player. Is there a way to make this work? Thanks, Glenn
Re: [flexcoders] httpservice/save-as question
Will that work with the stand-alone Flash player? On Fri, Nov 7, 2008 at 10:59 AM, Gregor Kiddie [EMAIL PROTECTED] wrote: You can keep the Javascript and use an ExternalInterface to communicate with it. Alternatively, use navigateToURL to call the required URL and pass it the correct window so the browser handles it. Gk. *Gregor Kiddie* Senior Developer *INPS* Tel: 01382 564343 Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ Registered Number: 1788577 Registered in the UK Visit our Internet Web site at www.inps.co.uk The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of INPS or any of its affiliates. If you are not the intended recipient please contact [EMAIL PROTECTED] -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Glenn Jones *Sent:* 06 November 2008 19:19 *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] httpservice/save-as question I already have working code that uses HttpService to send various requests to the backend from my Flex client and process the responses. I also have a customized implementation of the flex DataGrid which implements paging such that the flex client only shows one page of data at a time. The customized control has buttons to issue page forward/backward requests to the backend to get a different page of data. These requests are sent to the backend with HttpService. I have a requirement to save all pages in CSV format on the clients desktop. Prior to flex we had an HTML/Javascript implementation of tables which had the same sort of feature - in that version, the backend would retrieve all of the data, format into csv, and change the content-type on the HTTP response header to text/csv and then setting the content-disposition to attachment, filename=file.csv. The net result was that the browser itself would take care of displaying a dialog that says something like Do you want to open or save this file? I haven't been able to get the same sort of behavior to work with a request generated by the Flash Player. I have my code in the backend modify the HTTP headers in the response to my flex export-to-csv request, but the browser neers displays its open/save dialog - the response always gets directed back to the flash player. Is there a way to make this work? Thanks, Glenn -- Howard Fore, [EMAIL PROTECTED] The universe tends toward maximum irony. Don't push it. - Jeff Atwood
Re: [flexcoders] httpservice/save-as question
if your swf opens a NEW / POPUP browser window it will. On Fri, Nov 7, 2008 at 6:15 PM, Howard Fore [EMAIL PROTECTED] wrote: Will that work with the stand-alone Flash player? On Fri, Nov 7, 2008 at 10:59 AM, Gregor Kiddie [EMAIL PROTECTED]wrote: You can keep the Javascript and use an ExternalInterface to communicate with it. Alternatively, use navigateToURL to call the required URL and pass it the correct window so the browser handles it. Gk. *Gregor Kiddie* Senior Developer *INPS* Tel: 01382 564343 Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ Registered Number: 1788577 Registered in the UK Visit our Internet Web site at www.inps.co.uk The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of INPS or any of its affiliates. If you are not the intended recipient please contact [EMAIL PROTECTED] -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Glenn Jones *Sent:* 06 November 2008 19:19 *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] httpservice/save-as question I already have working code that uses HttpService to send various requests to the backend from my Flex client and process the responses. I also have a customized implementation of the flex DataGrid which implements paging such that the flex client only shows one page of data at a time. The customized control has buttons to issue page forward/backward requests to the backend to get a different page of data. These requests are sent to the backend with HttpService. I have a requirement to save all pages in CSV format on the clients desktop. Prior to flex we had an HTML/Javascript implementation of tables which had the same sort of feature - in that version, the backend would retrieve all of the data, format into csv, and change the content-type on the HTTP response header to text/csv and then setting the content-disposition to attachment, filename=file.csv. The net result was that the browser itself would take care of displaying a dialog that says something like Do you want to open or save this file? I haven't been able to get the same sort of behavior to work with a request generated by the Flash Player. I have my code in the backend modify the HTTP headers in the response to my flex export-to-csv request, but the browser neers displays its open/save dialog - the response always gets directed back to the flash player. Is there a way to make this work? Thanks, Glenn -- Howard Fore, [EMAIL PROTECTED] The universe tends toward maximum irony. Don't push it. - Jeff Atwood -- Fotis Chatzinikos, Ph.D. Founder, Phinnovation [EMAIL PROTECTED],
[flexcoders] HttpService POST shows as GET on server logs
Hi, I am using Version 3.0.0 build 477 of mxmlc. I have the following service code: mx:HTTPService id=sendTestRequest url=http://localhost/basic.xml; useProxy=false method=POST resultFormat=e4x contentType=application/x-www-form-urlencoded fault=onServiceError(event) result=onComplete(event) / I have verified by tracing before my send that the service.method is POST. When I check in live httpheaders it shows a GET and from my apache access logs: [04/Nov/2008:16:12:38 -0800] GET /basic.xml HTTP/1.1 200 40 Thanks in advance, Dan
RE: [flexcoders] HttpService POST shows as GET on server logs
If the POST body is empty, Flex converts the POST to a GET. Is this the case in your situation? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of dantmcgowan Sent: Tuesday, November 04, 2008 7:28 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] HttpService POST shows as GET on server logs Hi, I am using Version 3.0.0 build 477 of mxmlc. I have the following service code: mx:HTTPService id=sendTestRequest url=http://localhost/basic.xml http://localhost/basic.xml useProxy=false method=POST resultFormat=e4x contentType=application/x-www-form-urlencoded fault=onServiceError(event) result=onComplete(event) / I have verified by tracing before my send that the service.method is POST. When I check in live httpheaders it shows a GET and from my apache access logs: [04/Nov/2008:16:12:38 -0800] GET /basic.xml HTTP/1.1 200 40 Thanks in advance, Dan
[flexcoders] HTTPService returns error over HTTPS
Hi everybody, Has anyone encountered a problem of HTTPService returning HTTP request error over HTTPS while working fine over HTTP? We have checked the service, it is returning a proper XML dataset. Plus, in the session where the Flash player reports this error, we know that the service did return a valid dataset but the Flssh Player did not like it. There is very little I can find on this on the net but perhaps some of the pundits here have seen it??? Or anybody from Adobe Flex team can weigh in??? Thanks for your help with this! Denis
Re: [flexcoders] HTTPService returns error over HTTPS
Hi Denis, I have faced this issue once. The problem here was that the server side code was modifying some header values. In my case the problem was with the parameters Cache-Control and Pragma in the response header sent by back end. Do not modify these header parameter. It is because of some constraints set by IE on a secure channel. I do not think it has any thing to do with the flash player because i had tested my application on different computers, It worked for some but failed for most(with the default settings of IE). Just by not making changes in the header values, my problem was solved. Hope it helps you too. If you find more information about this please share it. Regards, Saagar Shetty. From: Denis [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Tuesday, 28 October, 2008 9:06:37 PM Subject: [flexcoders] HTTPService returns error over HTTPS Hi everybody, Has anyone encountered a problem of HTTPService returning HTTP request error over HTTPS while working fine over HTTP? We have checked the service, it is returning a proper XML dataset. Plus, in the session where the Flash player reports this error, we know that the service did return a valid dataset but the Flssh Player did not like it. There is very little I can find on this on the net but perhaps some of the pundits here have seen it??? Or anybody from Adobe Flex team can weigh in??? Thanks for your help with this! Denis Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/
[flexcoders] HTTPService conversion to ArrayCollection problem
This is really bizarre but I have some code that was working previously and now is no longer working. I am using a servlet to output information in the following format: system data nameChannel 1/name idRep1/id /data /system But I am now getting a runtime error: Error #1034: Type Coercion failed: cannot convert mx.utils::[EMAIL PROTECTED] to mx.collections.ArrayCollection Code: public function initializeBrowser(evt:ResultEvent):void { var arr:ArrayCollection = evt.result.system.data; } mx:HTTPService id=reportsList result=initializeBrowser(event) useProxy=false method=GET url={dbURL}/
RE: [flexcoders] HTTPService conversion to ArrayCollection problem
This is probably the Object vs Array problem. The player is unable to differentiate between an array with a single element and an object. Test by adding another data node. I advise changing the default resultFormat to e4x and doing the conversion to ArrayCollection manually, instead of letting Flex do it for you. Or use XMLListCollection directly. Accepted best practice seems to be using resultFormat=e4x and building an ArrayCollection of strongly typed VOs. If you are committed to staying with the default resultFormat, you will need to inspect the event.result object to determine what it contains, and code for the two cases. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of netdeep Sent: Tuesday, September 16, 2008 11:29 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] HTTPService conversion to ArrayCollection problem This is really bizarre but I have some code that was working previously and now is no longer working. I am using a servlet to output information in the following format: system data nameChannel 1/name idRep1/id /data /system But I am now getting a runtime error: Error #1034: Type Coercion failed: cannot convert mx.utils::[EMAIL PROTECTED] to mx.collections.ArrayCollection Code: public function initializeBrowser(evt:ResultEvent):void { var arr:ArrayCollection = evt.result.system.data; } mx:HTTPService id=reportsList result=initializeBrowser(event) useProxy=false method=GET url={dbURL}/
[flexcoders] HTTPService Synchronization
Hi All, Is there any framework in place to make multiple HTTPService requests synchronous. Also, does making concurrency=last helps? Regards,
Re: [flexcoders] HTTPService Synchronization
Rupal The Flex CookBook could help you at here. http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetailsproductId=2postId=7184 Regards Igor Costa www.igorcosta.org On Fri, Sep 5, 2008 at 7:02 PM, rupal_2381 [EMAIL PROTECTED] wrote: Hi All, Is there any framework in place to make multiple HTTPService requests synchronous. Also, does making concurrency=last helps? Regards, -- Igor Costa www.igorcosta.com www.igorcosta.org
[flexcoders] HTTPService Sends Request Multiple Times
I just got done tracking down a nasty bug. In certain cases a request in my app was taking way longer than it should have. Needless to say I fixed that, but I noticed a much more worrisome behavior with HTTPService. It seems that after a certain time period the request was being sent again, which is obviously a problem with a post request since i now have the danger of creating duplicate records. Has anyone experienced an issue like this?
[flexcoders] HttpService Fault Response Body Decoding
praises to user group - httpService is now working. Next issue: Trying to access / unwrap the error message the server sends back. The errors are the programmatic fault conditions (bad login for example) that the server appropriately response with an error condition. The current implementation sends back an XML document and I think it resides in the fault.message.body, but all I see is an Object. I tried casting to XML / XMLDoc and reading the bytes via writeUTFBytes into a byteArray. Any ideas? thanks in advance.
RE: [flexcoders] HttpService Fault Response Body Decoding
Is the result handler being called? (this would be good news) Or is the fault handler being called (this would be bad news for you)? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ron_mori Sent: Friday, July 25, 2008 3:45 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] HttpService Fault Response Body Decoding praises to user group - httpService is now working. Next issue: Trying to access / unwrap the error message the server sends back. The errors are the programmatic fault conditions (bad login for example) that the server appropriately response with an error condition. The current implementation sends back an XML document and I think it resides in the fault.message.body, but all I see is an Object. I tried casting to XML / XMLDoc and reading the bytes via writeUTFBytes into a byteArray. Any ideas? thanks in advance.
[flexcoders] HttpService Request Parmeters
Coders, Think: HttpService used for REST service calls. On a POST method I would like to supply a user/password set of parameters in the following XML format. ?xml version='1.0' encoding='UTF-8'? login xmlns=http://mydomain.com/project; xmlns:foo=http://mydomain.com/parms; userfoo/user passwordbar/password /login Unfortunately the REST services are not subject to change, hence the need to follow their format. My research tells me that I'm asking too much of the httpService 'request'. Only the simpliest xml generation or form encoding is available. Any suggestions or ideas? thanks in advance.
Re: [flexcoders] HttpService Request Parmeters
You can POST arbitrary xml data to HttpService. What you can't do is anything other than GET or POST which makes interacting with most (true) REST services difficult or impossible. -Josh On Fri, Jul 25, 2008 at 10:23 AM, ron_mori [EMAIL PROTECTED] wrote: Coders, Think: HttpService used for REST service calls. On a POST method I would like to supply a user/password set of parameters in the following XML format. ?xml version='1.0' encoding='UTF-8'? login xmlns=http://mydomain.com/project; xmlns:foo=http://mydomain.com/parms; userfoo/user passwordbar/password /login Unfortunately the REST services are not subject to change, hence the need to follow their format. My research tells me that I'm asking too much of the httpService 'request'. Only the simpliest xml generation or form encoding is available. Any suggestions or ideas? thanks in advance. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
[flexcoders] HTTPService receiving an array as parameter
Hi guys, I'm interested if it's possible to send an array as a parameter when doing an HTTP request. Curretly, we can directly do it: foo[]=1foo[]=2foo[]=3 Most server side languages understand this as foo = Array( [0] = 1, [1] = 2, [2] = 3 ) I tried the same in Flex: var params:Object = new Object(); params.foo = new Array(); params.foo.push(1); params.foo.push(2); params.foo.push(3); service.send(params); But it doesn't work... I'm curious how can this be achieved in Flex Thanks in advance, Regards, -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9166-6902 MSN: [EMAIL PROTECTED] URL: http://blog.bisna.com Rio de Janeiro - RJ/Brazil
[flexcoders] httpservice and repetitive calls
I'm using the httpservice to make a call to an aspx page which runs a query and returns the results. This is fine, but if I try to run the same call again, the service is not actually going out to make the call, but rather just returning the results from the previous call. I know this because the aspx page logs each call made to it. I always see the first call, but no subsequent calls come through if I post the same data. If I send a different set of data, the call works fine, but then will not post that data again. Any ideas on why it doesn't want to actually make the call? Below are the relevant pieces of code: script ... public function lblClickHandler(event:Event):void{ tgtdata = event.currentTarget.data.toString(); customer_id = event.currentTarget.data; useHttpService(); } public function useHttpService():void { userReq.url = dstURL; //set in another part of the code userReq.method = GET; var Obj:Object = new Object(); Obj.w = wispid; //wispid is just a number that is set elsewhere Obj.i = tgtdata; userReq.send(Obj); } ... /script mx:HTTPService id=userReq result=gethttpResult(event) fault=handleFault(event) useProxy=false method=GET resultFormat=object /
RE: [flexcoders] httpservice and repetitive calls
See my response to your first post. Use the POST method instead of get. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cameron Sent: Tuesday, June 24, 2008 1:18 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] httpservice and repetitive calls I'm using the httpservice to make a call to an aspx page which runs a query and returns the results. This is fine, but if I try to run the same call again, the service is not actually going out to make the call, but rather just returning the results from the previous call. I know this because the aspx page logs each call made to it. I always see the first call, but no subsequent calls come through if I post the same data. If I send a different set of data, the call works fine, but then will not post that data again. Any ideas on why it doesn't want to actually make the call? Below are the relevant pieces of code: script ... public function lblClickHandler(event:Event):void{ tgtdata = event.currentTarget.data.toString(); customer_id = event.currentTarget.data; useHttpService(); } public function useHttpService():void { userReq.url = dstURL; //set in another part of the code userReq.method = GET; var Obj:Object = new Object(); Obj.w = wispid; //wispid is just a number that is set elsewhere Obj.i = tgtdata; userReq.send(Obj); } ... /script mx:HTTPService id=userReq result=gethttpResult(event) fault=handleFault(event) useProxy=false method=GET resultFormat=object /
Re: [flexcoders] httpservice and repetitive calls
I never saw my first post come through...hence the second post. That worked by the way, but I'm curious as to why? Cameron Tracy Spratt wrote: See my response to your first post. Use the POST method instead of get. Tracy *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Cameron *Sent:* Tuesday, June 24, 2008 1:18 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] httpservice and repetitive calls I'm using the httpservice to make a call to an aspx page which runs a query and returns the results. This is fine, but if I try to run the same call again, the service is not actually going out to make the call, but rather just returning the results from the previous call. I know this because the aspx page logs each call made to it. I always see the first call, but no subsequent calls come through if I post the same data. If I send a different set of data, the call works fine, but then will not post that data again. Any ideas on why it doesn't want to actually make the call? Below are the relevant pieces of code: script ... public function lblClickHandler(event:Event):void{ tgtdata = event.currentTarget.data.toString(); customer_id = event.currentTarget.data; useHttpService(); } public function useHttpService():void { userReq.url = dstURL; //set in another part of the code userReq.method = GET; var Obj:Object = new Object(); Obj.w = wispid; //wispid is just a number that is set elsewhere Obj.i = tgtdata; userReq.send(Obj); } ... /script mx:HTTPService id=userReq result=gethttpResult(event) fault=handleFault(event) useProxy=false method=GET resultFormat=object /
RE: [flexcoders] httpservice and repetitive calls
As I understand from my reading, the W3C specs state that POST methods do not cache. There are posts on this list about it, and I am sure you could look into the specs themselves. I have just always used POST, and never had any problems. Aspx is nice because Request(myParm) handles both post and get parameters. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cameron Sent: Tuesday, June 24, 2008 6:48 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] httpservice and repetitive calls I never saw my first post come through...hence the second post. That worked by the way, but I'm curious as to why? Cameron Tracy Spratt wrote: See my response to your first post. Use the POST method instead of get. Tracy -- *From:* flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] *On Behalf Of *Cameron *Sent:* Tuesday, June 24, 2008 1:18 PM *To:* flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com *Subject:* [flexcoders] httpservice and repetitive calls I'm using the httpservice to make a call to an aspx page which runs a query and returns the results. This is fine, but if I try to run the same call again, the service is not actually going out to make the call, but rather just returning the results from the previous call. I know this because the aspx page logs each call made to it. I always see the first call, but no subsequent calls come through if I post the same data. If I send a different set of data, the call works fine, but then will not post that data again. Any ideas on why it doesn't want to actually make the call? Below are the relevant pieces of code: script ... public function lblClickHandler(event:Event):void{ tgtdata = event.currentTarget.data.toString(); customer_id = event.currentTarget.data; useHttpService(); } public function useHttpService():void { userReq.url = dstURL; //set in another part of the code userReq.method = GET; var Obj:Object = new Object(); Obj.w = wispid; //wispid is just a number that is set elsewhere Obj.i = tgtdata; userReq.send(Obj); } ... /script mx:HTTPService id=userReq result=gethttpResult(event) fault=handleFault(event) useProxy=false method=GET resultFormat=object /