View Full Version : Basic Web Service Connector help..

06-16-2004, 12:18 PM
I have several web services set up for me by a cold fusion person i'm working with and I haven't managed to get to first base as far as consuming the data.

I'm trying to use the Tip Of The Day (http://www.macromedia.com/devnet/mx/flash/articles/tipoday_pt2.html) web service tutorial by Jen deHaan as an example but I'm running into a few different problems.

The first problem occurs when I'm trying to recreate the simple web service connector without using the Slide Presentation mode that's used in the tute.

There's an on(load) function that only contains some formatting, yet if I remove it and put it in a keyframe (without the on(load) part) I get what has come to be my classic error message, "Error opening URL..." and then the url of the web service. Even though this is the same url that works if the formatting is left onLoad with the slide. Here's the code straight from the tute that offends somehow when used straight on a keyframe and without the clip event:onClipEvent (load) {
//_global.__dataLogger = new mx.data.binding.Log();
this.dataHolder_dh.tipdate_str = dateFormat(new Date());
function dateFormat(dDate:Date):String {
var nYear = dDate.getFullYear();
var nMonth = dDate.getMonth()+1;
var nDay = dDate.getDate();
if (nMonth<10) {
nMonth = "0"+nMonth;
if (nDay<10) {
nDay = "0"+nDay;
return new String(nMonth+"/"+nDay+"/"+nYear);
var flash_css = new TextField.StyleSheet();
flash_css.setStyle(".text", {fontFamily:'Arial,Helvetica,sans-serif', fontSize:'11px', color:'#000000'});
flash_css.setStyle(".title", {fontFamily:'Arial,Helvetica,sans-serif', fontSize:'16px', color:'#999999', fontWeight:'bold'});
flash_css.setStyle("a", {fontFamily:'Arial,Helvetica,sans-serif', fontSize:'11px', color:'#0000FF'});
flash_css.setStyle("a:hover", {fontFamily:'Arial,Helvetica,sans-serif', fontSize:'11px', color:'#336699'});
this.tip.TipText_txt.styleSheet = flash_css;
} The other problem I'm having is a general lack of familiarity with setting up my bindings and schema, but if I could even get one array in from this web service I'd be happy to muck around with the rest of it until it played nice just by trial and error. Unfortunately, when all I get is "Error opening URL" I can't even get started.

My every attempt to consume the web services using WSCs, DataHolders, DataSets, as well as TextArea or DataGrid components for display have given me nothing but the "Error opening URL: 'http://mywebservice/wsdl'" even though the URLs hook up fine in the Web Services panel and show details and methods in the Params tab of the Component Inspector.

And yes, I've run the FlashMX 2k4 pro updater.

06-27-2004, 02:52 AM

Is there a particular reason you are using the ColdFusion scripts as Web Services? Have you considered having your guy make them ColdFusion Components (CFC), and then use Flash remoting to connect to them? The only reason I ask is because I am not a real big fan of the way Flash works with web services, and I have had nothing but good experiences with Flash remoting. Also, for the remoting, you can be connected to the CFC in only a few lines of code, and they are very easy to work with after connecting. Anyways, sorry I dont have an answer to your problem, but I just figured I would share that thought!

06-27-2004, 04:06 AM
hi j-
thx for the response.

i just swapped my cf guy for a new guy and he's an old friend so the communication was better in general. he suggested i get going with the the RemotingComponent that just got updated by macromedia a few weeks ago and i think we're seeing progress.

i'll post again for posterity when i know more later this week.

- i thought the web services were CFCs actually - i'm pretty ignorant of what's going on serverside, so forgive me if that's affecting my posts. ttiab....

06-27-2004, 04:29 AM
Yes, you are right. Most cases they are CFC's, but they have been defined in ColdFusion admin as Web Services. Not really sure what the differences are because my experience falls on the Flash end of the spectrum. But as far as I know, they are pretty much the same except for a few lines of code, and how they are defined. The major difference is how Flash interacts with them. Anyways, keep us posted on how it all works out!