4 Replies Latest reply on Aug 9, 2006 8:46 AM by ntsiii

    Newbie Question

    ConquestDuke
      Pls, I may sound stupid but I just want to ask a simple question. How do I populate my database from Flex if I am using a .Net webservice ? And how do I also perform Queries ? Standing by
        • 1. Re: Newbie Question
          Superflu Level 1
          Flex can work with any webservice, regardless of the platform that it was written in. If you're asking how do you send a .NET object from/to Flex, that's another story, but if you want to know the basics of webservices, use the help feature inside Flex Bulder 2 and type webservice in the search field.
          • 2. Re: Newbie Question
            ConquestDuke Level 1
            yeah that would hit the point. How do I send .Net objects to flex and back ?
            • 3. Re: Newbie Question
              leotemp Level 1
              well if your are on IIS server(windows) then you could probably get away using just a simple asp script and the HTTPservice component in flex. Just wrap the result from your query in xml freindly tags:

              <products>
              <shoe>{resultData}</shoe>
              </products>

              if you dont know much about scripting or .net then i would sugest starting with simple ASP, go to sloppycode.net or something and learn the basics of creating a odbc connections and interacting with record sets. if your already familiar with javascript or action script then i recommend using javascript for your asp language rather then visual basic as its pretty messy and can be very frustrating sometimes.
              • 4. Re: Newbie Question
                ntsiii Level 3
                To add to the above:
                What is your goal?

                Does your project have any external constraints, like existing functionality you want to re-use, or a corporate policy reagarding platforms or communication protocols? Passing complex objects can be difficult.

                If you are pretty much in charge of the technical end, this is what I advise:
                * Use HTTPService as the protocol
                * Use XML for all responses from the server. Request arguments can be whatever is convenient. Use XML if you are passing complex data.
                * Use resultFormat="e4x" on the client side.
                * Use a result handler function for all data calls. Binding is hard to debug.
                * Use Dot.Net web application (aspx) on the server side.
                * Use a single aspx page as the url. Use request arguments to determine what to do.
                * The web application does not need any visual UI
                * In the aspx page, set: Response.ContentType = "text/xml"
                * In the Page_load handler, access the request argument data as needed
                * Do whatever dataqbase or file system or mail or whatever servir functionality is needed.
                * Convert as needed any data to xml. Note, SQL Server can return XML automatically.
                * Response.write the xml data back to the flex client.
                * In the client result handler function massage the data as necessary and assign it to the dataProvider property of whatever control you are using.

                Post back if you have specific questions.

                Tracy