Can't test this cause i don't have access to create an ASP.NET Service... but as far as your issues with loading the config... have you tried changing the code to be exactly like the 2.4 api? since it differs slightly (from what i see, just that the managers all have ID's) which could easily cause the problem... here's the 2.4 flexviewer index.mxml with the security code attached to it... anyone able to test it? (If the difference is actually at fault, this should allow you to simply replace the index.mxml instead of having to change the ViewContainer code)
<?xml version="1.0" encoding="utf-8"?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2010-2011 Esri
//
// All rights reserved under the copyright laws of the United States.
// You may freely redistribute and use this software, with or
// without modification, provided you include the original copyright
// and use restrictions. See use restrictions in the file:
// <install location>/License.txt
//
////////////////////////////////////////////////////////////////////////////////
-->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:viewer="com.esri.viewer.*"
xmlns:managers="com.esri.viewer.managers.*"
pageTitle="ArcGIS Viewer for Flex"
currentState="Login">
<fx:Style source="defaults.css"/>
<fx:Metadata>
[ResourceBundle("ViewerStrings")]
</fx:Metadata>
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
.loginPanelStyle
{
corner-radius: 10;
chrome-color: #004151;
color: #FFFFFF;
background-color: #FFFFFF;
border-visible: true;
border-color: #004151;
border-alpha: 0.8;
drop-shadow-visible: true;
}
.loginLabelStyle
{
color: #004151;
fontSize: 11;
font-weight: bold;
}
.loginText{
color: #004151;
}
.loginButtonStyle
{
chrome-color: #FFFFFF;
color: #004151;
}
.boilerLabelStyle
{
color: #004151;
fontSize: 12;
font-weight: normal;
}
</fx:Style>
<fx:Script>
<![CDATA[
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.soap.WebService;
import spark.skins.spark.PanelSkin;
protected function submit_clickHandler(event:MouseEvent):void
{
validate_user_proxy(); //use this to call service
}
protected function password_keydown(event:KeyboardEvent):void
{
if (event.keyCode==Keyboard.ENTER)
{
validate_user_proxy();
}
}
protected function validate_user_proxy():void
{
var proxyService:String= "validateUser";
var ws:WebService = new WebService;
ws.wsdl ="http://localhost/ArcGIS_Security/Service.asmx?WSDL";
ws.loadWSDL();
ws[proxyService].addEventListener(mx.rpc.events.FaultEvent.FAULT,validationFaultHandler);
ws[proxyService].addEventListener(mx.rpc.events.ResultEvent.RESULT,vsResultHandler);
ws.getOperation(proxyService).send("sampleSite",userName.text,passWord.text,"username","password");
}
public function validationFaultHandler(event:mx.rpc.events.FaultEvent):void
{
this.currentState = "Login";
lblStatus.text="Internal database error.";
}
public function vsResultHandler(event:mx.rpc.events.ResultEvent):void
{
var b:Boolean = event.result as Boolean;
if (b==true)
{
this.currentState = "Viewer";
}else{
this.currentState = "Login";
lblStatus.text="Invalid login.";
}
}
]]>
</fx:Script>
<s:states>
<s:State name="Viewer"/>
<s:State name="Login"/>
</s:states>
<s:Panel id="loginPanel" title="Sample Login Screen" styleName="loginPanelStyle" includeIn="Login" verticalCenter="0" horizontalCenter="0" width="50%" height="40%">
<s:VGroup verticalAlign="middle" horizontalAlign="center" width="100%" height="100%">
<mx:Text width="50%" text="[Enter disclaimer text here]" styleName="boilerLabelStyle" />
<mx:Form includeIn="Login" >
<mx:FormItem label="Username" labelStyleName="loginLabelStyle">
<s:TextInput styleName="loginText" id="userName" />
</mx:FormItem>
<mx:FormItem label="Password" labelStyleName="loginLabelStyle">
<s:VGroup>
<s:TextInput styleName="loginText" displayAsPassword="true" keyDown="password_keydown(event)" id="passWord" />
<s:Label id="lblStatus" styleName="loginLabelStyle"/>
</s:VGroup>
</mx:FormItem>
<mx:FormItem>
<s:Button label="Login" styleName="loginButtonStyle" click="submit_clickHandler(event)"/>
</mx:FormItem>
</mx:Form>
</s:VGroup>
</s:Panel>
<viewer:ViewerContainer id="viewerContainer" includeIn="Viewer">
<viewer:configManager>
<managers:ConfigManager id="configManager"/>
</viewer:configManager>
<viewer:dataManager>
<managers:DataManager id="dataManager"/>
</viewer:dataManager>
<viewer:mapManager>
<managers:MapManager id="mapManager"/>
</viewer:mapManager>
<viewer:uiManager>
<managers:UIManager id="uiManager"/>
</viewer:uiManager>
<viewer:widgetManager>
<managers:WidgetManager id="widgetManager"/>
</viewer:widgetManager>
</viewer:ViewerContainer>
</s:Application>
Anyone able to test this out?