Results 1 to 2 of 2

Thread: Retrieve XML from server

  1. #1
    Sencha User
    Join Date
    Sep 2013
    Posts
    1
    Vote Rating
    0
      0  

    Default Retrieve XML from server

    Trying to figure this out, not sure where to start. In AS3 I can do this...
    I want to populate a store (XML Store). I have to POST xml along with
    credentials in order to get a reponse.

    Code:
    private function getThis():void
    {
     var req:URLRequest = new URLRequest(http://xxxxxxx.yyy/zzz);   
    var nloader:URLLoader = new URLLoader();
    req.method = URLRequestMethod.POST;  
        req.contentType="text/xml";
    var dataXML:XML = 
            <obj is="obix:HistoryRollupIn">
                <abstime name="start" val="2011-06-28T00:00:00.000-4:00"/>
                <abstime name="end" val="2012-06-28T23:59:59.000-4:00"/>
            </obj>;
    
    req.data = dataXML.toXMLString();
    var encoder:Base64Encoder = new Base64Encoder();             
    encoder.encode("user:pass");      
    
    var credsHeader:URLRequestHeader = new URLRequestHeader("Authorization", "Basic " + encoder.toString());     
    
    req.requestHeaders.push(credsHeader);      
    
    nloader.load(req);
    
    nloader.addEventListener(Event.COMPLETE, parseThis);
    } 
    
    private function parseThis(ev:Event):void
    {
    var xmlDoc:XMLDocument = new XMLDocument(ev.target.data.toString());
    ...  etc...

  2. #2
    Sencha - Support Team
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,649
    Vote Rating
    284
      0  

    Default

    What have you tried so far? Here's some links to more information:
    http://docs.sencha.com/extjs/4.2.1/#...direct.Manager
    http://www.sencha.com/products/extjs/extdirect

    Lifecycle management for your web apps

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •