Hi Imtiyaz,

Thanks for replying,

At the end of this post, I will write the flexproductdata.as and
flexproductdata.java classes.
Before that I have to clarify some points from you.

1) In order to run any flex program in existing webapplication, What
steps I need to followed?
- The steps that i followed are,
        a) I have downloaded a sample program which was deployed on
jboss from net.
        b) From that sample program, I copied flex folder to my
application under WEB-INF folder, Copy the lib files related to flex
in to lib directory of my application and done some changes related to
flex entries in existing web.xml.
2) How to find out the version of LCDS(flex folder) which I copied to
my existing web application?

-See I called getData method of the webservice and that method returns
me the list of FlexProductData object.
See the getData method of the webservice with its package structure.

package com.tdemand.server.service.productthreshold;
public class ProductThresholdsSerivceImpl implements
ProductThresholdService{

public List getData() throws AuthorizationException,
StartIndexOutOfBoundsException {
                   logger.debug("***************started getData method of
productthresholdspojoserviceimpl");
                   ArrayList list = new ArrayList();
                   FlexProductData fproddata= new FlexProductData();
                   fproddata.setProductId(10);
                   fproddata.setName("kitkat");
                   fproddata.setPrice(10.25);
                   fproddata.setDescription("nice chocalate");
                   fproddata.setCategory("category");
                   list.add(fproddata);
                   return list;
        }
}

See below code for FlexProductData.as


package
{
import flash.net.registerClassAlias;
        public class FlexProductData extends Object
        {
                        var productId:int ;
                        var name:String;
                        var description:String;
                        var category:String;
                        var price:Number;
        }
}


I have copied the FlexProductData.as in my jboss. I really do not know
where to copy the as file in jboss. I tried it by copying it in the
same directory where my mxml file was present but it did not work.

One more thing Imitiyaz,
I could run the program which was mentioned in my previous post
through flex builder but if I copy the same program in jboss , it was
showing me the same error i.e. invalid type flexproduct etc. and that
is why i want to know from you, what are the steps that i need to
follow. How can I sure that in the jboss , I am using latest version
of LCDS?

Could you please guide me on this? Thanks.

Regards,
chandan



On Sep 28, 10:21 pm, imtiyaz <[EMAIL PROTECTED]> wrote:
> First of all sorry for the late reply, I was in journey from last two
> days,
> Ok lets come to the point,
> This is definetly not with LCDS version,
>
> Second I want to know  the code of your FlexProductData.as file from
> its package and I want to know about the your java class package
> structure.
> Did you copied the swf file into JBOSS or you copied the source...
> just want to know how you are deploying the application.
>
> Did you copied... the FlexProductData.as file also into JBOSS !!!!
>
> Regards,
> Imtiyaz Basha M S
>
> On Sep 26, 1:08 pm,chan<[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi Imtiyaz,
>
> > Thanks a lot, I could run the application through flexbuilder.
>
> > Imtiyaz, I am using flexbuilder( Latest free trial version) as a tool
> > to develop the flex program and after program runs succesffully
> > through flex builder , I copy it to my jboss applciation and try to
> > run it.
>
> > First think, the code you have given me in last post is changed to as
> > follows in order to run it through flexbuilder.
>
> >  <mx:Script>
> >                 <![CDATA[
> >                 import mx.controls.Alert;
> >                 import mx.rpc.events.ResultEvent;
> >                 import mx.collections.ArrayCollection;
> >                  private function
> > displayPersonDetails(event:ResultEvent):void
> >                         {
> >                         var myAc :ArrayCollection = new ArrayCollection();
> >                 var fpd:FlexProductData = null;
> >                 var list:ArrayCollection = new ArrayCollection();
> >                 list=(ArrayCollection)(event.result);
> >                 var fdata:Object;
> >                 for(var i:int = 0;i< list.length;i++){
> >                         fdata =Object(list.getItemAt(i));
> >                         Alert.show(fdata.name);
> >                         myAc.addItem(fdata);
> >                 }
> >                Urdg.dataProvider = myAc;
> >                         }
> >                 ]]>
> >         </mx:Script>
>
> > The purpose of type casting the list object to Object(flex object)
> > that It was showing me the same error if i type cast to
> > FlexProductData object of FlexProductData.as class.
>
> > Initially above code will be fine for me now. We can solve that
> > problem later on , as I may have place .as file in wrong directory or
> > somethink is missing.
>
> > Problem is that If I run the same program thorugh jboss application,
> > it is giving me the same error i.e.
> > RPC Fault faultString="Cannot find type for: FlexProductData"
> > faultCode="DecodingError" faultDetail="null"]
> >         at mx.rpc.soap::Operation/http://www.adobe.com/2006/flex/mx/
> > internal::processResult()
> >         at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/
> > internal::resultHandler()
> >         at mx.rpc::Responder/result()
>
> > I  can run other flex program through jboss but am understanding why
> > the same program which runs in flexbuilder is not running in jboss.
>
> > My prediction is that, running the flex program thorugh flex builder
> > might be using different version of LCDS and the one which is there in
> > jboss is different.  I do not know how to find out the difference
> > between these 2 version.
>
> > Could you please guide me where i am doing wrong think? and if
> > possible let me know also how to create the flexproduct data and where
> > to put it in jboss?
>
> > Once again I would thank to you as we are very much closer to solve
> > the problem.
>
> > Let me know if you need more details on this.
>
> > Thanks,
> > chandan
>
> > On Sep 25, 3:51 pm, imtiyaz <[EMAIL PROTECTED]> wrote:> First Note : Add a 
> > handler to your webservice result event. in the
> > > handler w
>
> > > Point 1 :  your webservice is returning ArrayList which flex will die
> > > to understand :) , So the type cast it using ArrayCollection.
> > > Point 2 : your arraylist (result) contains collection FlexProductData,
> > > here again flex will die to understand. so Create a similar action
> > > script class in Flex, and use it.
>
> > > pacakage your.package.name{
>
> > > public class FlexProductData {
> > >           public var productID : int ;
>
> > >      fproddata.setProductId(10);
> > >                    fproddata.setName("kitkat");
> > >                    fproddata.setPrice(10.25);
> > >                    fproddata.setDescription("nice chocalate");
> > >                    fproddata.setCategory("category");
>
> > > }
>
> > > On Sep 25, 12:04 pm,chan<[EMAIL PROTECTED]> wrote:
>
> > > > Hi Imtiyaz.m.s ,Anubhav
>
> > > > Thanks for your response,
>
> > > > I am understanding what you are saying. But as I am new to this
> > > > technology, I am not understanding of what type of class I should
> > > > write so that it can be type casted with FlexProductData. Is it
> > > > actionscript class that you were talking about?
>
> > > > I will let you know what exactly my webservice returns,
>
> > > > See after calling the getData method of the webservice mentioned
> > > > above, it goes to getData method of the webservice. Please see the
> > > > getData method below.
>
> > > > public List getData() throws AuthorizationException,
> > > > StartIndexOutOfBoundsException {
> > > >                    ArrayList list = new ArrayList();
> > > >                    FlexProductData fproddata= new FlexProductData();
> > > >                    fproddata.setProductId(10);
> > > >                    fproddata.setName("kitkat");
> > > >                    fproddata.setPrice(10.25);
> > > >                    fproddata.setDescription("nice chocalate");
> > > >                    fproddata.setCategory("category");
> > > >                    list.add(fproddata);
> > > >                    return list;
> > > >         }
>
> > > > This result I want to show on ui using above flex program i.e.
> > > > <?xml version="1.0" encoding="utf-8"?>
> > > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> > > >  backgroundColor="#FFFFFF">
> > > >          <mx:WebService id="srv" wsdl="http://localhost:8080/
> > > > tdemandweb/
> > > >  services/ProductThresholdService?wsdl" showBusyCursor="true"   />
> > > >          <mx:DataGrid dataProvider="{srv.getData.lastResult}"
> > > > width="100%"
> > > >     height="100%">
> > > >                  <mx:columns>
> > > >                          <mx:DataGridColumn dataField="name"
> > > > headerText="Name"/>
> > > >                          <mx:DataGridColumn dataField="price"
> > > > headerText="Price"/>
> > > >                          <mx:DataGridColumn dataField="productId"
> > > > headerText="productId"/>
> > > >                          <mx:DataGridColumn dataField="description"
> > > > headerText="description"/>
> > > >                          <mx:DataGridColumn dataField="description"
> > > > headerText="description"/>
> > > >                  </mx:columns>
> > > >          </mx:DataGrid>
> > > >          <mx:Button label="Get Product Data" click="srv.getData()"/>
> > > >  </mx:Application>
>
> > > > Now, please let me know where to write the compitible FlexProductData
> > > > class and if possible how?
>
> > > > and how to use that class in my flex program?
>
> > > > Please let you know if you  need any other information from my side.
>
> > > > Regards,
> > > > chandan
>
> > > > On Sep 24, 10:28 pm, imtiyaz <[EMAIL PROTECTED]> wrote:
>
> > > > > Yes anubhav is on right track,
> > > > > From the error its clear that you are returning FlexProductData
> > > > > object, when it reaches to Flex it tries to type cast it with the type
> > > > > you are using, here is the problem. so solution create a similar as
> > > > > class and type cast it with that.
> > > > > If you already doing that please check property types in both flex and
> > > > > java, java should contain as compatible data types, else it will
> > > > > throws the TypeCasting error.
>
> > > > > Regards,
> > > > > Imtiyaz.m.s
>
> > > > > On Sep 24, 10:21 am, anubhav_RIA <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hi chandan,
>
> > > > > > From the error it seems like your call to the wsdl is succeessfull 
> > > > > > but
> > > > > > the problem seems to be somewhere in the type casting the values
> > > > > > returned from the wsdl. it says it throws exceptin in the
> > > > > > resultHandler function of the AbstractInvoker. try to locate where 
> > > > > > you
> > > > > > are using FlexProductData type object.
>
> > > > > > Only then this problem can be nail down.
>
> > > > > > Regards,
> > > > > > Anubhav
>
> > > > > > On Sep 23, 9:10 pm,chan<[EMAIL PROTECTED]> wrote:
>
> > > > > > > Hi All,
>
> > > > > > > I am using jboss-4.2.2.GA as the application server. I have copied
> > > > > > > flex data service i.e. flex folder contianing its jar
> > > > > > > file ,configurationf files etc under web-inf folder of my
> > > > > > > project.Similary flex related entries are added in web.xml.
>
> > > > > > > I am trying to invoke webservice through following code
> > > > > > > <?xml version="1.0" encoding="utf-8"?>
> > > > > > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> > > > > > > backgroundColor="#FFFFFF">
> > > > > > >         <mx:WebService id="srv" 
> > > > > > > wsdl="http://localhost:8080/tdemandweb/
> > > > > > > services/ProductThresholdService?wsdl" showBusyCursor="true"   />
> > > > > > >         <mx:DataGrid dataProvider="{srv.getData.lastResult}" 
> > > > > > > width="100%"
> > > > > > > height="100%">
> > > > > > >                 <mx:columns>
> > > > > > >                         <mx:DataGridColumn dataField="name" 
> > > > > > > headerText="Name"/>
> > > > > > >                         <mx:DataGridColumn
>
> ...
>
> read more »- Hide quoted text -
>
> - Show quoted text -

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to