2 Replies Latest reply on Mar 5, 2009 3:48 PM by Newsgroup_User

    How to get started with web services?

    Rachel_M_Garrett
      I've hit a rather large speedbump on my Flex learning curve. All the examples I've created and played around with use ArrayCollection data, and I really want to understand how to use live data instead, from an actual database. The books and tutorials assume you already know how to get a database up and running in mySQL or SQL Server. I've installed Wamp and I installed MS SQL Server Express 2005, but I'm still lost; none of the "Getting Started" directions tell me how to make a database. I've done plenty of databases in Access, I've even used command line options to create simple SQL databses after logging into a mySQL server, but there is nothing in SQL Server 2005 that lets you create a new database, or get to a place where you can type CREATE.

      I tried creating a database in Access, upsizing it to SQL, and putting it on the SQL Express server. It shows up there, but the database connection always fails when I try to use the Flex Builder 3 wizard to generate an ASP. NET web application.

      So my question is...if you understand conceptually what a web service is, and you have some programming experience, but haven't written one, how do you get to a point where you're using your own data in Flex? Am I taking steps in the wrong order? It seems like I should make a database, write a web service, and then use that data in Flex. Is there some simpler way to do it?

      Thanks in advance for any advice/direction on this.
        • 1. Re: How to get started with web services?
          phillipus_rex Level 1
          Purchase a copy of the Adobe Flex Bible by David Gassner. It's the all around most comprehensive way to get started with web services in Flex - without getting overly detailed for a beginner. He covers more about web services in that book that any other Flex overview that I have seen.

          You can create web services using Java, PHP, .NET, ColdFusion or just about any other web language out there. There are small variations in the way certain things are done with each language though. If you want to get started using web services without actually having to program those web services, you can look for a web services provider such as: http://www.webservicex.net/WCF/default.aspx

          There are a few tutorials out there that will teach you the basics of WSDL introspection and using basic web methods. Here's a good one to start on: http://www.adobe.com/devnet/flex/articles/flex_ws.html

          Keep in mind though, that most examples you will find online are pretty superficial and not ideal for real world applications. For example, you will more than likely find that you need secured web services when working on actual software. When you become comfortable with the basics, you should try looking up SOAP based web services and practice passing SOAP headers that will contain passwords and usernames to access data.

          Hope this gets you started.

          -Phillip
          • 2. Re: How to get started with web services?
            Level 7

            "Rachel_M_Garrett" <webforumsuser@macromedia.com> wrote in message
            news:gomtva$ban$1@forums.macromedia.com...
            > I've hit a rather large speedbump on my Flex learning curve. All the
            > examples
            > I've created and played around with use ArrayCollection data, and I really
            > want
            > to understand how to use live data instead, from an actual database. The
            > books
            > and tutorials assume you already know how to get a database up and running
            > in
            > mySQL or SQL Server. I've installed Wamp

            If you have WAMP, you should have PHPMyAdmin, which makes it very very easy
            to set up a mySQL database.

            >and I installed MS SQL Server Express
            > 2005, but I'm still lost; none of the "Getting Started" directions tell me
            > how
            > to make a database. I've done plenty of databases in Access, I've even
            > used
            > command line options to create simple SQL databses after logging into a
            > mySQL
            > server, but there is nothing in SQL Server 2005 that lets you create a new
            > database, or get to a place where you can type CREATE.

            You can use Access if you want to learn on. Or you an go into SQL Server
            Mangement Express, right click on "Databases", and select "New Database" Or
            you can create the database in a new query editor window using DDL.

            > I tried creating a database in Access, upsizing it to SQL, and putting it
            > on
            > the SQL Express server. It shows up there, but the database connection
            > always
            > fails when I try to use the Flex Builder 3 wizard to generate an ASP. NET
            > web
            > application.

            Yeah, I wouldn't trust a wizard for these things. Find a good tutorial that
            teaches you to set up a connection to a database for a web page.

            > So my question is...if you understand conceptually what a web service is,
            > and
            > you have some programming experience, but haven't written one, how do you
            > get
            > to a point where you're using your own data in Flex? Am I taking steps in
            > the
            > wrong order? It seems like I should make a database, write a web service,
            > and
            > then use that data in Flex. Is there some simpler way to do it?
            >
            > Thanks in advance for any advice/direction on this.

            There's a Lazy Loading Tree Example at flexdiary.blogspot.com that shows you
            how to do this with RemoteObject, which IMO is easier than a web service.