Returning an object that contains a collection WL 9.2

Hello,
I have a class like this:
public class data {
private Collection<MyObject> coll; //MyObject is another class
If I return this object from a web service call, i.e.
@WebService
public class HelloWorld {
     @WebMethod
public data hello() {
I get an error saying java class MyObject is not known, which makes sense, because I only declared "HelloWorld" to jwsc task.
How can I make this class known, by annotation etc.?
Someone suggested to use "IncludeSchema" in the jwsc task, but apparently that has been deprecated.
Thanks!
Edited by ghosh007 at 02/21/2008 12:59 PM
Edited by ghosh007 at 02/21/2008 1:23 PM

Hi,
As you have this "Artiicle" class, extend it to be serializable and then define an Array of type Artiicle. So the return type would be an Array of a complex type i.e. Articles. In WSDL there will be type that defines an Array and this type can be used as a return message for your methode.
Try this, I think it will help you.
Regards,

Similar Messages

  • I know the name of an object - how do I get the name of the object that contains it?

    If I have a Movieclip, I can trace the name of the Movieclip
    that contains it using the _parent property.
    With a generic object, is there a way to trace the name of
    the object that contains it?
    Please, please tell me - this will be a huge help.
    Thanks

    Thanks for these comments - my problem isn't with MovieClips.
    I need to know if there is something which is the generic Objects
    equivalent to the MovieClips _parent property.
    Here's some code that hopefully will help explain further:
    class MyClass extends Object {
    var myObject:Object;
    function MyClass (){
    myFirstObject = new Object();
    myFirstObject.theParent = this;
    private function getNameOfParent(p_object:Object){
    // Some code to return the name of the object that contains
    p_object
    trace(p_object.__proto__); // Output: [object Object]
    trace(p_object._parent); // Output: undefined
    trace(p_object.theParent); // Output: [object Object]
    return ???
    public function doSomething(p_num:Number){
    var parentName = getNameOfParent(myObject);
    // do some more action...
    Timeline code:
    var myClass1 = new MyClass();
    myClass1.doSomething();

  • Scaling an object that contains a gradient

    I'm working in Illustrator CS3. Got a question: I'm looking to scale an object that contains a gradient, but I want the position of the gradient to remain in the same position on the page. That is, I don't want the gradient to scale along with the object. Is it possible to do this without manually rebuilding the gradient?

    Normal scaling of an object (using the Scale tool, Transform or dragging the bounding box) will always scale the gradient too, but there is a sort of workaround if you know where the gradient starts and ends in the original.
    If you haven't already marked the beginning and end of your gradient, do so by pasting a copy of it in front (Cmd-F) and expanding the gradient - then you can see its start and end points when you turn off the preview. Mark what you need with guides and delete the expanded gradient. It's useful to make a guide that follows the angle of the gradient.
    Now draw a gradient-filled rectangle behind your object and get the gradient to match the angle and position of the gradient in your object by dragging with the gradient tool according to the guides.
    Having done this, copy and scale your object and change it into a clipping mask that masks the rectangle you just drew. Alternatively you can make a masking layer of your object if you know how to do that.
    Lock the rectangle (if you are using a normal clipping mask) and then you can move the object (which is now a mask) at will and the gradient will stay put.
    This is all a bit long-winded but please get back to me if you're lost :-)

  • Parsing a String object that contains the database details in jsp

    Hi All,
    In my project i have a model which is a bean that contains
    a method :-
    UserBean.java
    ....getUserData()
    //the database connection is written here.
    st.executeUpdate("insert ----------");
    In the servlet i am calling the bean,
    ControllerServlet.java
    UserBean ub=new UserBean();
    Object obj=ub.getUserData();
    session.putValue("something",obj); //Here the obj contains all the database datas that is used in insert query
    //By using RequestDispacher i am forwarding this request & the response
    to the jsp page
    ViewJsp.jsp
    String data=(String)session.getValue("something");
    //Here "data" now contains all the database contents that is stored using insert query in the bean
    From here i need to parse the "data" in order to display the contents
    stored in the string "data" in to a html table.
    Plz. do provide a solution for this.It is very Urgent at the moment.
    So that i will be very thankful to u.
    Thanx,
    contactananth

    ok, first of all, in getData, i assume you do a SELECT, not an INSERT,
    so your bean code should look like:
    ResultSet rs = st.executeQuery(...) // or somethig like that
    return rs; // it will contain the data you needand in the jsp you write:
    ResultSet rs = (ResultSet)session.getValue("something");
    instead of
    String data=(String)session.getValue("something");
    i assume you know how to work with a ResultSet

  • Creating objects that contain objects

    What's the best practice for creating an object from a table that contains a list of objects from another table? For example, say I have an employees table:
    EMPLOYEES
    id    name
    1     Derek Epperson
    2     Judy Johnsonand I also have an equipment table that contains all the equipment belonging to each employee
    EQUIPMENT
    id    emp_id   name
    101   1        Laptop Computer
    102   1        Flash Drive
    103   2        Desktop Computer
    104   2        Wireless RouterI want to create a Java function that will return create a List of two Employees, each with a List<Equipment> of that employee's equipment. One option is to create the Employees and then query for Equipment separately, like this:
    List<Employee> employees = myDAO.getEmployees();
    for (Employee employee : employees) {
      employee.setEquipment(myDAO.getEquipment(employee.getId()));
    }However, that is a lot of database calls. Is there an easy way to do this in a single query?

    By JOIN, you mean connect them so that a query will return something like this?
    EMPLOYEES
    id    name             equip_id   equip_name
    1     Derek Epperson   101        Laptop Computer
    1     Derek Epperson   102        Flash Drive
    2     Judy Johnson     103        Desktop Computer
    2     Judy Johnson     104        Wireless RouterThen I would have to check on each row whether the id had changed, a la:
    rs = ps.executeQuery(getEmployeesAndEquipmentJoin);
    int previousId = -1;
    Employee employee
    while (rs.next()) {
      if (rs.getInt("id") != previousId) {
        previousId = rs.getInt("id");
        employee = new Employee(rs);
        employees.add(employee);
      employee.getEquipment.add(new Equipment(rs));
    }That seems a little awkward, but if that's the best way to do it without ORM then I can work with that.

  • Trying to Clone an array object that contains other objects

    I have an employee object with the fields name (String), Salary (Double), and hireDay (Date). Since the date field contains many int fields (year, month etc..), using a straight clone will not work.
    What I want to do is copy an array of employees into a new array.
    For example:
    Employee [] newEmps = (Employee[])OldEmps.clone()
    In the employee class, I implement the Cloneable interface and my code so far will copy one Employee. How do I change this to copy an array of empoyees? Specifically, since hireDay contains many fields, a straight super.clone of the array won't work. Here is my clone code:
         public Object clone()
         try {
              // call Object.clone()
         Employee cloned = (Employee)super.clone();
              // clone mutable fields
    cloned.hireDay = (Date)hireDay.clone();
         return cloned;
         catch (CloneNotSupportedException e)
         { return null; }
    Any help is appreciated. Thanks!
    -Eric

    There's so much I don't understand about that, it just
    isn't worth asking. Let me spell out my previous post
    since it seems to have gone right over your
    head.Employee[] emps;
    // here you fill in the array of Employees
    Employee[] clonedEmps = new Employee[emps.length];
    for (int z=0; z<emps.length; z++) {I understand this next line of code. My question lies within the clone() function
    clonedEmps[z] = emps[z].clone();OK - Let me try to clear things up. If we take from your example the original array "emps". Now for me, emps, is already filled up in main().
    So in main() when I call emps.clone(), my clone function starts running:
    // the employee class (which I created) implements the Cloneable
    // interface
    // This clone function is inside my employee class
    public Object [] clone()
    try {
    Employee [] cloned = (Employee)super.clone();
    // IS THIS NEXT LINE OF CODE REQUIRED TO MAKE A DEEP COPY? IF SO, How would I implement perhaps a for loop that would copy the hireDay from each element in the original array to the elements in the the new array?
    // Obviously, each employee (element in the array) has a hireDay
    // Please modify this next line of code to show me how.
    cloned.hireDay = (Date)hireDay.clone();
    return cloned;
    catch (CloneNotSupportedException e)
    { return null; }
    If I wanted to access say the "hireDay" field of the 3rd element in the original employee array INSIDE THE CLONE FUNCTION - then how would i access it?
    Thanks
    -Eric

  • How can I call a method of an object that is stored in an ArrayList?

    Hello,
    I am working on a simple game.
    I have my own collection class that can contain some Brick objects.
    That class looks like this:
    class MyCollection<Brick>
          ArrayList<Brick> list = new ArrayList<Brick>();
          public void add(Brick obj)
                list.add(obj);
         public int get(int i)
                return list.get(i);
         public int length()
               return list.size();
    }My Brick class is abstract and contains this method:
    public abstract int getXpos();That method is overridden by the subclass Brick_type1 (which, of course, extends Brick) and returns an int.
    In my main class I try to call the getXpos() method but I cannot call if for an unknown reason:
    MyCollection mc = new MyCollection<Brick>();
    Brick_type1 bt = new Brick_type1(10);
    mc.add(bt);
    for(int i = 0; i<mc.length(); i++)
                System.out.println(bc.get(i).getXpos());   // getXpos() does not exist, says the compilatorbc.get(i) should return a Brick that contains the getXpos() method, so why can´t I call it?

    Roxxor wrote:
    Sorry, it should be:
    public Brick get(int i)
    return list.get(i);
    }...so it actually returns a Brick, but I still cannot call the getXpos() method for some reason.Is this also just a typo?
    MyCollection mc = new MyCollection<Brick>();

  • Returning cloned objects from EJB Local Interfaces

    We'd like to let our WAS 5/J2EE container manage our transactions/unit of work. However, we don't want to have our objects serialized, so we intend to use LocalInterfaces. Additionally, we want to return value objects that support Toplink indirection such that we are not returning the actual cache object but instead a clone.Our question is, how do we return a cloned object that supports indirection from Toplink that we can later do a deepMergeClone on in an explicit update method?

    Additional Information on the first post:
    The pattern we've been testing is as follows:
    1. We set up LocalInterfaces on our EJB's
    2. The EJB Getters are using acquireNonSynchronizedUnitOfWork() to get a NON-JTS transaction to perform a readQuery. This results in a Cloned Bis object being generated. We then release the UOW and return the object.
    3. The Returned Biz object Getters are using Indirection (probably using the released non-synchronized UOW).
    4. The pattern for UPDATE is that we allow the Web Container code (servlet) to change the Cloned Biz Object, they then submit the CLONED and changed object to an EJB update() method where we use getClientSession().getActiveUnitOfWork() to link to the JTS transaction and perform a uow.deepMergeClone(bizObjectClone);
    We are trying to use the pattern for the following reasons:
    1. Isolation of the Cache to upper layers
    2. Transaction Boundry is the EJB Container
    3. We understand that there is a performance overhead with CLoned Biz Objects but this more mirrors the ValueObject Pattern then anything else we've tried.
    BIG Question:
    1. Is this a supported TopLink Pattern?
    2. If its not supported, can it be?
    3. Do you have any other suggested patterns?

  • Returning Business Objects to View?

    All,
    I was just in a meeting where two different approaches to returning data to the view were discussed.
    In a nutshell, here are the two options presented:
    1) The service layer should return the Business Entities entirely (which happen to be Hibernate objects).
    2) The service layer should return an object thats specific to the process at hand and contains only the data needed for that process.
    We will have multiple clients invoking the service both remote, and local.
    My preference is to go with option 2.
    What are your thoughts?
    Thanks in advance,
    KL

    If you had not mentioned the words "Hibernate object", I would have been agnostic. However, IMO, these should be considered persistence tier objects. While there is a 'lazy-load view' pattern, there is also much discussion as to whether this is a good idea. For example, if I call a getter on a Hibernate object within the view, it may invoke a complex series of database operations to fetch a graph of dependent child objects.
    IMO, it is the responsibility of the controller to ensure that the view has all model data required to render properly.
    There is one further point to consider, only tangentially related to your original topic. Hibernate objects, generally, will correspond more strongly to the persistence scheme than the actual ideal OO model you might have designed separately. True, for the vast majority of model->persistence mappings, this will be 1 to 1. However, for the 20% of the system where this is not the case, you really do want to use a full-fledged model object.
    So, couple with what, to me, is dangerous--having a view implicitly lazy-load data--with the fact that a HIbernate 'object model' is really more of a 'table-model', I would advise against option #1.
    - Saish

  • Extract node(s) that contain a particular text

    Hi,
    I have a XML document (stored in CLOB) and I want to search for a text within the document and I want it to return ALL nodes that contain that text (%text%).
    One more thing: I don't know the xml structure.
    Any idea?

    I want it to return ALL nodes that contain that text (%text%).Hope this gives you the clue:
    SQL> with t as (
      select xmltype('<a><b>Some text</b><c>Not a test</c><d>Some other text</d></a>') xml from dual
    select xmlquery ('//*[ora:matches(text(),"text")]' passing t.xml returning content) matches from t t
    MATCHES                                  
    <b>Some text</b><d>Some other text</d>   
    1 row selected.

  • Reflecting updates to a ListCell that contains a mutable object

    Hi,
    I've seen many variants of this question, but unfortunately have not found the desired answer, so I thought to ask here. Apologies if missing something obvious!
    Objective:
    I start individual Tasks in batches. A ListCell reflects each Task, from initial request to eventual result. More batches can be submitted while one set is processing. When all processes of any batch is finished, they will eventually disappear from the ListView.
    As a result, I want a ListCell to reflect a Task, and reflect the transition from initial conception to eventual outcome.
    Predicament:
    I currently try this with an ObservableList of my own POJOs, each reflected using a custom ListCell extension.
    I have achieved this result, but it does not feel correct. First of all, I read that it is best practice not to change an ObservableList's objects under its feet. However, I have multiple threads working against the same list. With objects being added, removed and updated, it seemed safer to update the referenced object rather than try to manage synchronization to prevent concurrent modification issues. After all, I'm not really adding a new item, I'm wanting to update the representation of an item that is now in a finished state.
    Attempt details:
    I have achieved this by constructing an 'observableArrayList' with a Callback extractor. This Callback call method provides an Observable array containing an ObjectProperty, the property being a member variable of my POJO used in each ListCell. Each Task updates this object property with some result information at the end of its processing. This I believe ensure that change listeners are notified of updates to this POJO, via its ObjectProperty. (https://javafx-jira.kenai.com/browse/RT-15029)
    The ListCell constructed with this POJO is listening for updates, but I believe this is really to reflect additions and removals on the ObservableList that the ListView represents. However, in the case of updates, the private implementation of the ListCell updateItem method (javafx.scene.control.ListCell#updateItem) does not call the overridable updateItem method. This is because the object that caused the update is seen as equal to the object the ListCell currently holds (they're the same instance, so this is true). However, if the overridable updateItem method is never invoked, I can't get the custom ListCell to update its representation of the ListCell object that has changed since its last representation was rendered.
    If I make my custom POJO always return false in its overriden equals method, the overridable updateItem method is invoked and I get the opportunity to detect the change in the object and render a new representation. This works, but this feels wrong and like a hack.
    Can anyone help point me at the correct way of doing this please? Happy to provide more information if needed.
    Thanks,
    Louis

    If the changes in the ObservableList are to be reflected in the UI, you need to make these changes on the JavaFX Application Thread. Ensuring this happens (using Platform.runLater(...) if necessary) will also prevent any concurrent modification issues.
    I would approach this by binding the text property or graphic property (or both) of the custom ListCell to the appropriate properties of your POJO. Here's a simple example where I have a list view displaying a bunch of "counters" which count in a background thread. The cell display is updated when the state of the task changes. I introduced a counter property (which is a bit redundant; I could have used the progress property or message property) to demonstrate updating a property on the FX Application thread using Platform.runLater(...).
    Because ListCells can be reused, you need to account for the fact that the item (task) displayed may change during the lifecycle of the cell. You can do this using a listener to the itemProperty (which is what I did), or by overriding the updateItem(...) method.

  • Is there a way using lab view objects to let an object that is contained within another object get access to its owner?

    I've been playing with lvoop for 4 or 5 months now, and in general I like it very much, but I've repeatedly wanted to build classes that know something about who owns them and I can't figure out how to make this happen.
    The simple example I've been thinking about is imagine having a person class which contains a car class. Now say that I get an instance of a car class and I want to ask it who its owner is. In C++, I'd do this by giving the car class a pointer to the person class it belongs to. (Of course you have to worry about car objects that don't belong to anyone in which case the pointer has to point to NULL.)
    I've tried copying this idea by giving the car class a data value reference to a person class, but when I dereference the reference using an in place loop and call a method on it I get data from the moment the reference was made and not the current data of the person class.
    I realize this is sorta breaking data flow so maybe it's not possible on purpose?

    Scot18 wrote:
    I've tried copying this idea by giving the car class a data value reference to a person class, but when I dereference the reference using an in place loop and call a method on it I get data from the moment the reference was made and not the current data of the person class.
    Yes, LVOOP uses value based references, and when you split the wire to write the owner you created a data copy. The function you're after requires you do use a DVR for all class functions in which case you'll get reference based OOP, which is more familiar coming from text based OOP.
    It just so happens that G# uses that approach, take a look at it.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • Is there any object in labview that contains a list of data for the user to select (selection one at a time) or add a new data?

    Is there any object in labview that contains a list of data for the user to select (selection one at a time) or add a new data?

    List and table controls -> listbox..is that what you are thinking of?
    The listbox presents the user with a list of options, and you can set it to only accept one selection at a time...Adding new data to the list can not be done directly by the user but if you make e.g. a text control and a button you can programatically insert new objects described in the text box when the button is pressed...(see example).
    If you need more than one column you have the multicolumn listbox. If you want the users to write new entries directly yu can use a table and read selected cells using it's selection start property to read what cell has been selected.
    MTO
    Attachments:
    Listbox_example.vi ‏34 KB

  • Problem retrieving data that contains special characters in Collections

    Hi fellow Apexers,
    If I load strings that contain characters such as ":" or "," into a collection and then read the data back off the collection into page items via URL e.g.
    f?p=&APP_ID.:4:&SESSION.::&DEBUG.::P4_INJURED_FIRST_NAME,P4_INJURED_OTHER_NAME,P4_INJURED_SURNAME,P4_INJURED_SHOP_NO,P4_INJURED_BUILDING,: #SEQ_ID#,#C001#,#C002#,#C003#,#C004#,#C005#
    the data after the ":" or "," gets screwed up and ends up in the wrong fields. How do I escape these characters?
    I have tried using a replace statement when inserting into the collection e.g.
    BEGIN
    IF htmldb_collection.collection_exists('INJURED_PERSON') = FALSE THEN
    htmldb_collection.create_collection( p_collection_name => 'INJURED_PERSON');
    htmldb_collection.add_member(p_collection_name => 'INJURED_PERSON',
    p_C001 => :P4_INJURED_FIRST_NAME,
    p_C002 => :P4_INJURED_OTHER_NAME,
    p_C003 => :P4_INJURED_SURNAME,
    p_C004 => :P4_INJURED_SHOP_NO,
    p_C005 => replace(:P4_INJURED_BUILDING,':','')
    etc.........
    but I just don't want to have nested replace statements. Also I'll loose "," and ":" when I retrieve the back off the collection
    Does anyone know of a better workaround?
    Regards
    Paul P

    Hi Paul,
    Apex uses colons in the url to separate the parameters. You could replace these with another character (for example, ~) and then have a Before Header page process on the second page that converts that back again.
    However, as a collection is available until you clear it or log out, you could just pass the SEQ_ID and get the second page to retrieve the values directly into the page items
    Andy

  • Had the sudden appearence of a "books" folder that contains the Kindle app.  How do I get rid of this folder and return to just the Kindle app icon on the screen?

    I have an iTouch. I do not remember exactly what happened, but I now have a folder labeled "Books" that contains my Kindle app.
    Previously, I simply had the Kindle app on the home screen.
    How do I remove the Books folder and return to the previous setup, i.e. just the Kindle app on the home screen?

    Is there another app in the folder like the iBooks app?  Yu can move two apps together and when they combine and be placed in a folder.  Itunes will guess/suggest a folder name and you can change it.  If there are tow apps in the folder just go to that folder and touch and hold the an app and after they start wiggling mode one app out side the folder and folder will disappear if there were only two apps in the folder.  To stop the wiggling depress the Home button once.

Maybe you are looking for