2 Replies Latest reply on Mar 22, 2007 3:42 PM by romanczar

    HTTP service

    flexmasterb
      I have the flex sample store I want to put it on my server to see it live do I need ColdFusion of something els? Im getting this error:

      [RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: data/catalog.xml"]. URL: data/catalog.xml"]
      at mx.rpc::AbstractInvoker/ http://www.adobe.com/2006/flex/mx/internal::faultHandler()
      at mx.rpc::Responder/fault()
      at mx.rpc::AsyncRequest/fault()
      at ::DirectHTTPMessageResponder/errorHandler()
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()


      here is the main flexstore.mxml:



      <?xml version="1.0" encoding="utf-8"?>
      <!--
      ////////////////////////////////////////////////////////////////////////////////
      //
      // Copyright (C) 2003-2006 Adobe Macromedia Software LLC and its licensors.
      // All Rights Reserved.
      // The following is Sample Code and is subject to all restrictions on such code
      // as contained in the End User License Agreement accompanying this product.
      // If you have received this file from a source other than Adobe,
      // then your use, modification, or distribution of it requires
      // the prior written permission of Adobe.
      //
      ////////////////////////////////////////////////////////////////////////////////
      -->
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns="*"
      layout="absolute" minWidth="990" minHeight="550"
      preinitialize="loadStyle()"
      creationComplete="startService()"
      pageTitle="FlexStore" viewSourceURL="srcview/index.html">

      <mx:Script>
      <![CDATA[
      import mx.collections.IViewCursor;
      import mx.collections.ArrayCollection;
      import samples.flexstore.Product;
      import mx.rpc.events.ResultEvent;
      import mx.events.StyleEvent;
      import mx.styles.StyleManager;

      [Bindable]
      private var catalog:ArrayCollection;

      private var currentTheme:String = "beige";

      private function toggleTheme():void
      {
      if (currentTheme == "beige")
      {
      currentTheme = "blue";
      }
      else
      {
      currentTheme = "beige";
      }

      loadStyle();
      }

      private function startService():void
      {

      }

      private function loadStyle():void
      {
      var eventDispatcher:IEventDispatcher =
      StyleManager.loadStyleDeclarations(currentTheme + ".swf");
      eventDispatcher.addEventListener(StyleEvent.COMPLETE, completeHandler);
      }

      private function completeHandler(event:StyleEvent):void
      {
      image.source = acb.getStyle("storeLogo");
      homeView.updateMapImage();
      super.initialized = true;
      }

      private function productServiceResultHandler(event:ResultEvent):void
      {
      //HTTPService returns an ArrayCollection for nested arrays
      var products:ArrayCollection = event.result.catalog.product;
      var temp:ArrayCollection = new ArrayCollection();
      var cursor:IViewCursor = products.createCursor();
      while (!cursor.afterLast)
      {
      var product:Product = new Product();
      product.fill(cursor.current);
      temp.addItem(product);
      cursor.moveNext();
      }
      catalog = temp;
      }

      override public function set initialized(value:Boolean):void
      {
      // Hold off until the Runtime CSS SWF is done loading.
      }
      ]]>
      </mx:Script>

      <mx:Style source="main.css"/>

      <mx:HTTPService id="productService" url="data/catalog.xml"
      result="productServiceResultHandler(event)"/>


      <mx:VBox width="990" paddingLeft="0" paddingRight="0" horizontalCenter="0" top="12">

      <mx:ApplicationControlBar id="acb" width="100%" styleName="storeControlBar">
      <mx:Image id="image"
      click="toggleTheme()"
      toolTip="Change Theme"/>
      <mx:ToggleButtonBar
      height="100%"
      dataProvider="{storeViews}"
      styleName="storeButtonBar"/>
      </mx:ApplicationControlBar>

      <!-- using a creationPolicy of "auto" or "queued" has a bug at time of writing
      that prevents initial states from applying styles correctly.
      plus the instantiation of the cart view can cause a performance
      hiccup which we might prefer at startup -->
      <mx:ViewStack id="storeViews" width="100%" height="550" creationPolicy="all">
      <HomeView id="homeView" label="Home"
      showEffect="WipeDown" hideEffect="WipeUp"
      />
      <ProductsView id="pView" label="Products" catalog="{catalog}"
      showEffect="WipeDown" hideEffect="WipeUp"
      />
      <SupportView id="supportView" label="Support"
      showEffect="WipeDown" hideEffect="WipeUp"
      />
      </mx:ViewStack>

      </mx:VBox>

      </mx:Application>


      I’am using http but I really don’t know what I did wrong. Please if you can take a look for me I would love that.

      Thank you,
      Benny