I can't speak to 2.0, but in 1.5 there is a very hard division between
Flex and the middle tier.  Only mxml and actionscript are native to
Flex, which is primarily a client-side presentation technology.  The
ONLY way to communicate with the server is via RemoteObject, WebService
or HTTPService (and maybe XMLSockets).

Tracy

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Robert Thompson
Sent: Sunday, October 16, 2005 2:51 AM
To: [email protected]
Subject: RE: [flexcoders] ASP Shopping Cart Example

Thanks Abdul.  So the <valid>...</valid> returned by
the login.asp page, how is that then interpreted by
MXML?

I guess maybe I'm missing something as I was reading
some docs about Zorn/FlexBuilder 2, and I was under
the impression that ColdFusion, JSP, ASP, etc. are all
treated under the same mechanism/protocol, but from
what you've said, it seems that only ColdFusion and
MXML are the native technologies, and that ASP, JSP
etc. are treated as secondaries (unequals having to
use  HTTPService).  I hope not as I love Macromedia
products but have always frowned on some pricing
schemes and perhaps just a little too tad of
favoritism to a less open model (but on fewer
occasions that people like MS at least; but still...).

-r

--- Abdul Qabiz <[EMAIL PROTECTED]> wrote:

> Hi Robert,
> 
> You can use HTTPService in Flex/MXML to communicate
> with server-side
> scripts(ASP.Net f.ex.) using standard HTTP GET/POST
> way.
> 
> Following example is a simple login form which send
> userid and password
> to a server-side script:
> 
> ##HTTPServiceExample.mxml##
> 
> <mx:Application
> xmlns:mx="http://www.macromedia.com/2003/mxml";>
>       <mx:Script>
>               <![CDATA[
>                   import mx.controls.*;
>                   
>                       
>                       private function doLogin()
>                       {
>                               loginService.send();
>                               
>                       }
>                       
>                       private function loginService_result(result)
>                       {
>                           if(result.valid == true)
>                           {
>                       Alert.show("Login Successfull");
>                   }
>                   else
>                   {
>                       Alert.show("Login Failed");
>                   
>                   }
>                       }
>               ]]>
>       </mx:Script>
>       <mx:HTTPService id="loginService"
> url="http://localhost/login.asp"; method="POST"
> result="loginService_result(event)"
> fault="Alert.show('some error
> occurred');">
>           <mx:request>
>               <userid>{userid.text}</userid>
>               <password>{password.text}</password>
>           </mx:request>
>       </mx:HTTPService>
>       <mx:Form>
>               <mx:FormItem label="Username">
>                       <mx:TextInput id="userid"/>
>               </mx:FormItem>
>               <mx:FormItem label="Password">
>                       <mx:TextInput id="password" password="true"/>
>               </mx:FormItem>
>               <mx:FormItem>
>                   <mx:Button label="Login" click="doLogin()"/>
>               </mx:FormItem>
>       </mx:Form>
> 
> </mx:Application> 
> 
> 
> ##login.asp##
> 
> <[EMAIL PROTECTED]"JAVASCRIPT" %>
> <%
>     Response.ContentType = "text/xml";
>     
> 
>     var userid = String(Request.Form("userid"));
>     var password = String(Request.Form("password"));
>     var flag = false;
>     
>     if(userid=="guest" && password=="guest")
>     {
>         flag = true;
>     }
>     
> %>
> 
> <valid>
>     <%String(flag)%>
> </valid>
>     
> 
> 
> Note: code not tested, there might be mistakes in
> ASP code, but for
> example I think this is sufficient. There are other
> ways of using
> HTTPService, where in you can pass parameter object
> in
> HTTPService.send(..) instead of static binding.
> 
> Hope that helps...
> 
> -abdul
> -----Original Message-----
> From: [email protected]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Robert Thompson
> Sent: Saturday, October 15, 2005 8:32 PM
> To: [email protected]
> Subject: Re: [flexcoders] ASP Shopping Cart Example
> 
> Thanks Manish, but what do you mean by "HTTP
> Service"
> -- is that an example somewhere?
> 
> Or is there something I can do with the HTTP
> protocol
> to use ASP as the business tier / Flex as the
> Presentation Tier, instead of Cold Fusion as the
> business tier?
> 
> -r
> 
> --- Manish Jethani <[EMAIL PROTECTED]> wrote:
> 
> > On 10/15/05, Robert Thompson
> > <[EMAIL PROTECTED]> wrote:
> > 
> > > I have a project coming up that has a
> requirement
> > to
> > > use ASP instead of ColdFusion (yeah, i know :)
> and
> > I'm
> > > looking for any examples of using MXML and ASP
> as
> > the
> > > business tier which uses SQL Server 2005.
> > 
> > You should look into HTTPService.
> > 
> 
> 
> 
>               
> __________________________________ 
> Start your day with Yahoo! - Make it your home page!
> 
> http://www.yahoo.com/r/hs
> 
> 
> 
> --
> 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
> 
> 
> 
>  
> 
> 
> 
> 
> 



        
                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com



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



 








------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

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



Reply via email to