Getting data into flex charts from csv - apache-flex

I am developing a flex charting web application which gets data from csv files. This application is supposed to be installed on the website of a client. The client uses a web server management system where the URLs generated are pretty long and contain non-alphanumeric characters. An example is given below:
http://www.example.com/EXTERNAL/ORGANIZATION/0,,contentMDK:20135608~pagePK:64060242~piPK:64060289~theSitePK:299948,00.html
The problem is that on my test server, the application is running just fine. But when deployed on the client's site, the application and the charts load, but the CSV data fails to load. The error given is:
Input output error: IO_ERROR
I have tried both relative referencing (relative with respect to the swf file) and absolute reference to the URL of the csv file. But both approaches have failed.
Any ideas?
I would ideally like to stay away from absolute URLs since that would break down if the charts need to move to another location.
Thanks
Vinayak

Umm, I don't know what to say really. Not knowing much about the server I'll have to resort to a list of things I can think of. Some of these are admittedly just a stab in the dark. In general it appears that this is a server side issue and as a front end developer you can't be expected to solve this. I know that getting the application to work is the priority here, but if you don't have access to the server there not much you can do to this issue.
First let's eliminate the completely obvious. Is the file ending definitely supposed to be .html and not .csv?
My original thought was that the CMS is somehow blocking Flash from loading the content, but would allow a browser to access it. Since it won't allow that either there are three options that come to mind:
1) The server or the browser does something to the URL when you make the request. Try installing the LiveHTTPHeaders (link) add on for Firefox, that'll allow you to look at the raw HTTP requests and responses. There might be some server side redirects that affect the request. The HTTP Headers should help you with that too.
2) The .csv files are kept in a folder that the web server doesn't have read access to.
3) maybe you need to use HTTPS instead of HTTP. This would be a bit strange since you are getting the URL from the server in the first place. The clients server admin should be able to sort this out for you.
4) I'm not sure what would happen if the script that handles your request is Python. In Python the colons are directory separators, so that might throw the whole thing off.
5) The clients management system does something strange to the URL before it's handed to you. Although I'm not sure how you would test this.
That's it I think. I'm out of ideas for now. For the testing I would forget the flex application and just try the requests from the browser address bar first. Since the application is working on your test server the issue shouldn't be your code. When you get the requests to work on the browser, if they still don't work from Flex then it's your code.

I don't know how much it helps, but there is an as3 CSVLib available.
About the IOError, can you please paste the text ?
If you listen for the IOErrorEvent and trace event.text in the handler,
you should something similar to this:
Error #2035: URL Not Found. URL: yourFile.csv
HTH,
George

Related

manifest.json causing 500 errors in ASP .NET application

So I added a manifest.json to the application. I am using it to define various icon settings and mobile settings. I gave it a start url of "/", and I've tested it with a start url of "~", "." and simply leaving the property undefined.
The manifest works locally, but when I build it to a QA server I get error 500s on a bunch of javascript files in the bundle, including the VMs that generate the navigation for the app. I've added the JSON mimeMap to the web.config and have done a fair amount of research but I'm coming up blank. Help!
The ~ works with the ASP.NET rendering engine to render relative URLs. This is really limited to the server. Remember the PWA code is decoupled from your server-side code/server. The browser is only looking at the server via HTTP and is unaware of any server-side logic you may have. It only cares about what is sent to it across the wire.
Analyze your network waterfall and see what URLs are being requested. If the URLs being requested have the ~ in them, you need to change your manifest file, well you should remove that anyway IMO.
Do you know the details of the server side error(s)? Or are you masking that behind the default 5xx message in ASP.NET? It would be helpful to know what the exact error being thrown on the server is to help debug the issue.

Flex error on using HTTP Service

Hi I'm trying a simple tutorial of retrieving RSS feeds from yahoo and keep getting this error:
RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"
I've seen some articles that say I need a crossdomain.xml file, but I don't really know how to set this file up and how to use it from the Flex SDK compiler (mxmlc).
Thanks
The crossdomain.xml file needs to live at the root of the server that you are accessing. If they have not put that there, then you are out of luck when running in the browser. It is part of an important security aspect of running in a browser sandbox (Silverlight has the same restriction). It is waived if you are running in Air (or pretty much anything out of the browser).
Lets say that you are trying to receive data from http://foo.com/rest/rss/all (or something like that). You can chec quickly to see if they allow cross-site scripting (XSC) by browsing to http://foo.com/crossdomain.xml. If it is not there, then you can't do it.
Still, the comments you got about more information would help us give you a better answer.

