HTTPService using e4x

I'm trying to use HTTPService to receive xml data from a
website, using e4x, then put it in a datagrid (and do other things
with it later). I can get it to populate the datagrid using object,
but need it in xml form to use it in other places. I've tryed using
an XMLListCollection, but can't seem to get it working.
/********************* XML *******************/
<?xml version="1.0" encoding="iso-8859-1" ?>
<tool>
<projects>
<project>
<projectName>Project 1</projectName>
<active>true</active>
</project>
<project>
<projectName>Project 2</projectName>
<active>true</active>
</project>
</projects>
</tool>
/***************** This works ****************/
<mx:HTTPService id="list_request" url="myxml.xml"
showBusyCursor="true" resultFormat="object"
fault="Alert.show('Project listing could not be
retrieved!','Error');"/>
<mx:DataGrid y="0" width="508" height="291"
horizontalCenter="0"
dataProvider="{list_request.lastResult.tool.projects.project}"
id="dgProjects">
<mx:columns>
<mx:DataGridColumn headerText="Projects"
dataField="projectName"/>
</mx:columns>
</mx:DataGrid>
Thanks in advance.

Using that I get these console warnings:
warning: unable to bind to property 'projects' on class 'XML'
(class is not an IEventDispatcher)
warning: unable to bind to property 'project' on class
'XMLList' (class is not an IEventDispatcher)
Also, I can't figure out why lastResult is returning null if
I work with it in the same function list_request was called from.
public function GotoStartPage():void{
list_request.send();
// If the query contained a value for project_request...
if(Application.application.parameters.project_request!=null){
// Check to see if the query matched one of the listed
projects
project_request=Application.application.parameters.project_request;
currentState="Main Project Page";
}else{
trace(list_request.lastResult); // <-
this gives null
project_request="";
currentState="Project Selection Screen";
Is the trace statement getting called before
list_request.send() is finished getting the data?

Similar Messages

  • HTTPService of e4x sending data from an XMLListCollection?

    I'm converting an applicaton to use e4x httpservice calls to get and send variables to a PHP remote service and seems to have run into a few questions I can't find any forums posts or documentation about. Currently the application uses the object model to get data and sends and receives variables
    from the PHP scripts through a bunch of $_POST variables. When pulling stuff into the application it gets stored in an array collection so I can sort it and search it easily using cursors. Here are my questions:
    Getting stuff from an HTTPservice with a type of e4x is easy. works great. I toss it right into an XMLarraycollection and get my sorting. But sending data to the same service setup as a type of 'e4x' I can't figure out. Using the object model I could just send an object of keys and properties so sending a { key : value }, would go to the PHP file as a $_POST['key'] and I could read the value. Since httpservice of e4x enforces the need for a root XML tag, all I seem to get is a $_POST['root'], and none of the real key:value data I need. I'm clearing missing something. So how on the PHP side do I get my values if I have to send this root tag? Or in flex how to I send XMLlists instead of XML.? This has to be possible. I don't want to use a different service just to send.
    Second, and a minor thing. When I do send variables to  and httpservice of e4x from an XML arraycollection, do I just send it in key:value format, or do I need to toString() it? When it gets to the php script after the post would the variable name and value be $_POST['key']=value or $_POST[<key>']=<value>.
    Thanks in advance!  

    hi,
    have you looked at creating a new document with the root tag as parent then inserting the collection, haven't tried this with xmllistcollection but I would think the process is similar to the atraycollection conversion
    var qName:QName = new QName("root");
    var xmlDocument:XMLDocument = new XMLDocument();
    var simpleXMLEncoder:SimpleXMLEncoder = new SimpleXMLEncoder(xmlDocument);
    var xmlNode:XMLNode = simpleXMLEncoder.encodeValue(myArrayCollection.source, qName, xmlDocument);
    trace(xmlDocument.toString());
    David

  • Set "url" in HTTPService using String variable

    Hi,
    How can I set "url" in HTTPService using String variable (see below). I've tried different formats of string & variable concatenations.
    privtate var myurl:String = "http://localhost/";
        <mx:HTTPService id="post_submit_service"
            url="{myurl+'test.php'}"
            method="POST"
            resultFormat="text"
          result="result_handler(event)"
          fault="fault_handler(event)">
            <mx:request xmlns="">
          </mx:request>
        </mx:HTTPService>
    Thanks,
    ASM

    try following:
    url="{myurl}test.php"

  • Extracting XML from webservice result with Namespaces using E4X

    Hi,
    I need to extract some data from proprietary Web Service (to be fed to HierarchicalData for dataProvider of ADG).
    So I made service.returnType=’e4x’;
    In that case it returns data as XML.
    I need to get useful data from it after Snapshot:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header xmlns:msdwHdr="http://xml.msdw.com/ns/appmw/soap/1.0/header">
    <msdw:RequestID xmlns:msdw="http://xml.msdw.com/ns/appmw/soap/1.0/header">restsoap#1390182244050#197728273958044232</msdw:RequestID>
    <msdwHdr:FinalMessage>true</msdwHdr:FinalMessage>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
    <ADSSnapshotResponse xmlns="http://xml.ms.com/ns/appmw/dataserver/1.0">
    <Snapshot seqNo="0">
    <BASE_ELEMENT_NAME BASE_ELEMENT_NAME="4.11.2.0">
    Using E4X, like:
    var root:XML = event.result as XML; //good!
    var xmlRoot1:XMLList = root['SOAP-ENV:Body'].ADSSnapshotResponse.Snapshot.BASE_ELEMENT_NAME;
    it does return XMLList (tried different variants), but debugger shows nothing at all inside that XMLList.
    var root1:XMLList = root.children();  // that returns valid XMLList with 2 XML elements inside
    But all other data I could not get if I use any E4X:
    Can I skip Envelope, going to Body as one of its children?  suppose I can...
    a) root.SOAP-ENV:Body would give compilation errors because of ‘-‘, ‘:’
    b) root.Body gives blank XMLList
    c) root.Body[0] returns NULL  
    Any idea how to extract the load from ADS Response (envelope)?
    What can I do regarding XML Namespaces in E4X ?
    If I set service.returnType="xml" it returns data as XMLNode's.
    But I prefer to use E4X if possible.
    Please help!
    TIA,
    Oleg.
    P.S.: using Flex 4.5.1 with Flex3 ADG.

    not an implementable option for us and cost prohibitive.

  • HttpService resultFormat e4x v. object

    hi,
    anyone have any idea if there is any appreciable performance
    difference between using e4x format and object format?
    i'm trying to figure out which of these two formats to use
    under what circumstances and i believe that performance is one of
    the criteria to consider.
    subsequent usage intention for the structure is the next
    obvious thing to look at, but i need to start somewhere ;)
    i'm guessing object format would take more cycles to
    accomplish, but hey, what do i know...?
    thanks,
    tony.

    Use e4x.
    First, unless you are using RemoteObject, you data is
    probably XML already. resultFormat="object", the default, causes
    Flex to attempt to convert your xml into an nested object
    structure. This is a "black box" behavior. Predicting the output
    structure is difficult. This conversion also takes time.
    Second, e4x XML has huge functionality built in. You can
    search, filter the data efficiently and easily. You will have to
    write recursive functions to do that with a nested object
    structure.
    XML is easily handled in XMLList and XMLListCollection
    objects with their methods. With object you have to do it all
    yourself.
    Finally, AS is very fast. Performance is always a good thing,
    but until you are an expert on issues like when to use
    cacheAsBitmap, you will be better served focusing on UI rendereing
    performance, not machine cycles.
    Tracy

  • Possible memory leak in e4x or HTTPService with e4x format

    Hello,
    I think I have found a memory leak in e4x.
    In very special cases (=xml) the player swallows the memory.
    The little test program connects to a web server for an xml
    file, and the result is converted to an array.
    The array is displayed in a DataGrid.
    There are two files:
    leaktest.xml doesn't leak in any cases (format: e4x or xml)
    pbentries.xml leaks when the format is e4x.
    Choose e4x format and check Use "Leak" file! Than the program
    leaks.
    For the whole test case (mxml file, html file and xml files)
    please contact me at
    [email protected]
    or
    [email protected]
    and I send a zip file as soon as possible.
    Probably there is a bug in my test program. If so than please
    send me a feedback.
    Thanks,
    Lacito
    ------ For the program cut here ------
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.managers.PopUpManager;
    import mx.core.Application;
    import mx.controls.Alert;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.http.mxml.HTTPService;
    protected var records_:Array = null;
    protected var httpService:HTTPService = null;
    [Bindable("recordsChange")]
    public function set records(_records:Array):void
    this.records_ = _records;
    var e:Event = new Event("recordsChange");
    dispatchEvent(e);
    public function get records():Array
    return records_;
    protected function getXML():void
    var resultFormat:String = cbResultFormat.selectedItem as
    String;
    var params:Object = new Object();
    httpService = new HTTPService();
    httpService.concurrency = "single";
    httpService.showBusyCursor = true;
    var lastIndex:int = url.lastIndexOf("/");
    var fileName:String = null;
    if(chbUseLeakFile.selected)
    // It leaks... :(
    fileName = "pbentries.xml";
    else
    // It doesn't leak... :)
    fileName = "leaktest.xml";
    var _url:String = url.substr(0, lastIndex+1) + fileName;
    httpService.url = _url;
    httpService.resultFormat = resultFormat;
    httpService.method = "POST";
    httpService.addEventListener(ResultEvent.RESULT,
    processResult);
    httpService.addEventListener(FaultEvent.FAULT,
    processFault);
    httpService.send(params);
    protected function processResult(e:ResultEvent):void
    var resultFormat:String = cbResultFormat.selectedItem as
    String;
    removeListeners();
    if(resultFormat==mx.rpc.http.HTTPService.RESULT_FORMAT_XML)
    setArrayFromXMLNode();
    else
    setArrayFromXML();
    destroyHttpService();
    // format= "e4x"
    protected function setArrayFromXML():void
    var xml_:XML = httpService.lastResult as XML;
    var ar:Array = new Array();
    var x:XML = null;
    var xl:XMLList = xml_.phonebookEntries[0].phonebookEntry;
    for each(x in xl)
    var record:Object = new Object();
    var prop:XML = null;
    var props:XMLList = x.children();
    for each(prop in props)
    record[prop.localName()] = prop.toString();
    ar.push(record);
    records = ar;
    // format= "xml"
    protected function setArrayFromXMLNode():void
    var xml_:XMLNode = httpService.lastResult as XMLNode;
    var ar:Array = new Array();
    var x:XMLNode = null;
    var xl:Array = xml_.lastChild.childNodes;
    for each(x in xl)
    var record:Object = new Object();
    var prop:XMLNode = null;
    var props:Array = x.childNodes;
    for each(prop in props)
    record[prop.localName] = prop.firstChild!=null ?
    prop.firstChild.nodeValue : null;
    ar.push(record);
    records = ar;
    protected function destroyHttpService():void
    httpService.clearResult(false);
    httpService.disconnect();
    httpService = null;
    protected function processFault(e:FaultEvent):void
    removeListeners();
    Alert.show(e.fault.faultString, e.fault.faultCode);
    destroyHttpService();
    protected function removeListeners():void
    httpService.removeEventListener(ResultEvent.RESULT,
    processResult);
    httpService.removeEventListener(FaultEvent.FAULT,
    processFault);
    protected function collect():void
    // Garbage Collection
    try
    new LocalConnection().connect('foo');
    new LocalConnection().connect('foo');
    catch(e:*)
    ]]>
    </mx:Script>
    <mx:ArrayCollection id="alRecords" source="{records}"
    />
    <mx:Label x="10" y="10" text="Result format:"
    id="lResultFormat"/>
    <mx:ComboBox x="104" y="8" id="cbResultFormat">
    <mx:Array>
    <mx:String>e4x</mx:String>
    <mx:String>xml</mx:String>
    </mx:Array>
    </mx:ComboBox>
    <mx:DataGrid id="dgRecords" x="10" y="36" width="936"
    height="437"
    dataProvider="{alRecords}"
    verticalScrollPolicy="auto"
    horizontalScrollPolicy="auto">
    </mx:DataGrid>
    <mx:Button x="355" y="496" label="Get xml" id="btnGetXML"
    click="{getXML();}" />
    <mx:Button x="155" y="496" label="GC" id="btnGC"
    click="{collect();}" />
    <mx:CheckBox x="276" y="10" label="Use
    &quot;LEAK&quot; file:" labelPlacement="left"
    id="chbUseLeakFile" selected="true"/>
    </mx:Application>

    Hello,
    After 3 months (and a new version of flex and flash player)
    my test program is still leaking.
    If somebody could confirm the leak it would be appreciated.
    Thanks,
    Lacito
    P.S.: I heard that Adobe had donated ActionScript 3 VM to
    Mozilla.org. Should I disturb them with my problem?

  • Using E4X issue

    Hello,
    What I am trying to do is to show an Alert depending on if a
    certain attribute exists within my xml. I am getting the Alert to
    show up, but it is showing up for each selection I make in my
    comboBox(which shows formats from the xml) even though the
    attribute exists in only one of the nodes. Any ideas? Below is the
    code I have and the xml.
    MXML & ACTIONSCRIPT I'M USING:
    <mx:HTTPService id="formatData"
    url="../assets/formats.xml" resultFormat="e4x"/>
    <mx:Script>
    <![CDATA[
    import mx.collections.*;
    import mx.rpc.events.*;
    import mx.controls.Alert;
    private function example(event:Event):void {
    var materialNodes = formatData.lastResult.format.material;
    if (materialNodes.(hasOwnProperty("@name") && @name
    == length())) {
    Alert.show("hello");
    ]]>
    </mx:Script>
    <mx:ComboBox width="120"
    dataProvider="{formatData.lastResult.format.@id}"
    id="formatComboBox" change="example(event)"/>
    THE XML I'M USING:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <formats>
    <format id = "None" image = "images/image_icon.gif">
    </format>
    <format id = "Format 1" image =
    "images/format1_icon.gif">
    <material name = "materials">None</material>
    <material>Material 1</material>
    <material>Material 2</material>
    <material>Material 3</material>
    <material>Material 4</material>
    </format>
    <format id = "Format 2" image =
    "images/format2_icon.gif">
    </format>
    <format id = "Format 3" image =
    "images/format3_icon.gif">
    </format>
    <format id = "Format 4" image =
    "images/format4_icon.gif">
    </format>
    </formats>
    P.S. I have been told that I am 'querying' the materialNodes
    variable that has data from the service, rather than the
    currentTarget of the comboBox change event. And to first try
    tracing out event.currentTarget and see what you get out. I added
    the event.currentTarget trace statement to the example function and
    this is what I got back.
    ImprintUserInterface1_0.VBox4.formatsSelect29.VBox30.Canvas36.formatsVBox.formatComboBox
    It seems it's just the path to the comboBox. I must be
    referencing the event.currentTarget wrong.
    Any suggestions would be appreciated.

    Hey Tracy,
    Figured it out. Below is what I ended up using with the help
    from a co-worker. Thank you for your reply.
    private function example():void {
    var myXML:XML = new XML(formatData.lastResult);
    var strFormat:String = formatComboBox.selectedLabel;
    var materialList:XMLList = myXML.format.(@id ==
    strFormat).material;
    if (materialList.length() > 0) {
    Alert.show("hello");

  • HTTPService - using FlashVars for URL?

    Hi,
    New Flex user, so please forgive me if this sounds stupid.
    I'm fiddling around with a modified version of the dashboard sample
    application, and am using the FlashVars param tag to pass in a
    bunch of variables into the application. They all work fine, except
    the variable I'm using for the URL in HTTPService, which is the
    name of an XML file that another application I've written has
    generated. It returns this error:
    [RPC Fault faultString="A URL must be specified with useProxy
    set to false." faultCode="Client.URLRequired" faultDetail="null"]
    at mx.rpc.http::HTTPService/send()
    at mx.rpc.http.mxml::HTTPService/send()
    at dashboard/::initApp()
    at dashboard/___Application1_creationComplete()
    at
    flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/set initialized()
    at mx.managers::LayoutManager/::doPhasedInstantiation()
    at Function/
    http://adobe.com/AS3/2006/builtin::apply()
    at mx.core::UIComponent/::callLaterDispatcher2()
    at mx.core::UIComponent/::callLaterDispatcher()
    But I'm absolutely positive the URL value is correct. I've
    tested and displayed the value that comes through, and when I
    manually paste that value into the URL, it works fine. Tried
    relative and absolute URLs, tried just passing the partial filename
    through (so the FlashVars variable just has alphanumeric
    characters) and hard-coding the rest of the URL. Same result.
    Does HTTPservice just not allow this value to be passed via
    FlashVars, or is there something I'm completely missing (maybe I
    need to convert the value somehow)? Or, is there another solution
    to this problem?
    Thanks, in advance.

    How are you asigning the url value to the HTTPService
    property? Binding or via actionscript?
    Tracy

  • URL Loader / HTTPService using ASPX calls

    I would like to know if someone could help me or point me in the right direction … here is a test site and source view (https://studentdb.projectcadd.org/test.html) of what I am trying to do (all I want is a guarantee that the XML generated from ASPX will go to the correct dropdown 100% of the time.
    As you will see on this test site, the ASPX will go to whatever dropdown it wants, but those read from stactic XML files read correctly into the proper dropdown.
    The first set of 3 are read from SQL thru ASPX files using URLLoader, and the next 3 are read from static XML files, using URLLoader, the final 3 are using HTTPService  calls … the single dropdown above the final 3 is reading an XML file also. The URLLoaders reading XML are 100%, the others may come up correctly the 1st time, but if I refresh or recall the page the setup is not correct!! I am using a random number in the querystring but that doesn’t work either – handle any cashe problems!!! (all sets should have the same pattern in them – 1st classnumber, then course numbers, then paygrades).
    thanks, rehoover

    hi,
       you need to explicitly call MyHTTPService.send() from actionScript httpService dosent sends Data automatically and also at dataProvider="{ChatXML.root.object}" you will need to ommit parentNode in XMl ->dataProvider="{ChatXML.object}"

  • How to use e4x to extract complex data like this ?

    The xml object structure like the following :
    <TEXTFORMAT LEADING="2">
        <P ALIGN="LEFT">
            <FONT FACE="Verdana" SIZE="16" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">
               First Item
                          <FONT SIZE="10">
                         Second Item
                          </FONT>
            </FONT>
        </P>
    </TEXTFORMAT>
    this is the htmltext from richTextEditor , I want every font size = 16 value to be a tree label .
    So my question is : how can I extract "First Item "? I Know it's easy to exract the "second Item" , like P.FONT.FONT ,
    BUT , I use P.FONT, instead of get "First Item" I get  :
    <FONT FACE="Verdana" SIZE="16" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">
               First Item
                          <FONT SIZE="10">
                         Second Item
                          </FONT>
            </FONT>
    I only want to extract "First Item" out of this XML block , Any Ideas ?

    Flex harUI I love you ! I've been thinking this problem for a whole morning . You saved my time ! Thank you !

  • Using HTTPService to import data from a XML file

    Hello there!
    I'm having some problem's with this import... If anyone can
    help, I would appreciate it!
    I'm using this type of information as data source:
    public var dataCollection:ArrayCollection =
    new ArrayCollection([
    { id: "P1", name: "Porto", type: "team", children: [
    { id: "R1", name: "Dr Silva", location: "Bloco 1", type:
    "member" },
    { id: "R2", name: "Dra Neto", location: "Gabinete", type:
    "member"
    { id: "P2", name: "Braga", type: "team", children: [
    { id: "R3", name: "Dr Santos", location: "Bloco 2", type:
    "member" },
    { id: "R4", name: "Dra Sonia", location: "Piso 1", type:
    "member"
    But I want to import it from a XML file like this:
    <?xml version="1.0" encoding="utf-8"?>
    <items>
    <item id="P1" name="Porto" type="team">
    <children id="R1" name="Dr Silva" location="Bloco 1"
    type="member" />
    <children id="R2" name="Dra Neto" location="Gabinete"
    type="member" />
    </item>
    <item id="P2" name="Braga" type="team">
    <children id="R3" name="Dr Santos" location="Bloco 2"
    type="member" />
    <children id="R4" name="Dra Sonia" location="Piso 1"
    type="member" />
    </item>
    </items>
    I already import the file, but can not translate the data
    into a array collection.
    private function initApp():void {
    var httpService:HTTPService = new HTTPService();
    httpService.url = "dataprovider.xml";
    httpService.resultFormat = "e4x";
    httpService.addEventListener(FaultEvent.FAULT,
    onFaultHttpService);
    httpService.addEventListener(ResultEvent.RESULT,
    onResultHttpService);
    httpService.send();
    private function onFaultHttpService(e:FaultEvent):void
    Alert.show("Error reading data file.");
    private function onResultHttpService(e:ResultEvent):void
    //Convert the xml data to a array collection
    Thank you

    Hello Peter, and thank you for your reply's.
    My problem is that I'm receiving the data from the external
    file and I don't know how to get the children in place... I mean, I
    also have some data being received form a file that I can convert
    into an array collection, but the thing is, that file doesn't have
    children structure...
    It's something like this:
    <?xml version="1.0" encoding="utf-8"?>
    <items>
    <item id="T1" resourceId="R1" name="Cardiologia"
    startTime="25-3-09 8:0:0" endTime="25-3-09 8:30:0" />
    <item id="T2" resourceId="R2" name="Raio-X"
    startTime="25-3-09 9:0:0" endTime="25-3-09 9:15:0" />
    <item id="T3" resourceId="R3" name="Analises"
    startTime="25-3-09 12:0:0" endTime="25-3-09 12:45:0" />
    <item id="T4" resourceId="R4" name="Consulta"
    startTime="26-3-09 8:0:0" endTime="26-3-09 9:0:0" />
    </items>
    And I solve it with this (don't know if is the best):
    private function onResultHttpServiceTask(e:ResultEvent):void
    var a:Array = xmlListToObjectArray(e.result.item);
    tasks = new ArrayCollection(a);
    protected function
    xmlListToObjectArray(xmlList:XMLList):Array
    var a:Array = new Array();
    for each(var xml:XML in xmlList)
    var attributes:XMLList = xml.attributes();
    var o:Object = new Object();
    for each (var attribute:XML in attributes)
    var nodeName:String = attribute.name().toString();
    var value:*;
    value = attribute.toString();
    o[nodeName] = value;
    a.push(new ObjectProxy(o));
    return a;
    But when the children "enter in action" I don't know how to
    bring them to the array...
    This code you send it's preaty much the thing I need, but the
    thing is that I don't know how to call the children with data as
    e:ResultEvent...
    If you can help a bit more, I would really appreciate...
    Thank You

  • Code samples for using HTTPServices in Cairngorm framework

    Hello there,
    Does anyone have any samples for retrieving data through
    HTTPServices using the cairngorm framework model. All samples on
    the web, as far as I have searched, lead only to remote services
    mode of communication only.
    Any help here would be greatly appreciated.
    Thanks,
    Arun B
    [email protected]

    I wrote a sample code modifiying the Remote Object examples
    .. I got this working now . Please ignore this message, just incase
    anyone needs my sample just email me..

  • HTTPService: How can I send a variable or call a function in it?

    Ok i have the following HTTPService request:
    <mx:HTTPService id="userRequest" url="
    http://mywebsite/get_data.php"
    useProxy="false" method="POST">
    <mx:request xmlns="">
    <user1>{username.text}</user1>
    </mx:request>
    </mx:HTTPService>
    Pretty straight forward stuff there. EXCEPT... i want to use
    a variable instead of 'username.text...
    <user1>{UserNameList[0]}</user1>
    OR i want to be able to call a function that will return the
    results such as:
    <user2>{ UserFunction() }</user2>
    Of course, neither of these work and this makes me sad :(
    Anyone have any ideas? Much appreciated~!

    on that i can't help
    i'm a .net programmer an i use a lot httpservices but mostly
    i use webservices to get my data.
    But i can give my way of working. When you send your data
    from flex you are sending a virtual xml file thru http, then in
    .net using it xml class i read this stream of xml coming from flex,
    go to my database, get the result , wrapped it in xml and send thru
    stream again, so that flex understands the answer. When it gets to
    flex i just use e4x to read my data.
    There are tons of tutorials on the net for PHP, i wish i had
    half for .Net :D

  • How to use an .xsl file to transform input XML to re-formatted output XML?

    Hello,
    I have a .xml file from a report that I want to use a stylesheet to transform into a different .xml format.
    I am reading that I can create a .xsl file to read my input and then transform it to a new output .xml file.
    How do I load this into the Apps?
    I tried creating a template definition and loading the .xsl in as type 'XSL-TEXT' and also, I added
    <?xml-stylesheet type="text/xsl" href="Transform.xsl"?> to my xml data source. The output looked the same as the input.
    Has anyone done this before? Any suggestions would be great!
    Thanks
    -CC

    This is how I use e4x with HTTPService:
    import mx.collections.XMLListCollection;
    import mx.rpc.events.ResultEvent;
    [Bindable] private var claimsXLC:XMLListCollection;
    private function claimsHandler(evt:ResultEvent):void{
        claimsXLC = new XMLListCollection(evt.result..claim as XMLList);
    XML data is being returned, but I use XMLList to create the XMLListCollection.
    If this post answers your question or helps, please mark it as such.

  • E4X descendant-access (..) not working in simple case. Why?

    I have a fairly simple case where I'm trying to use E4X to access some grandchildren in my xml file. The data is coming from an HTTPService POST, and I have the resultformat set to E4X. Are there any other things I should look out for? I've worked with E4X a bunch in AS3 and have never had a problem before.
    I'm trying to get the Exercise tags in a for loop
    for each (var node:XML in xml..Exercise) {
    but xml..Exercise yields an empty XMLList.
    Here is my sample xml:
    <StudentProfile UserID="22" RoleID="1" Username="jsmith" FirstName="John" LastName="Smith" Email="" StudentID="" LastLogin="">
    <EnrolledSection CourseID="9" CourseName="Test Class" SectionID="14" SectionName="A">
    <Preferences/>
    <Exercises>
    <Exercise Exercise_id="1" Status="1" Enabled="true" IPValid="true" TimeValid="true" PasswordRequired="false"/>
    <Exercise Exercise_id="2" Status="0" Enabled="true" IPValid="true" TimeValid="true" PasswordRequired="false"/>
    <Exercise Exercise_id="3" Status="0" Enabled="true" IPValid="true" TimeValid="true" PasswordRequired="false"/>
    <Exercise Exercise_id="4" Status="0" Enabled="true" IPValid="true" TimeValid="true" PasswordRequired="false"/>
    </Exercises>
    </EnrolledSection>
    </StudentProfile>

    Hi,
    Using your sample XML,
    var exercises:XMLList = xml..Exercise;
    for each (var node:XML in exercises) {
        trace(node.@Exercise_id);
    Produces the output;
    1
    2
    3
    4
    So that means node is an Excerise node. SOmetimes Flash Builder does not actually show the "node" toString() in the consol correctly.
    traceing exercises yeilds the correct XMLList
    <Exercise Exercise_id="1" Status="1" Enabled="true" IPValid="true" TimeValid="true" PasswordRequired="false"/>
    <Exercise Exercise_id="2" Status="0" Enabled="true" IPValid="true" TimeValid="true" PasswordRequired="false"/>
    <Exercise Exercise_id="3" Status="0" Enabled="true" IPValid="true" TimeValid="true" PasswordRequired="false"/>
    <Exercise Exercise_id="4" Status="0" Enabled="true" IPValid="true" TimeValid="true" PasswordRequired="false"/
    Mike

Maybe you are looking for

  • Error message: no printer is selected. How do I do it in PS6 64 bit

    Get the message that I have to select the printer when I try to print. Then open a new photo and print it. Where do I choose a printer?

  • Intrastat-Wizard: Production BOM

    Intrastat-Wizard: Production BOM If subordinate items do not have to be declared, they still have to be updated otherwise the error message 'data incomplete' appears. We need the option to 'send' or 'not send' the subordinate items e.g  UDF -> releva

  • Can we create Communication Channel Dynamically at runtime

    Hi Experts Can we create Comm Channels during run time, If yes can any one help me out how to create....? My requirement is we get a file called manifest file. This file has list of file names and paths.   step 1. XI has to read manifest file   step2

  • Newbie: Java/JDBC best approach

    Hello, i am having trouble understanding the best approach to develop java/jdbc programs. I was told that the i could best load resultset data in to value objects loaded into a vector and handled by data access objects instead of using the resultset

  • Solution Directory----Merging two projects in Solution

    Dear Team,    I am working in Sol Man 4.0 SP 13. we have created two projects in Sol Man & we have done our entire implementation thro Sol Man. Now the two projects are gone live. Now we want to maintain "Solution Directory" merging these two project