Flex to WCF

Hi,
I am using a FLEX client to consume WCF service. I would like to pass one class object as parameter from flex to WCF service. How this can be done?
Thanks in advance,
Ayyappan

In order to pass strong-typed objects from Flex to WCF (or Java) is to use remoting.  WebORB and Fluorine are able to provide remoting to Flex using .Net.  When a Flex application is using remoting the data is in a binary format (AMF).  Having this provides faster downloading and (de)serializing of data.
Below are articles on this subject:
http://www.themidnightcoders.com/products/weborb-for-net/developer-den/technical-articles/ flex4-wcf-integration.html
http://www.adobe.com/devnet/flex/flex_net.html
// here is an application that illustrates the power of AMF compared to plain-text formats.
http://www.jamesward.com/census2/
I hope that helps, let us know if you are using SOAP, REST or remoting.

Similar Messages

  • HOT TO INTEGRATE, WCF flex 4 data services

    OK.  I am trying to build a simple HELLO WORLD WCF Sample and use FLEX 4 (new data servic
    es wizard to invoke it).
    I have the WCF Client
    Tested the WCF Client  (works great with JQUERY)
    Now I have a brand new flex project and was able
    to click the "DATA/SERVICES" and establish a good relationship to the wsdl
    http://llocalhost/service.svc?wsdl
    Flex 4 finds the service and the correct methods.
    WHEN IT TEST IT OUT using the "TEST OPERATION" panel..it fails with a very ugly error.
    a:InternalServiceFaultError in deserializing body of request message for
    operation 'HelloWorld'. OperationFormatter encountered an invalid Message
    body. Expected to find node type 'Element' with name 'HelloWorld' and
    namespace 'http://localhost'. Found node type 'Element' with name
    'q0:HelloWorld' and namespace 'http://tempuri.org/'OperationFormatter
    encountered an invalid Message body. Expected to find node type 'Element'
    with name 'HelloWorld' and namespace 'http://localhost'.  .........
    I also decided to try and test invoking it from a mxml file
    NOTHING HAPPENS AT ALL..OR IT GET NULL OR OTHER ERRORS
    <s:Application 
    xmlns:testWcFWebServices="services.service.*"
    protected function helloWorld():void
    //Alert.Show(ServiceTest.HelloWorld().result);
    HelloWorldResult.token = ServiceTest.HelloWorld();
    Alert.show(HelloWorldResult.lastResult);
     <fx:Declarations>
     <s:CallResponder id="HelloWorldResult"/>
     <testWcFWebServices:Service id="ServiceTest" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>  </fx:Declarations>
    </fx:Declarations>
    PLEASE HELP...this is very disturbing when trying to figure this out.
    search:
    flex 4 CallResponder wcf wsdl hello world
    flex 4  wcf wsdl data services
    flex 4  wcf wsdl data services 2010
    flex 4  wsdl data services wizard
    flex 4 web service hello world example
    flex 4 data services web service hello world example
    flex 4 data services hello world example
    flex 4 data services example
    flex4 wcf
    flex InternalServiceFaultError in deserializing body of request message for
    flex services InvocationTargetException

    Holy cow???? it finally came through....It really should not be that Hard.  I should be able to right click the "DATA/SERVICES" icon and it generate a MXML action script file on how to consume it...
    IF JUST WORKING WITH a simple Data Type:
    DO NOT NEED TO work with a
    <s:CallResponder id="myHelloWorldResult"/>
    JUST SIMPLE CREATE A RESULT EVENT IN THE DECLARATION:
      <testWcFWebServices:MyHelloWorld id="ServiceTest" result="ServiceTest_resultHandler(event)" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
    protected function ServiceTest_resultHandler(event:ResultEvent):void
    showResult(event.result.toString());
    private function showResult(reqResult:String):void {
    Alert.show(reqResult);
    TO NOTE: I DID USE THIS SAMPLE AS I GUIDE: Even though this guy used action script...and I wanted to use the DATA\SERVICES wizard.
    http://cookbooks.adobe.com/post_Connecting_Flex_4_with_WCF_Services-17006.html

  • DataGrid in a DataGrid - Flash Builder 4 Beta 2

    My dear friends, hi...
    There is a problem here:
    I have a Flex and WCF webservice project...
    One part of my project is look like this:
    I wonder what kind of controls should I use for this part? Something like Grids, Lists or something like Repeater in .Net projects!
    What is your Idea?!
    And if I must use DataGarid, I think I have to use nested DataGrids. How could I do this?
    U know? I have 2 DataGrid:
         <mx:DataGrid x="10" y="10" id="DG1"
                     creationComplete="dataGrid_creationCompleteHandler(event)"
                     dataProvider="{GetSingleClassResult.lastResult}">
            <mx:columns>
                <mx:DataGridColumn headerText="Childs">
                    <mx:itemRenderer>
                        <fx:Component>                       
                            //something here
                        </fx:Component>
                    </mx:itemRenderer>
                </mx:DataGridColumn>
                <mx:DataGridColumn headerText="FirstName" dataField="FirstName"/>
                <mx:DataGridColumn headerText="ImageUrl" dataField="ImageUrl"/>
                <mx:DataGridColumn headerText="LastName" dataField="LastName"/>
            </mx:columns>
        </mx:DataGrid>
    and
         <mx:DataGrid   id="DG2"
                     dataProvider="{GetSingleClassResult.lastResult.Childs}">
            <mx:columns>
                <mx:DataGridColumn dataField="ChileName" />           
            </mx:columns>
        </mx:DataGrid>
    But if I take my DG2 DataGrid and put it in first DataGridColumn of DG1, between  <fx:Component> Tag, I'll have this error:
    1120: Access of undefined property GetSingleClassResult.
    What should I do?!

    Hello,
    Data Mangement expects unique values for id property.This issue may occur when you select 'Identity' property in Data Mangement wizard which is not unique in the Table.For eg:, you have selected 'name' field as identity property. And your MySQL database table has multiple rows with identical values for 'name' column.
    Can you verify if you have similar setup?
    Thanks,
    Radhakrishna

  • Error 2032 in communication between Flex Client and WCF

    Hi All,
    I'm trying to establish communication between Flex Client
    and WCF service.
    WCF service accepts gZip compressed data and returns gZip
    compressed results.
    So I used Flex ByteArray.compress() and
    ByteArray.uncompress() for this purpose. However, it throws error
    2032.
    The gZip compression/decompression uses MemoryStream class in
    C#. Based on my previous experience, memory stream communication
    between Flex and C# gives erro 2032.
    Is there a work around for this?
    Thanks,
    Vishal

    I read some thread in the forum, and found somebody had the similar problem with me. Just want to know how to settle this problem.
    In the client/server program. Client is a JAVA program and Server a
    VC++ program. The connection works, and the problem appears after some time. The Client sends a lots of requests to Serverm, the server seems receive nothing. But at the same time, the server is able to send messages to Client. The Client also can get the messages and handle them. Don't understand why there this problem and why it appears when it wants.
    The client is a Win2k platorm with JDK1.3.1 and the server is also a Win2K platform with VC++ 6.0.
    In the Client, using:
    inputFromServer = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    outputToServer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())),true);
    Hope can get your help.

  • Can Flex 4.6 connect directly with a MS WCF

    Can Flex 4.6 connect directly with a MS WCF without having to use a 3rd party tool like WebOrb.  I have several basic httpprotocal wcf services that I want to move to a mobile app with Flex. Any feed back or insight will be appriceated.

    The correct answer to this question appears to be that Apple's terms of service *do not* prohibit the loading of swf's on IOS from remote servers dynamically at runtime.  They prohibit the loading of swf's that *contain executable ActionScript code*. 
    I loaded a PPT into Adobe Connect and then retrieved the resultant slide swf's from the Connect server.  I took these swf's and loaded them into my iPad app, dynamically at runtime, from a remote server.  The swf's loaded and animations played.  I made no changes to my code.  I'm just using a plain old SWFLoader object.
    Loading swf's dynamically at runtime from remote servers into IOS works - if you make the swf's right.  How to do that I'm not sure.

  • How to consume WCF service method in flex 4

    Hi,
    I am working on CS Extension builder developing InDesign flex UI and need to consume WCF service methods developed in .Net, even though there is couple of google result closed to requirement, one of them is:
    http://www.giantflyingsaucer.com/blog/?p=20;
    but it accept the argument only string or xml but in my scenerio method retrives the List of items and return also the list of Item.
    Can some one help me to figure it out.
    Mac 

    try www.themidnightcoders.com , they might have something you need and I find their software easy to use, plus it's free, even for corporations.

  • FLEX /WCF 3.5 : what is the netctp binding is supported by flex?

    I haven't knowlegde in flex, i need to expose wcf service to Flex. The web service exists and uses http bindings. I know to be possible from wcf http bindings. Sometimes, the perfomance isn't very good. Before to use Net Remoting and a AMF Gateway, i want to know this is  possible to use nettcpbinding .My englsih isn't very good, sorry and thank for your help.

    Yes. that's right! flex 3 and unfortunately flex 4 don't support SOAP 1.2!
    And for calling a WCF Webservice you must set your binding option to BasicHttpBinding to make it...
    regards

  • Issues with file upload in flex mobile application (sharepoint as backend)

    Hello,
    I am working on flex mobile application for android platform for which we are having sharepoint as a backend.
    (Flex SDK 4.6 and AIR 3.9)
    Issue which we are facing is as follows:
    We are communicating with the backend server using webservices: example:
    <s:WebService id="kWebService" wsdl="http://www.kservice.net/kdatabaseservice.asmx?WSDL" >
                <s:operation name="AddPost"
                             resultFormat="object"
                             result="addPostResult(event)"
                             fault="postsfaulterr(event)" />
    </s:WebService>
    Above services are working fine but we are facing issue with one service which is related to file upload.
    File upload for <10 MB is working fine but when we try to upload larger file on server it fails to process.
    We are sending bytearray to the backend and backend code is writing those bytearray into file.
    We have tried many ways to overcome from this situation. like we have checked configuration for file upload size on server , we have tried wcf services as well. Please help us on this criticle point as soon as possible
    Thanks
    Dhwani

    Prashant8809 wrote:
    Hi
    >
    > I have already gone through the video by Thomas Jung for multiple file upload but it saves the contents in server and not in >transparent table. So please suggest me alternative solutions.
    >
    >
    > Regards
    > Prashant Chauhan
    What do you mean that my video saves the contents int he server and not in transparent table?  I save the data into a temporary database table so it can be accessed by the parent WDA session. From there the WDA session can do whatever it wants with it.  What do you mean by transparent table - that would be a database table. Do you actually mean internal table?  if so, just read the data from the temporary database table into memory.

  • Flex and Restful Services

    Hello,
    I'm new to the whole Flex system and I'm trying to integrate with WCF Rest Services
    I see that Flex doesn't support PUT and DELETE which is fine because we can use the x-http-method-override header which I assume you set in Flex with the headers property of the HttpService object?
    httpService.headers["x-http-method-override"] = "DELETE"
    The other thing is the HTTP Status code - it seems that Flex can't give you the HTTP Status code returned by the HttpService and that codes over 200 cause an exception. Is this correct and is this going to be resolved in Flex 4?
    Thanks,
    Dave

    I had a similar problem with 302 codes.  Firefox gets HTTPStatusEvent.HTTP_STATUS and IE gets Event.COMPLETE.  Can you check HTTPStatusEvent in Safari?
    Basically the HTTP stuff is a total disaster because of all the inconsistencies in the browser plug-in interfaces.  So much for "write once run anywhere"!  More like write once, test everywhere, pray...
    If you're in control of the server returning the 204 I'd say change it to not do that but I understand that may not be an option.

  • Logout flex application

    I have a
    Flex application that I would like it to logout (essentially call a
    function) when there is no activity for a given time. (No mouse movement  or key
    strokes). Is there a built in fx for  this, if not any ideas. Thx

    see this:
    http://forums.adobe.com/thread/844577?tstart=0
    so there clearly is an idle event i have not jumped into it but a great place to start.
    i use timers myself and that drives a lot of what I do for auto-logoff or prompting saying it will happen unless you click No now.
    basically i use a timer that fires once a minute to call wsdl wcf routines to refresh summaries and update info on the screen. good for user to user messaging too but you need sockets for more timely chat stuff.
    when the user moves between modules or calls any backend routine (wsdl wcf) then i update a datetime for that request. sort of a global singleton class. if 30 minutes passes by (compare timer event nowdatetime to that variable of last request).  if greater than allowed time then throw up a messagebox saying hey bud are you there you are about to be logged off Yes or No.
    for some assignments i have even saved their current State if i log them off so when they log in again i re-zoom them to where they were. It is a challenge but hey they pay for it.
    there are many ways to skin the cat find one you like.

  • Actionscript 3 webservice wcf

    Hi,
    I need to comunicate with a webservice (WCF) from actionscript 3 (not Flex). I've been searching the Internet a lot and found http://flashauthoring.blogspot.com/2008/10/using-flex-webservice-component-in.html, but it works only in Flash Professional and I'm using Flash Builder 4 to compile the project. http://code.google.com/p/as3webservice/ works but not for WCF. Has anybody written a class that will work in my scenario?
    Thanks for all responses,
    TR

    Hi Roger,
    I am experiencing a similar situation where a flash CS3/AS3 application using a similar code is calling a server side web service to retrieve/update data in the database. For some reason either a connection to the server gets lost or the web service call isn't successful and thus the fault function isn't called. Since you have asked this question a while back, I just wanted to know if you were able to resolve this issue?
    Adnan

  • Flex application running under AIR takes a long, long time to start.

    I have a flex application which runs on a desktop under AIR. The application has an assets folder with 3,500 mp3 soundclips totalling about 50MB. The problem is, the application takes around 90 seconds to load. I'm sure that AIR is scanning the application folder and doing something with the contents because if I delete the assets folder it loads in about 5 seconds. Does anyone know why AIR/Flex would do this, and why it doesn't exhibit the same problem if I run or debug in Flexbuilder on eclipse? It's making my killer app unusable!
    Thanks
    Paulo

    Well, I've spent a bit longer looking at this now, and the problem appears to lie with my encrypted local store. The first thing that happens is for the app to read the product key from the ELS. But, it fails (for some unknown reason). So, the app seems to hang there for 90 seconds until it eventually renders the welcome screen. If I remove the assets folder it still fails to read from the ELS, but only takes a couple of seconds to start the welcome screen. This is where the scanning of the application folder seems to come into play, because if I remove the code which reads from the ELS the app starts within 2 seconds whether the asset folder is there or not.
    I think the slow startup and the scanning of the assets folder are just symptoms of a different problem, i.e. a problem with the ELS. I don't have the same problem with my development environment though - it's only when I test deploy the application.
    Thanks for your help on this problem EgorKDie. I think I should be able to resolve it once I can sort out why the ELS is being awkward.

  • Previewing an image before uploading it using the FileReference class in flex 3

    Previewing an image before uploading it using the FileReference class in flex 3 ?

    hai,
              when this code is used in my application ,i got the name of image and new frame is added each time .But image is not displayed.....
    The code  starts like this
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
                xmlns:mx="library://ns.adobe.com/flex/mx" initialize="init()"   backgroundColor="white" width="100%" height="100%">
        <fx:Script>
    <![CDATA[ 
                    import mx.controls.Alert;
                    import mx.messaging.Channel;
                    import mx.messaging.ChannelSet;
                    import mx.messaging.channels.AMFChannel;
                    import mx.rpc.events.ResultEvent;
                    import mx.controls.Image;
                    import spark.events.IndexChangeEvent;
                    import mx.managers.DragManager;
      <mx:DataGridColumn headerText="Dimension Value"  width="10" dataField="dimensionValue"/>
                                                   <mx:DataGridColumn headerText="Unit Nmae"  width="10" dataField="dimensionUnitName"/>
                                                   </mx:columns>
                                           </mx:DataGrid>
                                           <mx:Spacer width="2%"/>
                                       </mx:HDividedBox>
                                       </mx:VBox>
                   <mx:Spacer height="0"/>
                <mx:VBox width="100%">
                    <s:HGroup height="90" top="0" left="0" right="0" verticalAlign="justify" gap="10" paddingLeft="5" paddingRight="5" paddingTop="5" paddingBottom="5">
                        <s:Button id="btn_loader" top="5" bottom="24" width="100" label="load" click="loadImages()"/>
                        <s:Group width="100%">
                            <s:Group name="cl" top="0" left="0" bottom="0" width="20" mouseOver="//scroll_on(event)" mouseOut="//scroll_off(event)">
                                <s:BitmapImage source="@Embed('../assets/left.jpg')" top="0" left="0" bottom="0" right="0" fillMode="scale"/>   
                            </s:Group>
                            <s:List id="imgList" skinClass="skins.ListSkin" top="-3" left="27" right="28" bottom="10"
                                    dataProvider="{ImageCollection}" itemRenderer="Image_Render">
                                <s:layout>
                                    <s:HorizontalLayout gap="0"/>
                                </s:layout>
                            </s:List>
                            <s:Group name="cr" top="0" right="0" bottom="0" width="20" mouseOver="//scroll_on(event)" mouseOut="//scroll_off(event)">
                                <s:BitmapImage source="@Embed('../assets/right.jpg')" top="-1" left="0" bottom="0" right="0" fillMode="scale"/>
                            </s:Group>
                        </s:Group>
                    </s:HGroup>
                    <s:SkinnableContainer id="dropCanvas" top="100" left="5" right="5" bottom="5" backgroundAlpha="1.0" alpha="1.0"
                                          dragEnter="dropCanvas_dragEnterHandler(event)"
                                          dragDrop="dropCanvas_dragDropHandler(event)" contentBackgroundColor="#914E4E" backgroundColor="#F7F7F7">
                    </s:SkinnableContainer>
                </mx:VBox>
                <mx:Spacer height="5"/>
                                      </mx:VDividedBox>
        </mx:Panel>
    </mx:Canvas>

  • Is there a way of working collaboratively on a flex project with a small project group?

    Is there a way of working collaboratively on a flex project with a small project group?
    I am part of a small group of developers who wish to work on a single flex project together. Is there a way to set up flex so that the project can be developed by multiple people at the same time. I have seen one thread out on the internet about working locally and then uploading to SVn but this is not an option in this case.
    Any ideas.
    Many thanks in advance
    Dave

    I would say that rushing into development without a source-control system will cost you more in the long-run. If your organisation is serious about developing software it then it needs to invest in the necesary infrastructure, so you should get that process kicked-off as soon as possible.
    In the interim you could set-up a source control server on one developer's machine or commandeer a spare machine to use as a temporary source control server. Just make sure you have it backed-up regularly. Or you could use one of the online source control services; many will support private repositories for a small fee.

  • How to get Current Location in a Android Emulator using Flex

    Hi
    In the following code I am able to plot the Location using Latitude and Longitude but the requirement is
    in an Android Emulator on launch of the application I need google map to display the users current location,
    How can this be achieved ??? I tried to get the Latitude and Longitude of the current position using
    geoLocation class by I am not able to get that working,
    <?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="Home">
        <s:layout>
            <s:VerticalLayout />
        </s:layout>
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                import com.google.maps.LatLng;
                import com.google.maps.MapEvent;
                import com.google.maps.MapType;
                import com.google.maps.controls.PositionControl;
                import com.google.maps.controls.ZoomControl;
                import flash.sensors.Geolocation;
                private var myGeo:Geolocation;
                protected function showBtn_clickHandler(event:MouseEvent):void
                    if(Geolocation.isSupported == 'true')
                        myGeo = new Geolocation();
                        myGeo.setRequestedUpdateInterval(100);
                        myGeo.addEventListener(GeolocationEvent.UPDATE, onUpdate);
                    else
                        myTextArea.text = "Device Not Supported";
                private function onUpdate(event:GeolocationEvent):void
                    myTextArea.text += "Hi"+ "/n"+ event.latitude.toString() + "/n" +
                        event.longitude.toString();
                protected function myMap_mapevent_mapreadyHandler(event:MapEvent):void
                    myMap.setCenter(new LatLng(24,58),9,MapType.NORMAL_MAP_TYPE);
                    myMap.addControl(new ZoomControl);
                    myMap.addControl(new PositionControl);
            ]]>
        </fx:Script>
        <s:Button id="showBtn" label="Show" click="showBtn_clickHandler(event)"/>
        <s:TextArea id="myTextArea" width="100%" height="50%" />
        <maps:Map id="myMap" width="100%" height="50%"
                  xmlns:maps="com.google.maps.*"
                  sensor="true"
                  key="ABQIAAAA2Fwy6HLBheYSAWRBEZKwEhRLum8XdHegG17d4EymNgK0o7h2qRRWVBVQywiGHEiGtKahjfGW8xxc RA"
                  mapevent_mapready="myMap_mapevent_mapreadyHandler(event)"
                  url="http://www.xyz.com"/>
    </s:View>

    Geolocation isn't supported in the Emulator. You'll have to set up a test case that gives the geolocation without relying on the Emulator.

Maybe you are looking for

  • Trouble with Toshiba built-in webcam: "unable to enumerate USB device"

    I am running archlinux on a Toshiba Satellite L70-B-12H laptop, and having troubles with the Webcam. *Once in a while*, everything goes well and I get # lsusb Bus 004 Device 002: ID 8087:8000 Intel Corp. Bus 004 Device 001: ID 1d6b:0002 Linux Foundat

  • How do I keep my contacts from syncing to another iphone on my apple id

    I updated my husbands phone a Iphone 4s and now are contacts are shared not sure how to undo this. we are both on the same icoud and apple id

  • I replaced the battery in my iPod 3G, but it still won't hold a charge. Can this be fixed?

    My ipod suffered some water damage early this year, leaving the device itself working fine, but making it so that the battery drained itself within a day after each charge, whether it was used or not. I therefore assumed the battery was the problem,

  • Iphone 4 doesn't power on

    i bought a apple iphone 4 yesterday. i came home and try to switch on the it dosen't get power on, i connected the charger and charged it for 8 hours still it dosen't turn on. can any body help me on this?????

  • MM:Tables

    Dear Gurus , I are creating a report for Purchase Register & for the documents which completed IR process I want to pront a Excise,VAT & other values of Import taxes in O/P, So I requst u to kindly inform me those tables & respective fields.. VSP