Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6FFA3200BB8 for ; Sat, 12 Nov 2016 23:03:14 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6E925160B00; Sat, 12 Nov 2016 22:03:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B8F88160AF5 for ; Sat, 12 Nov 2016 23:03:13 +0100 (CET) Received: (qmail 72401 invoked by uid 500); 12 Nov 2016 22:03:12 -0000 Mailing-List: contact users-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@flex.apache.org Delivered-To: mailing list users@flex.apache.org Received: (qmail 72385 invoked by uid 99); 12 Nov 2016 22:03:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Nov 2016 22:03:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 3352E1A000D for ; Sat, 12 Nov 2016 22:03:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.494 X-Spam-Level: ** X-Spam-Status: No, score=2.494 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, NUMERIC_HTTP_ADDR=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id BncVZFKUyV5F for ; Sat, 12 Nov 2016 22:03:09 +0000 (UTC) Received: from mail-qk0-f180.google.com (mail-qk0-f180.google.com [209.85.220.180]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 8FC095FBCF for ; Sat, 12 Nov 2016 22:03:09 +0000 (UTC) Received: by mail-qk0-f180.google.com with SMTP id x190so58389984qkb.0 for ; Sat, 12 Nov 2016 14:03:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=lW33DdcquP2Hlr9Us8VbNECB/jBZ3x2j9ptoOcj2MKQ=; b=VI6zCPxTVvRfPaTFK4yLupZelPa65X03P+0HZ75eanenzf7tUb/cyUl4+y48sMYGz5 0RJWEiUZ9SXYm4QoHP/VpqdUEnoNS4jEmdjCyHSZ1CHngczN3k1Fj+MyripyKItF3b6Q te4eEQBzhEJu2yh7QrFTJP2phUSjeMBK1bHIE6Ad1SjpUOL7lpmqKS/0/sR2fb26A/5n Xk8f8SKwhYV7yEikg8D74GrEMjvdDuls4m86pnJ1s0cCOrJ/YsHZRDFvsO53axaH5cXF g+9XNT3UwftjNJrX7mW2+6NMv7ArsgmhYfDOSRcjKv9bkiaXwl+mUFkE4gY6wQ0jYaft f0Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=lW33DdcquP2Hlr9Us8VbNECB/jBZ3x2j9ptoOcj2MKQ=; b=YWPc1/sREOGvmDuxeLa4iO8NqZaIEksNrZL+fHTIeENjvKKm5pDxmpoiQwbxTVIQLE h0NThSQLPMoD59zVHk4f7V55CbIDJ/difUdn2eBPBDlIz0vh8v9WzwXPzjn6WvKzv3Qa iJBtw4aiC/jf5SUCAoVqHV7t+2bRvnbrKaaJQcUt0QxZHpOHL9DukGjt/Cu6eJeAdDnI uzl4xy+UGbWIJ7ssro0aUK3McXwINZARp5qa5PSgIQ2V/IxJyEZquwg9BW+87fKbE3PT I117aM59Ld15Bgo8vulQIozGr3q00CPIfxRNXN29w8SVi/GLWxJkQ0SXhzG80DX/E5aK FMMw== X-Gm-Message-State: ABUngveFou3kg3ejnbw1f3gXs8AVNxd7OhmhdQLVEzSmVA571/mR9WRbfiwhqI2M6rQ7G/I5BfWl4zPCLSdjBw== X-Received: by 10.55.104.68 with SMTP id d65mr9861887qkc.119.1478988188829; Sat, 12 Nov 2016 14:03:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.171.21 with HTTP; Sat, 12 Nov 2016 14:03:08 -0800 (PST) In-Reply-To: <1478968057304-14106.post@n4.nabble.com> References: <1478968057304-14106.post@n4.nabble.com> From: Greg Dove Date: Sun, 13 Nov 2016 11:03:08 +1300 Message-ID: Subject: Re: FlexJS : AMFJS Class Mapping To: users@flex.apache.org Content-Type: multipart/alternative; boundary=94eb2c0578889f4e3b054121c505 archived-at: Sat, 12 Nov 2016 22:03:14 -0000 --94eb2c0578889f4e3b054121c505 Content-Type: text/plain; charset=UTF-8 Hi Prashant, The methods added to the reflection package were to support storing aliases (for class mappings) and also retrieving the class based on the stored alias. In the patient case the local alias would also be "org.blazeds.vo.Patient" I am not familiar with the approach you are using for deserializing the amf in js, but I expect the general approach should be something like this: a) identify the alias from the inbound amf data (seems like the _explicitType field in your data) b) retrieve the local class that corresponds to that alias and instantiate an instance using getClassByAlias method from the _explicitType value: var classToInstantiate:Class = getClassByAlias("org.blazeds.vo.Patient"); This class should have been already registered using registerClassAlias at some earlier point in time. c) populate the fields of that typed instance based on the value of the fields during deserialization. Ideally this should happen during deserialization directly into the new typed instance instead of creating one generic object during deserialization and then using it to subsequently populate the typed instance. If you are using a 3rd party library then unless it has support for the explicitType mappings (to retrieve from getClassByAlias) perhaps you will need to work from the object structure with the _explictType fields and recreate the typed object structure from it (again, it would be helpful if the library had some sort of mapping to avoid this 'double handling'). This could be more complicated if the inbound amf has instances with nested custom class fields, but should be straightforward for basic value object type scenarios (as per your Patient example). Hopefully that makes sense.... let me know if I can clarify any of the above. cheers, Greg On Sun, Nov 13, 2016 at 5:27 AM, PKumar wrote: > Hi, > > I am working on amfjs integration and it almost done. but i need to map the > java clas object to AS3 class object. I am getting the _explicitType from > BlazeDS side but could not map it with AS3 object. i also used the > registerClassAlias but nothing working. I attached the trace from chorme. > Please suggest how can i do it in FlexJS. > > > > > > ----- > Regards, > Prashant > -- > View this message in context: http://apache-flex-users. > 2333346.n4.nabble.com/FlexJS-AMFJS-Class-Mapping-tp14106.html > Sent from the Apache Flex Users mailing list archive at Nabble.com. > --94eb2c0578889f4e3b054121c505--