[flexcoders] Re: How to write Flex proxy without data server access and FDS
Mark, Thanks again for your suggestion. Here's what I've got now: I've generated a proxy script (in both .NET and C#) based on wsdl file. The proxy script resides on the same server (IIS) as my SWF file. Now, how do I invoke my proxy script from MXML file? Just out of silliness, I've tried mx:WebService, and wsdl=myProxyScript useProxy=true (also tried useProxy=false) ... This gave me the HTTP request error. I know I should really invoke the web method on proxy script, but I guess I'm just so dumb, that I can't figure it out. Please help! Thanks, /Roman --- In flexcoders@yahoogroups.com, Mark Shepherd [EMAIL PROTECTED] wrote: Your choices are: 1. put a crossdomain file on the server that provides the webservice 2. put a proxy script on the server that is hosting the SWF 3. put a proxy script on ANY server ANYWHERE, provided it has a crossdomain file 4. use FDS proxying on the server that is hosting the SWF From your comments, #1 and #4 are not available options. It's not clear from your comments whether #2 is possible. So do #2 if you have access to the server hosting the SWF, or #3 otherwise. By Proxy Script, I mean a very simple webservice (REST is OK) that receives requests from Flash and relays them on to the desired target webservice. This is something you can easily create in Cold Fusion, PHP, or most any server-side scripting language. This is a very basic analysis; if you have security, performance, or capacity issues then my suggestions might not be suitable. There may be other options as well, anyone have any other ideas? Mark Shepherd http://mark-shepherd.com --- In flexcoders@yahoogroups.com, rzilist rzilist@ wrote: Hi folks, I'm consuming a webservice from secured domain which has no crossdomain.xml file found at server root. It works locally, but I get the Security error accessing url message when swf file gets deployed to IIS server. As far as I know I either need a proxy process on the server hosting a webservice (which I have no access to), or have the proxy-config.xml on FDS (which I also don't have). Is there a way around it? Please help. Thanks, Roman
[flexcoders] Re: How to use Proxy script with Flex WebService?
Peter, Thank you for your post. I've tried your suggestion, but getting the HTTP request error every time I invoke the Proxy. I'm not sure I'm doing it right, but I have the .NET proxy script sitting on the same server my .swf file is. Now, in my .mxml, inside mx:WebService, I set the wsdl=myProxyFile. This results in the above mentioned HTTP error. I see my webservice methods defined inside proxy script, but I don't know how to invoke it from MXML file. I'll probably have to publish it in a new post. Thanks, Roman --- In flexcoders@yahoogroups.com, Peter Farland [EMAIL PROTECTED] wrote: If you set useProxy=true WebService will generated an HTTPRequestMessage as it is expecting to communicate with the FDS ProxyService which runs on a messaging backbone. The format of the message depends on the ChannelSet assigned to the WebService (or the defaults set for the DefaultHTTPS destination for secure URLs in services-config.xml). Instead of trying to deserialize an HTTPRequestMessage I think you should leave useProxy=false (the default, btw) and just set the URL to your own custom proxy. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of rzilist Sent: Friday, March 23, 2007 4:46 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] How to use Proxy script with Flex WebService? Hi folks, I'm consuming a webservice from secured domain which with no crossdomain.xml file at server root. To get around the Security error accessing url message, and as the only feasible solution, I wrote a proxy script in .NET and uploaded to the IIS server hosting the swf. Now, when I try to use the proxy script specifying useProxy=true I get an error saying File Not Found. How would I go about invoking my proxy script? I've tried the same way I do with Webservice, but all in vain. Please help. Thanks, Roman
[flexcoders] Re: How to use Proxy script with Flex WebService?
Peter, Thanks for your reply. I've tried the suggested way of invoking webservice thru proxy, but it didn't work. I'm getting the same error: HTTP Request error. Btw, I set useProxy=false since I'm not using FDS. You're abs right, and my SWF file resides on the same domain (IIS server) as my proxy script (I have both JS and C#-dll proxies). The webservice resides on another server (no crossdomain.xml) to which I obviously don't have access. Based on my Java experience, I just need to instantiate the class declared inside the proxy script, then call a web method passing parameters, but I'm not sure how to do it in Flex. Thanks, /Roman --- In flexcoders@yahoogroups.com, Peter Farland [EMAIL PROTECTED] wrote: I thought you would do something like this: mx:WebService id=ws wsdl=http://mydotnetserver/myapplication/myproxy.asmx? url=/some_encoded_ url_to_your_wsdl result=handleResult(event) fault=handleFault(event) / If you SWF is not served from http://mydotnetserver/ then you will need a crossdomain.xml file on the dotnet server to set policies to allow your SWF from the other domain to contact it directly (...and I'm assuming that you're trying to use a .NET proxy in the first place because this is a third party web service and you can't get them to put a crossdomain.xml file on that server). The SOAP address location (usually defined at the bottom of your WSDL in the port section of the service) will also need to be changed so that it goes through your proxy. Pete From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of rzilist Sent: Wednesday, March 28, 2007 11:50 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: How to use Proxy script with Flex WebService? Peter, Thank you for your post. I've tried your suggestion, but getting the HTTP request error every time I invoke the Proxy. I'm not sure I'm doing it right, but I have the .NET proxy script sitting on the same server my .swf file is. Now, in my .mxml, inside mx:WebService, I set the wsdl=myProxyFile. This results in the above mentioned HTTP error. I see my webservice methods defined inside proxy script, but I don't know how to invoke it from MXML file. I'll probably have to publish it in a new post. Thanks, Roman --- In flexcoders@yahoogroups.com mailto:flexcoders% 40yahoogroups.com , Peter Farland pfarland@ wrote: If you set useProxy=true WebService will generated an HTTPRequestMessage as it is expecting to communicate with the FDS ProxyService which runs on a messaging backbone. The format of the message depends on the ChannelSet assigned to the WebService (or the defaults set for the DefaultHTTPS destination for secure URLs in services-config.xml). Instead of trying to deserialize an HTTPRequestMessage I think you should leave useProxy=false (the default, btw) and just set the URL to your own custom proxy. From: flexcoders@yahoogroups.com mailto:flexcoders% 40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders% 40yahoogroups.com ] On Behalf Of rzilist Sent: Friday, March 23, 2007 4:46 PM To: flexcoders@yahoogroups.com mailto:flexcoders% 40yahoogroups.com Subject: [flexcoders] How to use Proxy script with Flex WebService? Hi folks, I'm consuming a webservice from secured domain which with no crossdomain.xml file at server root. To get around the Security error accessing url message, and as the only feasible solution, I wrote a proxy script in .NET and uploaded to the IIS server hosting the swf. Now, when I try to use the proxy script specifying useProxy=true I get an error saying File Not Found. How would I go about invoking my proxy script? I've tried the same way I do with Webservice, but all in vain. Please help. Thanks, Roman
[flexcoders] How to invoke WebService via Proxy script?
Hi folks, I'm consuming webservice from a server with no crossdomain file. So, I've generated a proxy script based on wsdl file. The proxy script resides on the same server as my SWF file (I have no access to the data server, and FDS is not an option). Now, in my MXML file, I have mx:WebService, and wsdl=myProxyScript useProxy=false ... define my operation, etc. When I run it, I get the HTTP request error. I know I probably don't do it right, but I'm not sure how else I invoke a proxy script that talks to WebService. I see all the web methods inside proxy script, but I guess I'm just so dumb, that I can't figure it out. Please help! Thanks, /Roman
[flexcoders] Re: How to use Proxy script with Flex WebService?
Osvaldo, Thank you for your post. Unfortunately, your suggestion only works when invoking HTTPService, not WebService. In other words, those proxy samples (php, asp, jsp, etc) I've downloaded from Adobe (http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_16520) cannot handle a WebService call. I was getting either Runtime errors, or errors sending HTTPRequest. It all made sense to me after reading this article: http://www.adobe.com/devnet/flash/articles/flmxpro_webservices_05.htm l. If you read the WHOLE article, it'll tell you what other pieces you need to write a generic Flex proxy script (nusoap.php, Serializer.as, etc) to invoke a webservice from a domain with no crossdomain.xml. I'll post my notes once I get my webservice running. Regards, Roman --- In flexcoders@yahoogroups.com, Osvaldo Aufiero [EMAIL PROTECTED] wrote: Roman, have you read http://livedocs.adobe.com/flex/201/langref/mx/rpc/http/mxml/HTTPServi ce.html? (that link explains the difference between setting useProxy to true or to false) I had the same situation and I solved it using a proxy.php (downloaded from Adobe) with the final url (the one without crossdomain.xml) hardcoded in it. While instanciating the HTTPService I set the url to the proxy.php location. It works great that way Hope it helps Osvaldo On 3/23/07, Peter Farland [EMAIL PROTECTED] wrote: If you set useProxy=true WebService will generated an HTTPRequestMessage as it is expecting to communicate with the FDS ProxyService which runs on a messaging backbone. The format of the message depends on the ChannelSet assigned to the WebService (or the defaults set for the DefaultHTTPS destination for secure URLs in services- config.xml). Instead of trying to deserialize an HTTPRequestMessage I think you should leave useProxy=false (the default, btw) and just set the URL to your own custom proxy. -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *rzilist *Sent:* Friday, March 23, 2007 4:46 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] How to use Proxy script with Flex WebService? Hi folks, I'm consuming a webservice from secured domain which with no crossdomain.xml file at server root. To get around the Security error accessing url message, and as the only feasible solution, I wrote a proxy script in .NET and uploaded to the IIS server hosting the swf. Now, when I try to use the proxy script specifying useProxy=true I get an error saying File Not Found. How would I go about invoking my proxy script? I've tried the same way I do with Webservice, but all in vain. Please help. Thanks, Roman
[flexcoders] Re: How to write Flex proxy without data server access and FDS
Mark, Thank you for your suggestion. The only feasible option for me would be to write the Proxy script and put it on the same server that hosts swf file (I do have access to that). I'll have to check whether client's IIS server has Cold Fusion or PHP support ... otherwise, my options would be Microsoft scripts (C#, .NET). Btw, do you know of any Proxy script examples on the web? Thanks, Roman --- In flexcoders@yahoogroups.com, Mark Shepherd [EMAIL PROTECTED] wrote: Your choices are: 1. put a crossdomain file on the server that provides the webservice 2. put a proxy script on the server that is hosting the SWF 3. put a proxy script on ANY server ANYWHERE, provided it has a crossdomain file 4. use FDS proxying on the server that is hosting the SWF From your comments, #1 and #4 are not available options. It's not clear from your comments whether #2 is possible. So do #2 if you have access to the server hosting the SWF, or #3 otherwise. By Proxy Script, I mean a very simple webservice (REST is OK) that receives requests from Flash and relays them on to the desired target webservice. This is something you can easily create in Cold Fusion, PHP, or most any server-side scripting language. This is a very basic analysis; if you have security, performance, or capacity issues then my suggestions might not be suitable. There may be other options as well, anyone have any other ideas? Mark Shepherd http://mark-shepherd.com --- In flexcoders@yahoogroups.com, rzilist rzilist@ wrote: Hi folks, I'm consuming a webservice from secured domain which has no crossdomain.xml file found at server root. It works locally, but I get the Security error accessing url message when swf file gets deployed to IIS server. As far as I know I either need a proxy process on the server hosting a webservice (which I have no access to), or have the proxy-config.xml on FDS (which I also don't have). Is there a way around it? Please help. Thanks, Roman
[flexcoders] Re: How to change DataGridCell font color based on the cell value
Iko, Thanks a lot for your help. Works like a charm. Roman --- In flexcoders@yahoogroups.com, iko_knyphausen [EMAIL PROTECTED] wrote: small correction: the initial canvas tag should be without the forward slash...like mx:canvas ... --- In flexcoders@yahoogroups.com, iko_knyphausen iko@ wrote: You could do a cutom itemRenderer that is based on a canvas, put a label for your text (cell value) and overwrite the set data method. mx:canvas/ mx:Label id=myLabel text=/ mx:Script ![CDATA[ import mx.core.*; override public function set data(data:Object) : void { if (data != null) { super.data = data; if ( Number(data.YOURDATAFIELD) 0 ) myLabel.setStyle(color,#ff); else myLabel.clearStyle(color); myLabel.text = data.YOURDATAFIELD; } } ]] /mx:Script /mx:Canvas } --- In flexcoders@yahoogroups.com, rzilist rzilist@ wrote: Hi folks, I need to change the font color on my last DataGridColumn (not the ColumnHeader, just the cells) based on the cell value, i.e. if value in the cell is negative, change the cell font color to red. I've tried various HTMLRenderer classes, but to no avail. Please help! Thanks, Roman
[flexcoders] How to use Proxy script with Flex WebService?
Hi folks, I'm consuming a webservice from secured domain which with no crossdomain.xml file at server root. To get around the Security error accessing url message, and as the only feasible solution, I wrote a proxy script in .NET and uploaded to the IIS server hosting the swf. Now, when I try to use the proxy script specifying useProxy=true I get an error saying File Not Found. How would I go about invoking my proxy script? I've tried the same way I do with Webservice, but all in vain. Please help. Thanks, Roman
[flexcoders] How to change DataGridCell font color based on the cell value
Hi folks, I need to change the font color on my last DataGridColumn (not the ColumnHeader, just the cells) based on the cell value, i.e. if value in the cell is negative, change the cell font color to red. I've tried various HTMLRenderer classes, but to no avail. Please help! Thanks, Roman
[flexcoders] How to write Flex proxy without data server access and FDS
Hi folks, I'm consuming a webservice from secured domain which has no crossdomain.xml file found at server root. It works locally, but I get the Security error accessing url message when swf file gets deployed to IIS server. As far as I know I either need a proxy process on the server hosting a webservice (which I have no access to), or have the proxy-config.xml on FDS (which I also don't have). Is there a way around it? Please help. Thanks, Roman
[flexcoders] Security error accessing url
How to get around this error? I've written small Flex application to retrieve stock info in exchange for company symbol. I've used Eclipse with Flex plugin. Inside the app, I'm calling webservice on quote.yahoo.com website. I can load the html page which references the swf file (by either running it from within Eclipse, or by opening it in both IE and Firefox). This works fine, and I get some stock data back. However, if I try serving the page from one of my local servers, or even copying it (along with other supporting files) to other location on my hard drive, loading the same page results in an Security error accessing url from my Adobe Flash Player 9. I've even tried to use a straight HTTP post instead of a webservice call, but to no avail. Now, I know that in order to access the data on the domain other than the one my app is running on, Adobe Flash Player requires crossdomain.xml file to be on the data server root. Yahoo indeed hosts this file at http://quote.yahoo.com/crossdomain.xml, but it only has a few entries. I simply want to read company stock info from publicly exposed service, but I see no way of adding the domain name to their crossdomain file each time someone wants to read a stock info. Any help is appreciated. Roman