Flex's HTTPService dispatches a ResultEvent instead of a FaultEvent

Flex's HTTPService dispatches a ResultEvent instead of a FaultEvent
I would like to know when does Flex's HTTPService launches a ResultEvent and when does it dispatches a FaultEvent.
When the servers response contain a 401 http status code error (Unauthorized), the HTTPService is dispatches a ResultEvent instead of a FaultEvent. I would assume that it should dispatch a FaultEvent. Am I correct? If not please tell me.
The amazing thing is that when I'm running the application under the Flash Builder 4.7's Android Simulator, it does dispatch a FaultEvent, but when I run it on the device, it dispatches the ResultEvent. Why is this happening? Any ideas?

I created an application to test what happens on both scenarios (Flash Builder's Simulator and Android Device) and compare the results. Next is the code.
Test application code
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
   xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView">
   <fx:Script>
  <![CDATA[
  import mx.rpc.events.FaultEvent;
  import mx.rpc.events.ResultEvent;
  ///////////////////////////// USING HIGH LEVEL COMPONENT (FLEX) //////////////////////////////////////////
  * Checks if all the necesary data was entered by the user.
  protected function configHandler(event:MouseEvent):void
  textArea.text = "Connecting to server using a high level component";
  configurationService.url = "http://10.0.0.221/api/v1/room/current/";
  configurationService.headers.Accept = "application/json"; 
  configurationService.send();
  textArea.appendText("\n...");
  * Handles the first phase (getting basic application information) of the configuration.
  * Stores the retrieved data from the server and calls the second phase of the process.
  protected function serviceResultHandler(event:ResultEvent):void
  textArea.appendText("\n");
  textArea.appendText("Entering serviceResultHandler \n");
  textArea.appendText(" HTTP status code is: " + event.statusCode);
  * Handles errors within the first phase (getting basic application information) of the configuration process.
  protected function servicefaultHandler(event:FaultEvent):void
  textArea.appendText("\n");
  textArea.appendText("Entering servicefaultHandler \n");
  textArea.appendText("HTTP status code is: " + event.statusCode);
  ///////////////////////////// USING LOW LEVEL COMPONENT (FLASH) //////////////////////////////////////////
  * Checks if all the necesary data was entered by the user.
  protected function config2Handler(event:MouseEvent):void
  textArea.text = "Connecting to server using a low level component \n ...";
  var loader:URLLoader = new URLLoader();
  var request:URLRequest = new URLRequest("http://10.0.0.221/api/v1/room/current/");
  request.requestHeaders = new Array( new URLRequestHeader('Accept','application/json'));
  try {
  loader.load(request);
  } catch (error:Error) {
  trace("Unable to load requested document.");
  loader.addEventListener(Event.COMPLETE, completeHandler);
  loader.addEventListener(Event.OPEN, openHandler);
  loader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
  loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
  loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
  loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
  private function completeHandler(event:Event):void {
  var loader:URLLoader = URLLoader(event.target);
  textArea.appendText("\n");
  textArea.appendText("Entering completeHandler \n");
  textArea.appendText("completeHandler: " + loader.data + "\n");
  var vars:URLVariables = new URLVariables(loader.data);
  textArea.appendText("The answer is " + vars.answer);
  private function openHandler(event:Event):void {
  textArea.appendText("\n");
  textArea.appendText("Entering openHandler \n");
  textArea.appendText("openHandler: " + event);
  private function progressHandler(event:ProgressEvent):void {
  textArea.appendText("\n");
  textArea.appendText("Entering progressHandler \n");
  textArea.appendText("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
  private function securityErrorHandler(event:SecurityErrorEvent):void {
  textArea.appendText("\n");
  textArea.appendText("Entering securityErrorHandler \n");
  textArea.appendText("securityErrorHandler: " + event);
  private function httpStatusHandler(event:HTTPStatusEvent):void {
  textArea.appendText("\n");
  textArea.appendText("Entering httpStatusHandler \n");
  textArea.appendText("httpStatusHandler: " + event);
  private function ioErrorHandler(event:IOErrorEvent):void {
  textArea.appendText("\n");
  textArea.appendText("Entering ioErrorHandler \n");
  textArea.appendText("ioErrorHandler: " + event);
  ]]>
   </fx:Script>
   <fx:Declarations>
   <s:HTTPService id="configurationService"
   result="serviceResultHandler(event)" fault="servicefaultHandler(event)"/>
   </fx:Declarations>
   <s:Button label="High Level" click="configHandler(event)"
   horizontalCenter="100" top="20" />
   <s:Button label="Low Level" click="config2Handler(event)"
   horizontalCenter="-100" top="20"/>
   <s:TextArea id="textArea"
   left="20" right="20" top="{configButton.y + configButton.height + 20}" bottom="20"/>
</s:View>
Results on the Flash Builder Simulator
When pressing the "Low Level" button (URL Loader) the text on the text area was:Connecting to server using a low level component ... Entering openHandler openHandler: [Event type="open" bubbles=false cancelable=false eventPhase=2] Entering httpStatusHandler httpStatusHandler: [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2  status=401 responseURL=null] Entering ioErrorHandler ioErrorHandler: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://10.0.0.221/api/v1/room/current/" errorID=2032]
When pressing the "High Level" button (HTTPService) the text on the text area was:Connecting to server using a high level component ... Entering servicefaultHandler HTTP status code is: 401
Results on the Android device
When pressing the "Low Level" button (URL Loader) the text on the text area was:Connecting to server using a low level component ... Entering openHandler openHandler: [Event type="open" bubbles=false cancelable=false eventPhase=2] Entering httpStatusHandler httpStatusHandler: [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2  status=401 redirected=false responseURL=null] Entering completeHandler completeHandler:
When pressing the "High Level" button (HTTPService) the text on the text area was:Connecting to server using a high level component ... Entering serviceResultHandler HTTP status code is: 401
When I ran the app on the Flash Builder's Simulator, both components worked as expected, meaning that they dispatched a FaultEvent and an IOErrorEvent. On the Android device each component misbehaived, the first dispatching a ResultEvent and the second one an Event.COMPLETE event.
Notice that on both scenarios, both components percieve the correct HTTP status code.
I would assume that there is a problem with the runtime, right? I'd appreciate your comments on the matter.

Similar Messages

  • Caching Issues with Adobe Flex and HTTPservice

    I faced a strange issue a coupla days back. In one of my Applications I had a Timer which would fire every 10 secs and would fetch data using a HTTPService call when fired. Surprisingly though, the initial results fetched by the HTTPservice was cached and would not reflect any changes when the data changed in the background, in IE, however the problem would not occur in Firefox !
    I sort of hacked the HTTPService url to add a random number at the end of the call to make it believe that it was calling a different URL every time and it worked. But I would definitely like to know the reason for this behavior

    Hi, Abesh. 
    I ran into the same thing, but it did not do this until recently!  I had recently installed Flex 3.0 beta, so maybe something changed with the compiler and/or the Flash VM in this regard.  Also, you can change the behavior of the Flex/Flash runtime by changing the caching settings in IE (check page for newer version on each visit).
    Rick

  • Flex XML HTTPservice

    I've written an XML service in Zend Framework and I want to
    parse the data to E4X/something else. I get back XML data something
    like this:
    quote:
    <?xml version="1.0" encoding="UTF-8"?>
    <root><Pname>caramba</Pname><Email>1</Email><DOB>4</DOB><Sex>1</Sex><Phone>1</Phone><Addre ss>caramba</Address><Photo>1</Photo><Enum>4</Enum></root>
    I want to get each variable Pname, Email and so forth into
    variable into Flex. How do I go about this?

    Doc on using an HTTPService is here:
    http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_2.html
    This includes lots of examples, including examples that use
    XML as the data source with E4X.
    More doc on working with E4X is here:
    http://livedocs.adobe.com/flex/3/html/help.html?content=13_Working_with_XML_03.html
    hth,
    matt horn
    flex docs

  • Adobe flex mx:httpservice

    Lets say there is a error with one of the XML nodes is there a way in the faultHandler() to skip over that node and continue processing the XML data and display it

    It sounds like your issue has to do with caching, check what status reports your browser when you're accessing the same data (XML file I assume) directly from browser (HttpFox is a good utility for this, on FireFox apparently).
    Besides, if you generate this XML file, check if you release the locks from it (no other program is accessing it when you try to get it into SWF).
    the permisions are set to minimum of 202 (read for "user" and read for "others").
    the .htaccess permits accessing XML files from that location. (in case you dynamically modify it).
    Also, your best way to go about such situations is to send the XML data back to the client using the server script instead of the server itself, you'll have more control over the headers you send alone with it, and less problems with permisions regulation etc. Besides, you'll be able to log any such attempt and see what you ware actually sending in response.

  • HTTPService - GET and POST in Flex

    I'm sending JSON data to a PHP script on the server, and I'm a bit new to the server side stuff so I'm hoping you all can answer a few questions.
    1) I thought using POST was more secure than GET, as GET sends parameters with the URL, but when I send by post, spaces are replaced with %20, so is my data really being sent by POST, or GET?
    2) I thought I had heard that under certain conditions you might send data by POST, but due to a bug Flex actually sends the data by GET. What are the conditions under which this happens?
    3) How can I send usernames and passwords using HTTPS in Flex using HTTPService. I assume I should use HTTPS as it is supposed to be secure.
    4) I've been messing around with PHP to process the data on the server, but quite frankly, working with PHP seems really difficult. I get the data, a PHP print says its an object, but object notataion ->  => does not seem to work. I've used PHP methods to get the object "keys", and also done a little with processing PHP arrays, but it still seems like PHP does not make it easy on you. Anything better for more easily transferring data securely between Flex and MySQL?
    Thanks very much in advance!
    Greg

    Hi Greg,
    What build of Flex are you using?
    1) When using HTTPS the GET URL would also be encrypted, but once decrypted on the server the URL might be logged so it's suggested to not use GET for transmitting credentials.
    In 3.x, the default contentType is application/x-www-form-urlencoded - but what happens to your data depends on the type of the params passed into HTTPService.send(). Are you constructing a JSON request as a String?
    BTW, did you try to set a contentType? I looked at the 3.x SDK source in SVN and the HTTPService contentType property still has metadata which provides code insight in the IDE but it also restricts the values of . When toString() is called on this XML node the root node is unwrapped and the empty string content returned. To avoid this toXMLString() can be called on the XML node to get the entire XML representation.
    3) Load your SWF via HTTPS and use also HTTPS to send your credentials to the server and establish a session. If you tried to use a Basic Auth challenge you'd have to rely on the browser authentication dialog as you can no longer preauthenticate using an "Authorization" header as it is on the list of headers not allowed by flash.net.URLLoader. See the docs for URLRequestHeader used to configure headers with URLLoader:
    http://livedocs.adobe.com/flex/3/langref/flash/net/URLRequestHeader.html
    As for how to send custom credentials... I think if you can solve your issue in 1) then the rest is up to what you want to do on the server. There should be lots of PHP login examples out there too. As a best practice try to delete / null out credentials variables when they're no longer in use on the client or server. Even though you're using HTTPS, consider additionally Base-64 encoding the credentials (for example, you could copy the format of the HTTPS Authorization header with a single "username:password" string) to obscure them in the event that a clear text version of the request is logged, or viewed in a debugger, etc.
    Pete

  • Combobox populate from HTTPService query

    I got this working with static XML files, but now its not
    working with HTTPService! I'm having problems getting a ComboBox to
    fill up with dynamic data from an SQL query which spits back XML
    data. I am basically filling one ComboBox based on the selection
    from another ComboBox. On startup, I call this method:
    public function loadSystems(serv:HTTPService, s:String) :
    void {
    var params:Object = {};
    params[s] = s;
    serv.send(params);
    To fill in the first ComboBox, which is defined as:
    <mx:ComboBox minWidth="130" maxWidth="130" id="mainSys"
    dataProvider="{sysOps.lastResult.system.data}"
    change="fillComboBox(mainSys, subSys, 'subsystem', subOps,
    sysIDs)" rowCount="10" />
    It fills up fine, but the fillComboBox method (below) comes
    up with a null result and fails
    // fill destination combobox based on selection from src
    combobox
    public function fillComboBox(src:ComboBox, dest:ComboBox,
    arg:String,
    serv:HTTPService, idArray:ArrayCollection) : void {
    var ind:int = src.selectedIndex;
    // choose ID from the ID array with the selecetedIndex
    var select:String = idArray.getItemAt(ind) as String;
    var params:Object = {};
    params[select] = select;
    params[arg] = arg;
    serv.send(params);
    dest.dataProvider = serv.lastResult.system.data; //
    serv.lastResult is null
    I know the server side is getting valid arguments in params
    and is spitting out valid XML so the problem is on the Flex side.
    Any ideas or help would be greatly appreciated. Thanks!

    Although caching is a common problem, that is not the cause
    of your problem. In Flex, all HTTPService calls are asynchronous,
    which means you cannot call the service and set the result in the
    same function like you are doing in your fillComboBox method. You
    need to add an event listener and get the result in a different
    method. However, in your function you are also passing the
    destination which complicates things. Instead of passing the
    destination, you could try passing a function that will assign the
    result to the component you want dynamically:
    change="fillComboBox(mainSys, setSubSys, 'subsystem', subOps,
    sysIDs)"
    public function fillComboBox(src:ComboBox,
    resultFunction:Function, arg:String, serv:HTTPService,
    idArray:ArrayCollection) : void
    serv.addEventListener(ResultEvent.RESULT,resultFunction);
    private function setSubSys(evt:ResultEvent):void {
    subSys.dataProvider = evt.result.system.data;
    In general, it makes debugging much easier if you avoid
    binding HTTPService results directly to components and instead use
    a listener function where you can examine the result data for any
    problems.
    Vygo

  • Sending an E-mail with attachment with PHP from Flex

    Hey,
    I've made a custom compontent wich mails your own drawings to you. But I have a problem to send an e-mail with attachment.
    I use the HttpService to send the data to the php-file, but I always get the Fault message (form phpFault()).
    This is my code in Flex:
    <mx:Script>
        <![CDATA[
            import mx.rpc.events.FaultEvent;
            import mx.rpc.events.ResultEvent;
            import mx.graphics.codec.PNGEncoder;
            import mx.events.ValidationResultEvent;
            import mx.controls.Alert;
            [Bindable]
            private var byteArray:ByteArray;
            private function mailImage(comp:DisplayObject):void
                var emailValidation:ValidationResultEvent = validEmail.validate();
                if(emailValidation.type == ValidationResultEvent.INVALID)
                    Alert.show("Invalid E-mail");
                else
                    var bitmapData:BitmapData = new BitmapData(comp.width, comp.height);
                    bitmapData.draw(comp);
                    var png:PNGEncoder = new PNGEncoder();
                    byteArray = png.encode(bitmapData);
                    httpMail.send();
            private function phpResult(evt:ResultEvent):void
                Alert.show("You've got mail.");
            private function phpFault(evt:FaultEvent):void
                Alert.show("Something went wrong. /n" + evt.message.toString());
        ]]>
    </mx:Script>
    <mx:EmailValidator id="validEmail" source="{ipEmail}" property="text"/>
    <mx:HTTPService id="httpMail" url="php/byte-receiver.php" method="POST" result="phpResult(event)" fault="phpFault(event)">
        <mx:request>
            <img>{byteArray}</img>
            <mail>{ipEmail.text}</mail>
        </mx:request>
    </mx:HTTPService>
    <mx:Label text="draw your own image" styleName="h1" x="10" y="0" width="493" height="60"/>
    <mx:Canvas
        id="drawCanvas"
        x="10" y="77"
        width="561" height="245"
        borderStyle="solid" borderColor="#A6A6A6">
    </mx:Canvas>
    <mx:Label x="10" y="329" text="Your e-mail:" styleName="text"/>
    <mx:TextInput
        id="ipEmail"
        x="86" y="324" width="417"/>   
    <mx:Label
        id="lblMailImage"
        x="10" y="383"
        text="Mail my image"
        click="mailImage(drawCanvas)"
        mouseOver="lblMailImage.setStyle('color',  '#00067b')"
        mouseOut="lblMailImage.setStyle('color',  '#717171')"
        styleName="button"/>
    </mx:Canvas>
    This is my PHP code
    <?php                 
    $fileatt_type = "application/octet-stream"; // File Type
    $fileatt_name = "ImgContact.png"; // Filename that will be used for the file as the attachment
    $email_from = "[email protected]"; //Who the email is from
    $email_subject = "Contact Winckelmans.net"; // The Subject of the email
    $email_message = "Mail send by winckelmans.net. Your drawing is in the attachment"; // Message that the email has in it
    $email_to = $_POST['mail']; // Who the email is too
    $headers = "From: $email_from";  
    $data= $_POST['img'];
    $semi_rand = md5(time());  
    $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";  
    $headers .= "\nMIME-Version: 1.0\n" .  
                "Content-Type: multipart/mixed;\n" .  
                " boundary=\"{$mime_boundary}\"";  
    $email_message = "This is a multi-part message in MIME format.\n\n" .  
                    "--{$mime_boundary}\n" .  
                    "Content-Type:text/html; charset=\"iso-8859-1\"\n" .  
                   "Content-Transfer-Encoding: 7bit\n\n" .  
    $email_message . "\n\n";  
    $email_message .= "--{$mime_boundary}\n" .  
                      "Content-Type: {$fileatt_type};\n" .  
                      " name=\"{$fileatt_name}\"\n" .  
                      //"Content-Disposition: attachment;\n" .
                      //" filename=\"{$fileatt_name}\"\n" .
                      "Content-Transfer-Encoding: base64\n\n" .  
                     $data . "\n\n" .  
                      "--{$mime_boundary}--\n";  
    $mailsend = mail($email_to, $email_subject, $email_message, $headers);  
    echo $mailsend;
    ?>
    This is the error I get in an Alert:
    (mx.messaging.messages::ErrorMessage)#0
      body = ""
      clientId = "DirectHTTPChannel0"
      correlationId = "F3C16CE1-65CF-E690-1907-D28293FD6BB9"
      destination = ""
      extendedData = (null)
      faultCode = "Server.Error.Request"
      faultDetail = "Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: php/byte-receiver.php"]. URL: php/byte-receiver.php"
      faultString = "HTTP request error"
      headers = (Object)#1
        DSStatusCode = 0
      messageId = "7A1DCDBE-0358-7E39-3AF8-D282945A7748"
      rootCause = (flash.events::IOErrorEvent)#2
        bubbles = false
        cancelable = false
        currentTarget = (flash.net::URLLoader)#3
          bytesLoaded = 0
          bytesTotal = 0
          data = ""
          dataFormat = "text"
        eventPhase = 2
        target = (flash.net::URLLoader)#3
        text = "Error #2032: Stream Error. URL: php/byte-receiver.php"
        type = "ioError"
      timestamp = 0
      timeToLive = 0
    Thanks in advance
    Vincent

    Hi
    I'm having the same issue, except my application actually sends the email but the attachment is 0 octet and it doesn't even give me an error... Any chance you found a solution for this and could share it ?
    Thanks

  • 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

  • SOAP, Web Service Interaction using Flex 2

    A Web Service exists on the local computer. It is a .NET
    Framework web service (SOAP) running under IIS. It commences with a
    demand for three parameters. One fills in the form and presses a
    button on the form and is returned an XML file with vital data
    necessary for future web service transactions that will involve
    SQL-form queries and XML responses. Actions that Flex 2 is required
    to perform: 1) submit a URI and receive a form, 2) POST a response
    to the form and receive an XML file, 3) submit a query, 4) reformat
    an XML file to remove irrelevant data and to make a Flex 2 data
    provider happy so that a chart can be displayed. I assume Flex 2
    can do all these things and it is just a matter of knowing how.

    Your description is a bit confusing. The webservice in
    question has a single method that takes three parameters, and
    returns a FORM? What are the three parameters, and what, exactly,
    do you mean by "form".
    When I hear "form", I usually think of an HTML form with text
    input fields, comboboxes, radio buttons, etc. But, in general,
    properly developed webservices do not return UI elements (such as
    text input fields, comboboxes, and radio buttons). They are
    typically only used as a communication method in the model layer,
    where they return datasets or process responses. And the view layer
    (in this case, Flex) is responsible for building any UI elements
    that collect data for the interaction with the webservice.
    But, okay, let's say, for some odd reason, this webservice
    returns a form (as I am thinking of the term). What format is this
    form in? I personally can't think of a readily available method
    that could display this form with a Flex app, but maybe I'm missing
    something. Or is it that, by "form", you mean something completely
    different, like a second method in the webservice that receives
    posted data? What is actually returned in your step #1?
    Step #2 is a cinch. Simply create an HTTPService tag (or in
    script, create URLLoader and URLRequest objects) in your app that
    posts the appropriate data to the appropriate webservice URL with
    the appropriate method. In the callback handler function for that
    webservice call, a (properly formatted) XML response will be
    converted automatically to a "Flex-friendly" data object, which you
    can easily parse apart to build your SQL as necessary.
    Step #3, again, where do you submit the query to? A third
    method in the webservice? If so, it would be just like #2 above.
    And the response data would, again, be automatically converted into
    a Flex data object.
    Step #4 would probably be accomplished more by manipulating
    the Flex data object rather than any reformatting of the XML.
    Simply loop through the object and remove irrelevant children/data.
    Then set a bindable variable to the cleaned data object, and have
    your chart bound to that variable.
    There are many many examples on the web. Just search for
    'flex "mx:HTTPService"' or similar. And take a look through
    LiveDocs for [Bindable] for step #4.

  • How to use Web Dispatcher in XI

    XI receives some messages and passes them onto CRM for processing. The user ID that is used between XI & CRM communication of  “Service” user type.Due to this reason, this user has consumed the dialog processes available during the process.The error seems to indicate that the load was too heavy and that the system ran out of memory blocks reserved for XI to CRM communication.  There are 2 application servers for CRM, in addition to the central instance.We can use the web-dispatcher in XI (instead of a particular Application instance).
    Web dispatcher will then assign the message to the available application instance.
    The question is How do we Use Web Dispatcher in XI with respect to this scenario??
    Can anybody put light on this issue.

    Have a look here
    http://help.sap.com/saphelp_nw70/helpdata/en/43/39c7b227b91bcbe10000000a1553f7/frameset.htm
    Regards,
    Prateek

  • Best practice for adding text to Flex container?

    Hi,
    I'm having some troubles to lay a TextFlow class out properly
    inside a Flex container. What's the best practice to achieving
    this, for example adding a lot of text to a small Panel?
    Is it possible to pass anything other than a static width and
    height to DisplayObjectContainerController constructor, or is this
    not the place to implement this? I guess what I am looking for is
    the layout logic I'd normally pack into a custom Flex component and
    implement inside measure() and so on.
    My use case: a chat application which adds multiple TextFlow
    elements to a Flex container such as Panel. Or use TextFlow as a
    substitute for UITextField.
    Some example code would help me greatly.
    I'm using Flex 3.2.
    Regards,
    Stefan

    Thanks Brian, the example helps. However problems quickly
    arise if I modify it slightly to this (please compile it to see):
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" initialize="init()">
    <mx:Script>
    <![CDATA[
    import flashx.textLayout.compose.StandardFlowComposer;
    import
    flashx.textLayout.container.DisplayObjectContainerController;
    import flashx.textLayout.container.IContainerController;
    import flashx.textLayout.elements.TextFlow;
    import flashx.textLayout.conversion.TextFilter;
    private var _container:Sprite;
    private var _textFlow:TextFlow;
    private function init():void
    _container = new Sprite();
    textArea.rawChildren.addChild(_container);
    var markup:String = "<TextFlow xmlns='
    http://ns.adobe.com/textLayout/2008'><p><span>Hello
    World! Hello World! Hello World! Hello World! Hello World! Hello
    World! Hello World! Hello World! Hello World! Hello World! Hello
    World! Hello World! </span></p></TextFlow>";
    _textFlow = TextFilter.importToFlow(markup,
    TextFilter.TEXT_LAYOUT_FORMAT);
    _textFlow.flowComposer.addController(new
    DisplayObjectContainerController(_container, 200, 50));
    _textFlow.flowComposer.updateAllContainers();
    ]]>
    </mx:Script>
    <mx:Canvas width="100" height="100" id="textArea" x="44"
    y="46" backgroundColor="#F5EAEA"/>
    </mx:Application>
    What is the best way to make my textflow behave like a
    'normal' UIComponent in Flex? Should I use UIComponent instead of
    Sprite as a Container? Will that take care of resize behaviour?
    I have never before needed to use rawChildren.addChild for
    example, maybe you can explain why that's needed here?
    I realise that the new Textframework works on an AS basis and
    is not Flex or Flash specific, but this also poses some challenges
    for those of us using the Flex framework primarily.
    I think it would help to have some more basic examples such
    as using the new text features in a 'traditional' context. Say for
    example a TextArea that is just that, a TextArea but with the
    addition of inline images. I personally feel that the provided
    examples largely try to teach me to run before I can walk.
    Many thanks,
    Stefan

  • How to Create a File From Flex

    Hi,
    I am trying to create something that would allow a file to be
    created on its own using PHP on the backend through Flex's
    HTTPService. I thought two or three lines of code in PHP using
    fopen would work, but I always get this error message that tells me
    that the file cannot be opened.
    Does anyone have any suggestion on what I should do to fix
    this issue?
    Thanks a lot for your help.
    Alice

    "alice_data" <[email protected]> wrote in
    message
    news:gil9c9$s2o$[email protected]..
    > Hi,
    >
    > It is good to know that there is nothing wrong with what
    I did in Flex. I
    > will check and see if there is any other PHP errors I
    have missed over
    > here.
    You should test the php part separately from the Flex part.
    In other words,
    hard code the file to write first and test that. Then write a
    php page that
    provides the parameters to write the file. Finally, call the
    php page from
    Flex with the same parameters the other php page used.

  • Parse a WDDX packet using httpservice

    Hi,
    Can anyone tell me how to parse a wddx packet in flex using
    httpservice,
    - <wddxPacket version='1.0'>
    <header/>
    <data>
    <struct>
    <var
    name='Firstname'><string>Henry</string></var>
    <var
    name='Email'><string>[email protected]</string></var>
    </struct>
    </data>
    </wddxPacket>
    How is the result handled? ------------event.result. ??
    Thanks in Advance!!
    Lama

    "lama56" <[email protected]> wrote in
    message
    news:gfme47$4ht$[email protected]..
    > Hi,
    >
    > Can anyone tell me how to parse a wddx packet in flex
    using httpservice,
    > - <wddxPacket version='1.0'>
    > <header/>
    > <data>
    > <struct>
    > <var
    name='Firstname'><string>Henry</string></var>
    > <var
    name='Email'><string>[email protected]</string></var>
    > </struct>
    > </data>
    > </wddxPacket>
    >
    > How is the result handled? ------------event.result. ??
    http://livedocs.adobe.com/flex/3/html/13_Working_with_XML_12.html
    http://livedocs.adobe.com/flex/3/html/13_Working_with_XML_11.html
    http://livedocs.adobe.com/flex/3/html/13_Working_with_XML_02.html
    It seems like you're having trouble mastering the Flex help
    system, so I'd
    suggest this as well:
    http://flexdiary.blogspot.com/2008/07/getting-help-in-flex-builder.html

  • HTTPService in AIR application

    I have to cross post it, because I need that to get solved.
    Why same HTTPService code that works in Flex does not work at all in AIR? All I am getting is HTTP service error.

    Hi,
    Its work in the air application same as the flex application.
    You can verify it very easly.
    Use this sample applicaion which is a flex based.
    http://www.adobe.com/devnet/flex/quickstart/httpservice/
    After this simply create the AIR project with the same code by simply replacing Application by WindowedApplication, it is working fine.Pls let me know if you have any issue.
    with Regards,
    Shardul Singh Bartwal

  • PHP errors in flex

    I have an application in PHP and I'm using Flex for the
    front. I was wondering how I could transfer information about
    errors to flex from php.
    So, the questions I am asking are:
    What does Flex's HTTPService consider a fault?
    Is there a way to write a general wrapper function to manage
    httpservices? I tried but flex won't allow me to assign a function
    call to the event listener, only a function.

    Probably HTTP error codes. You can use the same function in
    multiple HTTPServices. If you don't care which one of the
    HTTPService thru the error, just use the same function when you
    declare the faulthandler for the HTTPService.

Maybe you are looking for