0 Replies Latest reply on Jan 17, 2008 12:49 AM by Isaac Fung

    Setting credentials to a httpService

    Isaac Fung
      Looking forward to hear from someone who is familiar with both flex and .net

      The following flex app works well in the public folder within a .net environment:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" initialize="catalogService.send()">
      <mx:HTTPService id="catalogService" url="assets/catalog1.xml" resultFormat="e4x" />
      <mx:XMLListCollection id="myXC" source="{catalogService.lastResult.product}"/>
      <mx:Repeater id="r" dataProvider="{myXC}">
      <mx:RadioButton id="Radio" label="{r.currentItem.name}" width="150"/
      </mx:Repeater>
      </mx:Application>

      Form authentication was configurated with a folder called 'protected' and a copy of the same xml file was copied there. The above code was then modified as:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
      initialize="catalogService.setCredentials('userone','passwordone');catalogService.setcat alogService.send()">

      <mx:HTTPService id="catalogService" url="protected/catalog1.xml" resultFormat="e4x" />
      <mx:XMLListCollection id="myXC" source="{catalogService.lastResult.product}"/>
      <mx:Repeater id="r" dataProvider="{myXC}">
      <mx:RadioButton id="Radio" label="{r.currentItem.name}" width="150"/
      </mx:Repeater>
      </mx:Application>

      The code compiled and the application run but no data from the xml file was retrieved, only a blank screen appeared on the browser. Any comment on my problem will be very much appreciated.

      Alternatively, you can propose an alternative method (the simplier, the better) to protect my resources. Basically the main app is a publically available program, it serves as a gateway for different users to access different groups of resources.