Adobe Flex, loading a remote swf

I have a flex app running on my server.
I have had a request from some clients to have the swf loaded on their server, so that their customers dont have to be transferred to my server to login; i.e. from the user's point of view it looks like they are logging in from theirsite.com instead of mysite.com
I tried something really simple, and that was to give them a html wrapper to host on their site. The only modification that I made was to change the "src" var to:
"src", "https://www.mysite.com/app/myapp.swf"
and
embed src="https://www.mysite.com/app/myapp.swf"
To my surprise, this worked perfectly. And best of all, the service calls still seem to come from mysite.com, so I dont have to bother with modifying the crossdomain.xml file.
All good it seems.
Are there any issues or downsides to the above that I should be aware of?
If you're doing an ExternalInterface calls to JavaScript in the enclosing page, this may cause a security error; since the SWF from your domain shouldn't be able to access HTML content served from your client's domain.
I expect that is a fringe case though. Aside from that, what you're doing is not much different than what YouTube does. I've done the same thing with The Flex Show player. I don't think you'll have any issues. And I do not believe that this approach makes your app any less (or less) secure.

Using HttpModule to Display Images

I have an HttpModule that displays images that follow a certain URL pattern. For example, /images/employees/jason.jpg is handled by the module, but all other images aren't. It works just fine on my local machine (Cassini and IIS 7). However, the IIS6 production server isn't working. I've had the hosting company map the images to the ASP.NET worker process. Now, all images are showing that they can't render except for the images that should be rendered by the module. They are working correct.
I ran an HttpWatch instance on one of the files and received the following error:
ERROR_HTTP_INVALID_SERVER_RESPONSE
Any ideas?
Final Answer:
The module needed to be updated to transmit server files. So, I added an else to my original if and checked to see if it was an image type (by using a utility method) then use Response.TransmitFile() to pass on the file to the browser.
I then ran into a spacing issue with the images. This was because I forgot that I had .aspx files registered as an image type to perform the testing. So each page would crash during the debug process or add padding that was established from CSS. Doh!
Everything is just peachy now. Thanks to all!
There's doesn't seem to be anything particularly wrong with your module, so the issue must be coming from somewhere else. Have you got security that might be blocking the images? What actually gets returned when you request a static file?
I'd suggest seeing what gets returned (and its headers) using something like firebug to check things like the response code, content type, the actual raw response, etc...
check your web.config IIS6 / IIS7 have different places to add modules and depends on what mode your IIS7 is running in.
http://arcware.net/use-a-single-web-config-for-iis6-and-iis7

Why does Response.Redirect("") Return an Error in One Test Environment and Not Another?

We're trying to figure out how to fix a bug found in 3rd party IV&V testing, which we can't recreate in our internal test environment.
We've determined that the bug is caused by a URL value being inadvertently set to an empty string ("") before attempting to redirect to it. Hence, we're trying to execute Response.Redirect("").
In the external test environment, this line of code results in the following error:
Internet Explorer cannot display the webpage
In the internal test environment, the current page is simply reloaded.
The servers are virtually identical - the internal test server has the same physical hardware as the external server, and is even running a copy of a virtual image of the external server. Hence, all Windows and IIS settings should be identical.
Is there a physical networking, load balancing or other environmental issue that could cause this kind of discrepancy?
Thanks for any ideas.
I would use Fiddler to take a look at the HTTP response from the server and make sure they are exactly the same. When you've done that, you know it's a client-side or environment issue. Next...
What is the URL in the address bar for the two browsers? Better yet... in IE right click on the page and look at the Properites. What are you really seeing here? On my local system testing Response.Redirect("") I get something like this: "res://ieframe.dll/dnserror.htm#http://localhost/test.aspx" DNSERROR! Hmmmm... interesting!
Also, consider what happens in the following situation:
http://somelanname
...in an environment where "somelanname" is the name of a resource on your local intranet... and then what happens when you try to access that URL when it doesn't exist. I think you are seeing the same thing here.

Resources