You're running into the sandbox security restrictions of the Flash
Player.

In short, to contact a remote webservice without using the proxy service
the owner of the domain hosting the service would need to place a
crossdomain.xml file in their webroot and specify your domain in the
list of domains allowed to contact it from a Flash Player.

See:

http://www.adobe.com/devnet/flash/articles/fplayer_security.html

http://www.adobe.com/devnet/flash/articles/fplayer8_security.html


This example doesn't take the fault event into account, something I
believe needs to be corrected. Modify the fault attribute of the MXML
tag <mx:WebService> to pass through the fault event to the errorCall
function:

fault="errorCall(event);"

Then modify the errorCall function to handle the event:

    private function errorCall(event:FaultEvent):void
    {
        mx.controls.Alert.show("Web service failed!" +
event.fault.faultString, "Alert Box",
                    mx.controls.Alert.OK);
    }

Make sure you remember to import the FaultEvent class too... You can do
so in the top of the <mx:Script> block:

<mx:Script>
        <![CDATA[

    import mx.rpc.events.FaultEvent;


// etc...


________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of judah
Sent: Tuesday, May 16, 2006 1:00 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Wanted - A simple WSDL example


That is an awesome link. I will use that. My problem is getting them to
work in Flex. This is really a newbie question but I don't know how to
take that information on that site and put it into Flex. I've looked at
the help, I've tried to apply it and I cannot see what I'm doing wrong.
I'm pulling out my hair (insert hair pulling emoticon here).

Here is my code:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
<http://www.adobe.com/2006/mxml> >
    <mx:WebService id="WeatherService"

wsdl="http://www.jasongaylord.com/webservices/zipcodes.asmx?wsdl"
<http://www.jasongaylord.com/webservices/zipcodes.asmx?wsdl>
        result="successfulCall();"  fault="errorCall();"
        useProxy="false">
         
        <mx:operation name="ZipCodeToDetails">
            <mx:request>
                <ZipCode>{zipCode.text}</ZipCode>
            </mx:request>
        </mx:operation>
    </mx:WebService>
  
    <mx:Script>
        <![CDATA[
            private function processValues():void {
                //mx.controls.Alert.show("Sending data!", "Alert Box",
mx.controls.Alert.OK);
                // Check to see if ZIP code is valid.
                WeatherService.GetWeather.send();
            }
  
            private function successfulCall():void         {
            mx.controls.Alert.show("Web service sucessful!", "Alert
Box", mx.controls.Alert.OK);
                vs1.selectedIndex=1;
            }
  
            private function errorCall():void         {
                mx.controls.Alert.show("Web service failed!", "Alert
Box",
                    mx.controls.Alert.OK);
            }
        ]]>
    </mx:Script>

<mx:ViewStack id="vs1">
    <mx:Form>
        <mx:FormItem label="Zip Code">
            <mx:TextInput id="zipCode" width="200" text="50613"/>
            <mx:Button width="60" label="Submit"
click="processValues();"/>
        </mx:FormItem>
    </mx:Form>

    <mx:VBox>
        <mx:TextArea
text="{WeatherService.GetWeather.result.CityShortName}"/>
        <mx:TextArea
text="{WeatherService.GetWeather.result.CurrentTemp}"/>
    </mx:VBox>
</mx:ViewStack>
</mx:Application>


John C. Bland II wrote:

      Anytime I need to look at or test a wsdl I always go to
xmethods.net
<http://www.xmethods.net/ve2/Directory.po;jsessionid=T3ODF8jMNTL3E7xnYCB
gxMEF%28QHyMHiRM%29> .
     
     
      On 5/15/06, judah <[EMAIL PROTECTED]> wrote:

            I am looking for an super simple working example of an
WSDL. I tried to
            get the one in the help files working and I get no
response success or
            fail. I've spent a day working on this and found out the
wsdl url is
            fake and found plenty of other WSDLs online, looked at
the xml but get
            fail response on all of them.
           
            heres the article in the help file i'm looking at:
     
http://livedocs.macromedia.com/labs/1/flex20beta3/wwhelp/wwhimpl/common/
html/wwhelp.htm?context=LiveDocs_Parts&file=00000700.html
<http://livedocs.macromedia.com/labs/1/flex20beta3/wwhelp/wwhimpl/common
/html/wwhelp.htm?context=LiveDocs_Parts&file=00000700.html>
           
           
            Judah
           
            --
            "Always bear in mind that your own resolution to succeed
is more important than any one thing."
           
            "You can have anything you want - if you want it badly
enough. You can be anything you want to be, do anything you set out to
accomplish if you hold to that desire with singleness of purpose."
           
            - Abraham Lincoln
           
           
           
            --
            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


            *      Visit your group "flexcoders
<http://groups.yahoo.com/group/flexcoders> " on the web.
                   
            *      To unsubscribe from this group, send an email
to:
                    [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
                   
            *      Your use of Yahoo! Groups is subject to the
Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/>  .


________________________________




      --
      John C. Bland II
      "I do what I can do when I can do it." - Chris Tucker, Money
Talks
     
      http://www.gotoandstop.org <http://www.gotoandstop.org> - Home
of FMUG.az



--
"Always bear in mind that your own resolution to succeed is more
important than any one thing."

"You can have anything you want - if you want it badly enough. You can
be anything you want to be, do anything you set out to accomplish if you
hold to that desire with singleness of purpose."

- Abraham Lincoln


--
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


      *      Visit your group "flexcoders
<http://groups.yahoo.com/group/flexcoders> " on the web.
       
*      To unsubscribe from this group, send an email to:
      [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
       
*      Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> .


________________________________




--
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




Reply via email to