2 Replies Latest reply on Dec 19, 2007 10:48 AM by

    error # 1090

      Hi,

      I'm new to Flex. Running into a problem to bring back query results saved as
      xml to Flex, the odd thing is, when I tested the same output to xml (save it to an xml file),
      I find it a valid XML file, then why Flex complained about #1090 -- "1090 XML
      parser failure: element is malformed." From Flex end using HTTPService
      call/class. It gets very frustrated!

      What could be its culprit?

      Thanks.
        • 1. Re: error # 1090
          m_hartnett Level 3
          You need to post the problem code.
          • 2. Re: error # 1090
            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns="*" layout="absolute" creationComplete="customerRequest.send()">

            <!-- first define datasource: ms sql server 2000 - northwind db and what data to return -->
            <mx:HTTPService id="customerRequest" url=" http://127.0.0.1:8501/flexApp/getCustomer.cfm" useProxy="false" method="POST">
            <mx:request xmlns="">
            <companyname>{companyname.text}</companyname>
            <city>{city.text}</city>
            </mx:request>
            </mx:HTTPService>

            <!-- define page/form format, data capture layout -->
            <mx:Form x="22" y="10" width="493">
            <mx:HBox>
            <mx:Label text="Customer Name"/>
            <mx:TextInput id="companyname"/>
            </mx:HBox>
            <mx:HBox>
            <mx:Label text="City"/>
            <mx:TextInput id="city"/>
            </mx:HBox>
            <mx:Button label="Submit" click="customerRequest.send()"/>
            </mx:Form>

            <!-- display current datasets of "customers" -->
            <mx:DataGrid id="dgCustomerRequest" x="22" y="128" dataProvider="{customerRequest.lastResult.customers.customer}">
            <mx:columns>
            <mx:DataGridColumn headerText="Customer ID" dataField="customerid"/>
            <mx:DataGridColumn headerText="Customer Name" dataField="companyname"/>
            </mx:columns>
            </mx:DataGrid>
            <mx:TextInput x="22" y="292" id="selectedCusCity" text="{dgCustomerRequest.selectedItem.city}"/>

            </mx:Application>

            backend cf query is simple (getCustomer.cfm):
            ------------------------------------------------------------------
            <cfquery name="getCustomers" datasource="myNorthwindDB">
            SELECT top 2 customerid, companyname, city
            FROM customers
            </cfquery>
            <cfxml variable="customerXML">
            <customers>
            <cfloop query="getCustomers">
            <cfoutput>
            <customer>
            <customerid>#toString(customerid)#</customerid>
            <companyname>#companyname#</companyname>
            <city>#city#</city>
            </customer>
            </cfoutput>
            </cfloop>
            </customers>
            </cfxml>
            <cfoutput>#customerXML#</cfoutput>

            debugging:
            warning: unable to bind to property 'customer' on class 'String' (class is not an IEventDispatcher)

            sample data:
            <customer>
            <customerid>ABCD </customerid>
            <companyname>DataWeb</companyname>
            <city>Roanoke</city>
            </customer>

            <customer>
            <customerid>ALFKI</customerid>
            <companyname>Alfreds Futterkiste</companyname>
            <city>Berlin</city>
            </customer>

            Many thanks.