Hi,
I building a mobile employee directory and for that I am using Flash Builder 4.6/AIR 3.1.0. I am using RESTful web service to get XML results and to display on my mobile application. I am getting the same below error when accessing the webservice from mobile app (Android - Galaxy Tab 7 inch).
Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error # 2032"] URL: http://adfdevp.alshaya.com:7013/RESTEmployeeDetails-EmployeeDetails-co">http://adfdevp.alshaya.com:7013/RESTEmployeeDetails-EmployeeDetails-co ntext-root/jersey/restlabhttp://adfdevp.alshaya.com:7013/RESTEmployeeDetails-http://adfdevp.als haya.com:7013/RESTEmployeeDetails-EmployeeDetails-co ntext-root/jersey/restlabEmployeeDetails-context-root/jersey/restlab
The same code is working in Flash Builder 4.6. I have checked Network Monitor to "Disabled" before deploying to mobile. What am i doing wrong here? I am pasting my code below-
<?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" xmlns:dao="dao.*"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.collections.IList;
import mx.collections.XMLListCollection;
import mx.events.FlexEvent;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.xml.SimpleXMLDecoder;
import mx.utils.ArrayUtil;
import valueObjects.EmployeeDetail;
[Bindable]
private var myXml:XML;
[Bindable]
public var resultCollection:IList;
public function handleXml(event:ResultEvent):void
{
var xmlListCollection:XMLListCollection = new XMLListCollection(event.result.children());
var xmlListCollectionValues:XMLListCollection = new XMLListCollection(event.result.emp.children());
var resultArray:Array = xmlListCollection.toArray();
var resultArrayValues:Array = xmlListCollectionValues.toArray();
var objEmployeeDetails:EmployeeDetail;
var resultCollection:ArrayCollection = new ArrayCollection();
var j:int = 0;
for(var i:int=0;i<resultArray.length;i++){
objEmployeeDetails = new EmployeeDetail();
objEmployeeDetails.brand = resultArrayValues[j];
objEmployeeDetails.division = resultArrayValues[j+1];
objEmployeeDetails.email = resultArrayValues[j+2];
objEmployeeDetails.employee_name = resultArrayValues[j+3];
objEmployeeDetails.employee_number = resultArrayValues[j+4];
objEmployeeDetails.grade = resultArrayValues[j+5];
objEmployeeDetails.mobile = resultArrayValues[j+6];
objEmployeeDetails.position = resultArrayValues[j+7];
j = j + 8;
resultCollection.addItem(objEmployeeDetails);
}
list.dataProvider = resultCollection;
//return resultCollection;
}
public function handleFault(event:FaultEvent):void
{
//Alert.show(event.fault.faultDetail, "Error");
}
protected function sesrchEmployee():void
{
xmlRpc.send();
}
]]>
</fx:Script>
<fx:Declarations>
<dao:EmployeeDAO id="srv"/>
<mx:HTTPService id="xmlRpc"
url="http://adfdevp.alshaya.com:7013/RESTEmployeeDetails-EmployeeDetails-co ntext-root/jersey/restlab"
result="handleXml(event)"
fault="handleFault(event)"
resultFormat="e4x" showBusyCursor="true">
<mx:request xmlns="">
<data>{key.text}</data>
<data>{key1.text}</data>
</mx:request>
</mx:HTTPService>
</fx:Declarations>
<s:navigationContent/>
<s:titleContent>
<s:VGroup width="100%">
<s:HGroup width="100%">
<s:Label top="40" paddingTop="10" paddingRight="13" height="29" text="Employee Name:"/>
<s:TextInput id="key" width="559"/>
</s:HGroup>
<s:HGroup width="100%">
<s:Label height="30" paddingTop="10" text="Employee Number:"/>
<s:TextInput id="key1" width="100%"/>
</s:HGroup>
</s:VGroup>
</s:titleContent>
<s:actionContent>
<s:Button icon="@Embed('assets/search.png')" click="sesrchEmployee()"/>
</s:actionContent>
<s:List id="list" top="0" bottom="0" left="0" right="0"
change="navigator.pushView(EmployeeDetails, list.selectedItem)">
<s:itemRenderer>
<fx:Component>
<s:IconItemRenderer label="{data.employee_name}"
messageField="position">
</s:IconItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:List>
</s:View>
Please help me to resolve this issue as soon as possible. Appreciate your quick response in this regard.
Thanks,
Murtaza Ghodawala
Mobile: +965 97180549
North America
Europe, Middle East and Africa
Asia Pacific