The ampersand is causing a problem. Try doing & in the url string instead in your MXML. If you do it programmatically in a Script block you'll need to have a CDATA block in there.
<mx:Script> <![[CDATA ]]> </mx:Script> Matt -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Raheen M Shabbazz Sent: Sunday, January 22, 2006 1:02 PM To: [email protected] Subject: [flexcoders] Re: HTTPService -- Generic error code Thanks for all your continued help. The service returns the image itself and, based on your recommendation, I have been trying to simply set the source of the image to the URL of the service. When I do this, however, very strange things begin to happen. In the validator, I get an XML error for any variable past the first encoded variable in the URL string. So, for example, if I try to set the source to "http://www.mydomain.com/services?var1=val1&var2=val2&var3=val3", I will get validaton errors for var2 and var3 that say "undetermined entity reference [XML]" and "entry Var2 was not found [XML]". If I ignore these errors and run the app, I get the following error: "The reference to entity "var2" must end with the ';' delimiter." Is there a proper way to embed these parameters into the URL that I'm missing? I even tried to build a URL string and programmatically set the image source to the URL string -- but that gave me the same errors as well. Thanks again! --- In [email protected], "Matt Chotin" <[EMAIL PROTECTED]> wrote: > > Wait, does the service return the image itself or does it return a url > to the image? If it returns the image itself you need to set the Image > source to > http://www.mydomain.com/services/restsvc?param1=val1¶m2=val2¶m3= > val3 and forget the HTTPService (though if you don't have > crossdomain.xml on that server (mydomain.com) you may not be able to > download the image). If the restsvc returns the string with the url > then you want to set resultFormat="text" and then you can use the result > as the source to the image like you're doing now. If it returns XML > that can be parsed then you'll want to have resultFormat="object" and > you'll pick the right child node. > > Matt > > > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of Raheen M Shabbazz > Sent: Saturday, January 21, 2006 11:48 PM > To: [email protected] > Subject: [flexcoders] Re: HTTPService -- Generic error code > > Thanks for the reply. > > I am using v1.5. I don't believe that I am using any proxy at all. > > This is the REST service that I have created :: > > ======================== > <mx:HTTPService id="my_rest_ws" > url="http://www.mydomain.com/services/restsvc" method="GET"> > > <mx:request> > <param1>val1</param1> > <param2>val2</param2> > <param3>val3</param3> > </mx:request> > </mx:HTTPService> > ========================= > > Below, I've got two simple controls :: > > ========================= > <mx:Canvas width="550" height="400"> > > <mx:Image source="{my_rest_ws.result}" width="400" height="400" /> > <mx:Button label="Button" click="my_rest_ws.send()"/> > > </mx:Canvas> > ========================= > > > The idea is to hit the button and have the mx:image dynamically load > the image returned from call to the web service. The web service > exists on a production server (a system completely seperate from my > development machine and entirely out of my control). If I manually > type the service URL with parameters into the address bar, I get the > image that I expect. So, for example > http://www.mydomain.com/services/restsvc?param1=val1¶m2=val2¶m3= > val3 > returns the image with no trouble. When trying the web service code > above, however, I get the generic error mentioned before -- "Could Not > Retrieve Data". (NOTE -- I thought that the problem may be with the > mx:image tag loading the results, but the error remains even when I > remove the mx:image tag altogether.) > > In the flex-config.xml file, I changed the HTTPServices section to > read <url>http://*</url> That fixed the error I was getting before > which said (paraphrased) that the URL was not legal and needed to be > added to the allow list. > > I'm not sure about your crossdomain.xml question? > > I'm guessing the problem lies with either my code or my Flex settings > as I believe the server gets hit with a number of service requests on > a regular basis and can accomodate a wide variety of flavors and > implementations. > > I'm totally stumped. For a simple example, it sure is giving me a run > for my money! Been tinkering with it all night! I just keep getting > that same generic and uninformative error. > > > > > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.com > Yahoo! Groups Links > -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

