Problem with Vector.contains

Hello,
I wrote this code but it doens't work; but it should
public class Word {
     public Word(String v) { _value = new String (v); }
     public Word() { _value ="";  }
     String _value = null;
     public boolean equals(Object obj) {
          if(this == obj)
               return true;
          if((obj == null) || (obj.getClass() != this.getClass()))
               return false;
          Word word = (Word)obj;
          return _value != null && _value.equals(word._value);                         
     public int hashCode() {
          int hash = 7;
          //hash = 31 * hash + num;
          hash = 31 * hash + (null == _value ? 0 : _value.hashCode());
          return hash;
public class MyDictionary {     
     private Vector<Word> _words = new Vector<Word>();     
     Vector<Word> getWord() { return _words; }
//other class
MyDictionary dic = new MyDictionary();
                                List< String > _testDoc = new ArrayList< String > ();
                                //fill _testDoc
                                Iterator<String> iter = _testDoc.iterator(); /
                                for (int i=0; iter.hasNext(); i++ ) {
                           if ( dic.getWord().contains( new Word( iter.next() ) )) {
                            System.out.println("......................................");
                                 }I assure you (because I saw it) that _testDoc has words contained in dic; instes that if is never executed; probably I'm missing something simple....
thanks
Edited by: mickey0 on Aug 17, 2009 10:45 AM

mickey0 wrote:
Hello,
I wrote this code but it doens't work; but it shouldIf it "doesn't work", then it's not supposed to work.
mickey0 wrote:
I assure you (because I saw it) that _testDoc has words contained in dic; instes that if is never executed; Can you post an SSCCE that shows this?
mickey0 wrote:
probably I'm missing something simple....This remark contradicts your earlier claim that it should work.

Similar Messages

  • Problems with OLE Container in QUERY

    Hi all,
    I have problem with OLE Container when I am trying to retrieve data from the database. Inserting is no problem and commit is done. I am doing it with
    initialize_container('block.ole_object','C:\test.doc');
    I have only one column of BLOB type and it is last in the block as it was suggested somewhere on the forum.
    When I am trying to retrieve the already inserted data I get error with the following
    Description:
    FRM-40505: Oracle ERROR: unable to perform query and CTRL+F1 says the following:
    ORA-00932: inconsistent data types: expected got
    The forms and the database are as follow:
    Forms [32 Bit] Version 6.0.8.24.1 (Production)
    Oracle Database 10g Enterprise Edition Release 10.1.0.4.2 - Production
    I need immediate help!!!

    This may be related to the 10g database, I'm not sure as there is no way for me to test it. I know that it works with a 9i database.
    One thing to check is to make sure that you don't have the FORMS60_DISABLE_DESCRIBE set to 1 within the Oracle registry.
    If this doesn't work, your only option might be to use a LONG RAW instead of a BLOB column type in the database.

  • Problem with non-container managed entity manager

    i am working on a project, in which i am using entity beans.i use netbeans, glassfish as application server and toplink as persistence provider .
    i created a java class that handles all the operations with the entitys, which means i using non-container managed entity manager.
    in the constructor
    try{
                EntityManagerFactory emf = Persistence.createEntityManagerFactory("voidPU");
                entityManager = emf.createEntityManager();
            catch(Exception ex){
                throw new EJBException(ex.getMessage());
            }then i call a function in this class from a servlet
    the code of the function
    List users = null;
            try {
                ProgLanguages progLanguage = entityManager.find(ProgLanguages.class, languageId);
                users = (List) progLanguage.getUserIdCollection();
            catch(IllegalStateException illegalStateException){
                throw new EJBException(illegalStateException.getMessage());
            catch(IllegalArgumentException illegalArgumentException) {
                throw new EJBException(illegalArgumentException.getMessage());
            }i got an IllegalArgumentException saying Unknown entity bean class: class vanguard.server.entity.ProgLanguages, please verify that this class has been marked with the @Entity annotation
    what confuses me is that sometimes it works and most of the time it does not work, have i made anything wrong?, or there is a problem with any of the tools netbeans, glassfish, or toplink?

    Is it always the same entity that is reported as 'unknown' ? You mention that it works sometimes but is it the same deployment and the same code that works? The first thing I would verify is that the ear is being created as expected by netbeans. Check the persistence.xml file and verify that all of the classes are listed that will be used as entities.
    --Gordon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Problem with same Container for 2 different outputs

    Hi,
    I am using method set_table_for_first_display to display 2 different output with same container depending upon the selection of radio button. but the problem I am facing is when I click BACK button after dispaying second output and executing first output, it is showing prebious output only. is there any method to handle this problem?
    Regards,
    Nilanjana

    Hi,
    On clicking back use leave to screen 0 in the PAI module of the screen.
    Call screen 100.
    PROCESS BEFORE OUTPUT.
    Logic
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND.
    MODULE USER_COMMAND INPUT.
    IF sy-ucomm EQ 'User command defined for BACK button'.
    LEAVE TO SCREEN 0. "Go back to selection screen
    ENDIF.
    END MODULE.
    Have a look at the method FREE of class cl_gui_alv_grid.
    eg:
    CALL METHOD wcl_alvgrid1->free
      EXCEPTIONS
        cntl_error        = 1
        cntl_system_error = 2
        OTHERS            = 3.
    Thanks,
    Vinod.

  • HELP-Problem with Vector type in Applet

    Hi,
    I am writing an Java applet which uses Vector. It won't run in IE browser, simply does not respond.
    However, when I tested the program using Appletviewer it runs prefectly.
    Is there a way to make Vector work in applet ?
    I have investigated the code and I'm pretty sure it's the Vector that causes problem in the applet.
    Pls your idea. Thanks.
    Hadi

    Hi,
    I use Applet, not JApplet. There are 3 deprecated things in this applet (mouseDown, keyDown, action) but I have used them all in my previous applet with no problem at all.
    I suspected the problem is Vector related by inserting several showDialogs as below:
    showDialog("1111");
    t.clear();     // to clear the vector
    showDialog("222222");
    I can see that the applet displays the 1111, but does not display 222222 at all. It seems like it simply ignores all commands after the first showDialog. Therefore, I suspect the t.clear() as the source of problem. But it does not display any error.
    't' is defined at the top as:
    static Vector t = new Vector();
    And t is manipulated by such: t.add(new Task()); and other regular Vector methods in jdk 1.3. I also checked that there is no deprecated methods for Vector from 1.2 to 1.3.
    I use MS Internet Explorer to run my applet.
    Any other things I should check ?
    Thanks.

  • Having problems with plugin-container.exe!

    The Plugin-container.exe is causing firefox to crash after every page load. I have isolated it as the root cause because every time I terminate the process firefox starts working again.

    It's possible that you are having a problem with some Firefox add-on that is hindering your Firefox's normal behavior. Have you tried disabling all add-ons (just to check), to see if Firefox goes back to normal?
    Whenever you have a problem with Firefox, whatever it is, you should make sure it's not caused by one (or more than one) of your installed add-ons, be it an extension, a theme or a plugin. To do that easily and cleanly, run Firefox in [http://support.mozilla.com/en-US/kb/Safe+Mode safe mode] (don't forget to select ''Disable all add-ons'' when you start safe mode). If the problem disappears, you know it's from an add-on. Disable them all in normal mode, and enable them one at a time until you find the source of the problem. See [http://support.mozilla.com/en-US/kb/Troubleshooting+extensions+and+themes this article] for information about troubleshooting extensions and themes and [https://support.mozilla.com/en-US/kb/Troubleshooting+plugins this one] for plugins.
    If you need support for one of your add-ons, you'll have to contact its author.
    If the problem does not disappear when all add-ons are disabled, please tell me, so we can work from there. Please have no fear of following my instructions to the line, as all can be easily undone.

  • Problems with resizable container

    Hi,
    I have a resizable JPanel with cubes inside it.
    The problem is when I resize the JPanel the cubes inside it gets resized only after I move the borders of the JPanel ~14 pixels...
    The problem is in the X axis...
    The Y axis "jumps" every ~5 pixels...
    I need content of the JPanel also to resize every 1 pixel (so it would be on the borders of the JPanel)...
    Any Ideas?

    I guess that the only solution is NOT to use gridLayoutWell that would explain the behaviour. It would have been nice if that information was included in the original question. Thats why I always ask for a SSCCE, since you never no what information is importan or not.
    All components in a GridLayout have the same size. So if you have a Grid with 10 component that is 400 pixels wide each component will be 40 pixels wide. As suggested above the size of each component will only be adjusted when you incread the width by 10 or more (since you have 10 components in each row).
    Doing it manually would also be a pain. If you increase the width by 1 pixel you would only be able to increase the size of one component. Then if you increase it by one pixel again you can only change one component, so do you change the first one again or the second. So now you need an algorithm to determine which component gets the extra space.
    I need content of the JPanel also to resize every 1 pixel (so it would be on the borders of the JPanel)...Don't know exactly what your layout is like, but maybe you could center the panel in the frame. That way as you change the size the "border" will change on both sides and it may not look as bad.
    You can try using a BoxLayout. Components will grow as the size is increased but I think you might have problems with the first components always growing first.

  • Problems with vectors

    Hi,
    In response to an earlier problem i posted which i thought i had resolved i have to ask some more advice as i am still having problems.
    Basically i have two points (0,0,0) and (1,1,1) where two spheres are located, im trying to connect a cylinder to these spheres. I have tried using Pythagoras theorem and this connects the spheres up perfectly if the z value is assigned to 0 when i use the rotZ() method with the resulting angle. What i would like to know is there any way of connecting the spheres with 3 coordinates for x,y,z using the same method.
    The main formula i was working on was after connecting up the spheres in just 2 dimensions (ie z value equal to 0) as i mentioned earlier, was to calculate the length of the hypoteneus and have the z value divide this (ie using Pytagoras' theorem again tan teeta = z2-z1/c where c is the sqrt(x*x+y*y) ). Once i got this angle i then rotated it around the Y axis (im not sure if i am actually rotating it around the correct axis, i know that i also have to rotate around the X axis a certain degree but i dont know how much) however the spheres still did not connect up.
    Is it possible to do it the above way or do i need to do i need to use all vector calculations (dot, cross products etc) which i would prefer to stay away from?
    Sorry if it is not very clear it is kind of hard to explain!
    Any help would be greatly appreciated because it is really driving me nuts.
    Regards
    Andy

    Hi
    Just putting up the code to show how i am figuring out the angles and what rotations im using
              double tanTeetaXY = (y-0.0f)/(x-0.0f);
                   double teetaXY = Math.atan(tanTeetaXY);
                   double tanTeetaXZ = (z-0.0f)/(x-0.0f);
                   double teetaXZ = Math.atan(tanTeetaXZ);
                   double testang = (y-0.0f)/(z-0.0f);
                   double teetatest = Math.atan(testang);
                   rotate.rotZ((Math.PI/2.0f)-teetaXY);
                   temprotate.rotY(teetaXZ);
                   rotate.mul(temprotate);
                   temprotate.rotX(teetatest);
                   rotate.mulInverse(temprotate);
                   rotate.invert();Am i completely off with this or is there a better way to figure things out does anyone know? I just cant get my head around it!
    Much appreciated
    Andy

  • Creation of an event : problem with the container

    Hi Gurus,
    I'm facing a problem in creation of an event.
    I'm in SAP ECC 6.0 for a migration project from 4.6B
    In an ABAP program I'm trying to create an event in order to launch a workflow.
    1st step : Set datas in the container -> In INTERNAL_TABLE I have 5 lines.
    swc_set_table event_container 'INTERNAL_TABLE' t_cnp_container.
    2nd step : Create an event :
      CALL FUNCTION 'SWE_EVENT_CREATE'
              EXPORTING
                objtype              = w_wf_objtype
                objkey               = w_wf_objkey
                event                = w_wf_event
                creator              = applicant
                start_recfb_synchron = 'X'
              TABLES
                event_container      = event_container
              EXCEPTIONS
                objtype_not_found    = 1
                OTHERS               = 2.
            IF sy-subrc <> 0.
              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
              WRITE sy-subrc.
            ENDIF.
    Now when I check my container with SWI2_FREQ I see that INTERNAL_TABLE has just one ligne, the rest disapears.
    I have this problem only when I set an internal table in an container
    I don't know why, but it perfectly works on 4.6B.
    Thanks a lot
    Walid

    Hi,
    I dont see a point in having this statement
    swc_set_table event_container 'INTERNAL_TABLE' t_cnp_container. Infact it is not needed !!
    SWE_EVENT_CREATE like any other FM, take a
    lt_var type standard table of SWCONT.
    ls_var type SWCONT.
    fill your ls_var with all fields and append it to lt_var each time and pass lt_var to event_table of SWE_EVENT_CREATE. It should work !!
    However, suggested way is to use SAP_WAPI_CREATE_EVENT instead of SWE_EVENT_CREATE  from ECC 5.0 onwards. There are fe concerns with SWE_EVENT_CREATE mainly with respect to commit and persistancy. Better we should use SAP_WAPI* as much as possible from ECC 5.0.
    Try above and Good Luck !!
    Regards
    Krishna Mohan

  • Problem with Equals/Contains

    Hello,
    I am learning .net c# and i wanted to rewrite Stack collection.
    But when i tried rewriting Contains method, i think i found little bug.
    I cant compare two instances of class.
    I created class Test and i put it into stack, then i made new instance of class Test and i tried do Contains, how i found out it always returns False. Same is with Equals, ReferenceEquals and ==. Why is this happening? Both classes contains same items with
    same things. Why it isnt True?
    Thanks for answer.

    Comparison and equality are one of the things that are done in an strange way in .NET.
    First thing to pay attention is that, there is difference between equality comparison and less than/greater than comparison. On the whole, equality is used in searching and looking up while comparison is used in sorting. Equality comparison is always doable.
    You compare whether two things are equal. But less than/greater than might not necessarily possible in all situations.
    There are also two general ways when comparing two things (whether for equality or less than/greater than):
    Objects themselves perform comparison on each other
    Another object -and external object- performs comparison on them
    In first approach, we call the Equals() method an object, passing it the other object we intend to compare its equality with, and the former object performs equality comparison himself and sees whether it is equal to the given object or not. While Equals()
    method provides us a good point to override comparison, the limitation is that, we can override Equals() only once in a class, while there might be different equality contexts available for comparison.
    For example in a collection of Person objects, one time we might compare equality based on Lastname and another time we might want to do it based on Birthdate. Using Equals() method regretfully gives us an only chance for comparison. Also, it corrupts the
    equality rule of all of our objects. Apparently we don't want to change the equality algorithm of our objects, one of which is equality comparison based on reference that is done intrinsically by object base class. Also, what if we don't access to the source
    code of the class we are using its instances in our application?! Let's not think about such a frightening situation (in that case, inheritance is an ultimate shot, however, not the only shot, as we will see soon). This leads us to the other approach.
    In the second approach we use another object as a judge that performs comparison (whether it be equality or less than/greater than) and proclaims the result. Because the judge object is external and can be any object, we will potentially have numerous
    choices at hand to use for comparison. One time we might use a LastNameEqualityComparer object, another time use a BirthdateEqualityComparer and another time use whatever equality comparer we want. We have total freedom.
    Now, we get to the point where I said there is strange or anomaly behavior in .NET collections regarding comparison.
    Some collections such as Dictionary<TKey, TValue> provides us a way to pass them an equality comparer object in their constructors when we are creating an instance of them.
    public Dictionary(IEqualityComparer<TKey> comparer)
    exmaple: https://msdn.microsoft.com/en-us/library/ms132072(v=vs.110).aspx
    public class Example
    public static void Main()
    // Create a new Dictionary of strings, with string keys
    // and a case-insensitive comparer for the current culture.
    Dictionary<string, string> openWith =
    new Dictionary<string, string>(
    StringComparer.CurrentCultureIgnoreCase);
    // Add some elements to the dictionary.
    openWith.Add("txt", "notepad.exe");
    openWith.Add("bmp", "paint.exe");
    openWith.Add("DIB", "paint.exe");
    openWith.Add("rtf", "wordpad.exe");
    // Try to add a fifth element with a key that is the same
    // except for case; this would be allowed with the default
    // comparer.
    try
    openWith.Add("BMP", "paint.exe");
    catch (ArgumentException)
    Console.WriteLine("\nBMP is already in the dictionary.");
    // List the contents of the sorted dictionary.
    Console.WriteLine();
    foreach( KeyValuePair<string, string> kvp in openWith )
    Console.WriteLine("Key = {0}, Value = {1}", kvp.Key,
    kvp.Value);
    But some collections don't provides us a way in their constructors to pass them a custom comparer. Unfortunately your case, Stack, is among them and Stack doesn't have such a constructor.
    If we read the MSDN documentation of the Contains() method in the non-generic Stack, and generic Stack<T> classes, we get the following sayings that reveals everything:
    non-generic Stack.Contains(): this method determines equality by calling Object.Equals.
    generic Stack<T>.Contains(): this method determines equality using the default equality comparer EqualityComparer<T>.Default for T, the type of values in the list.
    If we use a non-generic Stack class, our only choice is overriding Equals() in the class of our object, as Andy ONeill mentioned before. But if we use non-generic Stack<T>, .NET team generously favored us one other tiny choice. We can implement the
    IEquatable<T> interface in our class that has an Equals() method and implement the algorithm of our new equality comparison in this Equals() method. Why we should do that? Because that is what EqualityComparer<T>.Default does! See MSDN documentation
    again:
    https://msdn.microsoft.com/en-us/library/ms224763(v=vs.110).aspx
    The Default property
    checks whether type T implements
    the System.IEquatable<T> interface
    and, if so, returns an EqualityComparer<T> that
    uses that implementation. Otherwise, it returns an EqualityComparer<T> that
    uses the overrides of Object.Equals and Object.GetHashCode provided
    by T.
    Although this explanation is a little misleading or vague, simply put it says, the Default property returns a comparer object that checks whether the objects being compared have implemented IEquatable<T> interface or not. If so, it uses the implemented
    Equals() of that interface in the objects, otherwise it resorts to the intrinsic Equals() method that is inherited to all objects from the object, father of all, base type.
    This IEqualityComparer<T>.Default object and that IEquatable<T> interface together help not to corrupt the innate Equals() methods of our classes.
    However, as good as what .NET team might have thought by favoring us using an IEqualityComparer<T>.Default in the Contains() method of the non-generic Stack<T> class, their solution is far from what is expected. Because again it stucks us to
    the first problem. We have only one and only one chance to define an equality comparison algorithm in our class. Naturally we can't implement an IEquatable<T> interface multiple times in our class.
    The tiny problem is that, they missed adding a new constructor in Stack<T> class that accepts an IEqualityComparer<T> like what they have done in Dictionary<TKey, TValue>. This is a shame. Because this is not a rare occasion. The same is
    true for some other collections such as Queue<T>, HashSet<T>, LinkedList<T> and List<T>. I don't know whether they have did this intentionally or they simply forgot to do that.
    So what? What should we do if we had multiple equality testing algorithms.
    Fortunatey there is still hope.
    If .NET team working on generic collections were that lazy to forget adding new constructors to generic classes, they did a good job and solved the problem from the root by adding a bunch of extension methods to all IEnumerable, IEnumerable<T> collections
    in System.Linq namspace and freed themselves forever. Look at the following extension methods in System.Linq namespace:
    public static bool Contains<TSource>(
    this IEnumerable<TSource> source,
    TSource value,
    IEqualityComparer<TSource> comparer
    You got the idea? They defined a general Contains() method for any IEnumerable<T> collection that allows us to give it a custom equality comparer object. Hooray! Problem solved. But wait. Why should we be happy? That comparer parameter might still
    use IEquatable<T> and presumes the objects have an Equals() method! Oh my gush! Still returned to the same point and the problem exists. We stuck forever! Don't freak out. Be calm.
    The IEqualityComparer<T> interface is defined this way:
    public interface IEqualityComparer<in T>
    bool Equals(T x, T y);
    int GetHashCode(T obj);
    It says, an equality comparer should have an Equals() method and it is in this very method that the equality comparison algorithm will go. This method receives two objects and compares them together using whatever algorithm the creator of the equality comparer
    class has intended.
    The good point of this IEqualityComparer<T> and that Contains<T>() extension method is that, your objects are not expected to implement an IEquatable<T> as well. This is another good news. Because we are neither forced to override
    Equals() in our class and corrupt it, nor we have to implement IEquatable<T> in them. In fact, our classes remain clean and intact and we even don't have to have their source code.
    So, this was the final cure for the malignant issue of equality comparison. The same story is true for less than/greater than comparison.
    In conclusion, what I recommend is that, never override the intrinsic Equals() method, inherited from Object, in your classes. Instead use the extension methods that has a comparer parameter in their signature and receive a comparer object (like Contains<T>()).
    I don't want to again raise a depression air here. But you should know that. You have the right. All extension methods does not have an overload that has a comparer parameter. But don't worry. You can yourself write the required extension method you need and
    complete the probably incomplete work in .NET.
    Good luck

  • Problem with Vector method addElement

    I am new to Java. I am using JDK 1.3. I am writing a program that will convert a text file to a binary file that stores a Vector object. I have narrowed my problem to the method that reads the text file and creates my vector. Each element in my vector stores an integer and a string variable. The reading of the text file works find and the creation of my record works find. It seems that the storing of the record in the vector is not working. When I print the first 10 elements of the vector, it have the same record(the last record of my text file). What is wrong with the method below? I am also appending the result of running my program.
    private static void readTextFile(File f) {
    try {
    FileReader fileIn = new FileReader(f);
    BufferedReader in = new BufferedReader(fileIn);
    String line;
    int i;
    SsnLocationRecord recordIn = new SsnLocationRecord();
    int ctr = 0;
    while (true) {
    line = in.readLine();
    if (line == null)
    break;
    ctr += 1;
    i = line.indexOf(" ");
    recordIn.putAreaNumber(Integer.parseInt(line.substring(0,i).trim()));
    recordIn.putLocation(line.substring(i+1).trim());
    records.addElement(recordIn);
    if (ctr < 11)
    System.out.println(recordIn);
    in.close();
    } catch (IOException e) {
    System.out.println ("Error reading file");
    System.exit(0);
    for (int i = 0; i < 11; i++)
    System.out.println((SsnLocationRecord) records.elementAt(i));
    RESULTS:
    C:\Training\Java>java ConvertTextFileToObjectFile data\ssn.dat
    0 null
    3 New Hampshire
    7 Maine
    9 Vermont
    34 Massachusetts
    39 Rhode Island
    49 Connecticut
    134 New York
    158 New Jersey
    211 Pennsylvania
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    C:\Training\Java>

    First of all it would be better if you did a priming read and then checked line == null in the while statement instead of the way you have it.
    ctr++ will also accomplish what ctr +=1 is doing.
    you need to create a new instance of SsnLocationRecord for each line read. What you are doing is overlaying the objects data each time you execute the .putxxxx methods. The reference to the object is placed in the vector. The actual object is still being updated by the .putxxx methods (NOTE : THIS IS THE ANSWER TO YOUR MAIN QUESTION).
    you close should be in a finally statement.
    To process through all the elements of a Vector create an Enumeration and then use the nextElement() method instead of the elementAt is probably better. (Some will argue with me on this I am sure).
    Also, on a catch do not call System.exit(0). This will end your JVM normally. Instead throw an Exception (Runtime or Error level if you want an abnormal end).

  • ReadObject and problems with Vector field

    hello.
    i'm trying to send an object(data Packet for a chat application) and receive it via sockets.
    every thing is right but there is a Vector field(online users list)that has some problems.
    my clients receive every updated class that contains new user list.but they just see the first received list?
    it's so strange to me because every thing else (such as color,font,size,..) works fine.
    can you help me?

    Every time you resend an object you have already sent, ObjectOutputStream will just send a 'handle', not the actual object. If it's changed value this is a problem. Use ObjectOutputStream.reset() to cause it to forget everything previously sent.

  • Webservice Client deserialization problem with Vectors!

    Hello!
    I'm generating a Java Proxy Client with Eclipse WTP.
    The Client works fine with normal datatypes and own Beans. But whe the return type is a Collection with own beans an exception is thrown:
    exception: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
    So whats wrong?
    In teh Webservice Explorer everything seems to be fine, my vector is serialized in item-tags:
    - <getAktionenResponse xmlns="http://commonservice">
    - <getAktionenReturn>
    - <item xmlns="">
    <aktn_nr>a12345</aktn_nr>
    <claim>222</claim>
    <geschaeftsjahr>2005</geschaeftsjahr>
    <son>333</son>
    <special_operation_code>soc12345</special_operation_code>
    <status>ready</status>
    <vin>t123</vin>
    </item>
    - <item xmlns="">
    <aktn_nr>a6789</aktn_nr>
    <claim>567</claim>
    <geschaeftsjahr>2006</geschaeftsjahr>
    <son>555</son>
    <special_operation_code>soc6789</special_operation_code>
    <status>false</status>
    <vin>t123</vin>
    </item>
    </getAktionenReturn>
    </getAktionenResponse>
    how can i solve this problem?
    the background is that I return a vector with Java Objects. I thought apache axis deserielizes automatically the vector and the bean inside??
    I'm pretty new to webservices...
    Pleas help!
    Thanks!

    As per the below link, I assumed its better to avoid collections and go with plain array of objects.
    Please let us know if I am wrong.
    http://www-128.ibm.com/developerworks/webservices/library/ws-tip-coding.html
    Regards,
    Venkat S

  • Problem with Custom container - cl_gui_custom_container/cl_gui_alv_grid

    Hi,
    I want to reuse the same custom container screen for a different data.
    First screen there will be button 1 and button 2
    if I click button 1 then calculate and display data  in custom container, if button 2 is clicked then calculate and display data with  in the same custom container.
    For this
    1. Created Custom container - CONTAINER
    2. In program defined and created custom container and custom alv grid
    g_custom_container TYPE REF TO cl_gui_custom_container,
            alv_grid                     TYPE REF TO cl_gui_alv_grid.
           IF g_custom_container IS INITIAL.
                CREATE OBJECT g_custom_container
                    EXPORTING
                  container_name = 'CONTAINER'.
                CREATE OBJECT alv_grid
                   EXPORTING
                    i_parent = g_custom_container.
          ENDIF.
    3. Display data using CALL METHOD alv_grid->set_table_for_first_display
       every thing works great for button 1
    4. when button 2 is clicked then calculate and display different set of data in same custom container which is used earlier.
    5. here I used
    call method alv_grid->free.
        call method g_custom_container->free.
    6. create above objects once again and tried to use
    call method alv_grid->set_table_for_first_display
    , to reuse the same custom container 'CONTAINER' again for a different set of data and getting ABAP dump.
    In debug mode, when I used the above method FREE for both ALV_GRID and G_CUSTOM_CONTAINER objects are not clearing.
    Please let me know how can I reuse the same container for a different set of data when button2 is pressed.
    Thanks in advance,
    Krishna
    Please use code tags to format your code and post in the correct forum
    Edited by: Rob Burbank on Oct 1, 2010 2:37 PM

    Hello Krishna
    I would recommend to use a different approach instead of trying to initialize your container instances:
    DATA:
      go_container_1 TYPE REF TO cl_gui_custom_container,
      go_container_2 TYPE REF TO cl_gui_custom_container,
      go_grid_1          TYPE REF TO cl_gui_alv_grid,
      go_grid_2          TYPE REF TO cl_gui_alv_grid.
    " NOTE: Do this coding BEFORE calling the screen
    * (1) Create 2 containers
    CREATE OBJECT g_container_1
                    EXPORTING
                  container_name = 'CONTAINER'.
    CREATE OBJECT g_container_2
                    EXPORTING
                  container_name = 'CONTAINER'.
    " NOTE: If it is not possible to use the same container name then either create an additional
    "            dummy screen having a second CUSTOM_CONTROL element or replace
    " the customer containers with docking containers -> here you do not need to give a container name
    * (2) Create 2 grid instances using a different container
    * (3) Link the first container to the screen using its LINK method:
      CALL METHOD go_container_1
        EXPORTING
           repid = <...>
          dynnr = <...>.
    * (4) Perhaps you need to define a second dummy screen to which you link the second container
    * (5) Display first grid instance (as default)
    Now when the user pushes button 2 (to display the second grid) link container_1 to the dummy screen
    and link container_2 to your main screen.
    Regards
      Uwe

  • GUI_DOWNLOAD: problems with table containing char length 8000

    Hi
    I have some problems using GUI_DOWNLOAD. Here is some of my code:
    DATA: g_record TYPE Z_CHAR8000 OCCURS 0 WITH HEADER LINE.
    z_char8000 is a char of length 8000
    insert code to fill data in g_record
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename                  = g_filename
          filetype                  = 'ASC'  
            filetype                  = 'BIN'  
            TRUNC_TRAILING_BLANKS     = 'X'
            TRUNC_TRAILING_BLANKS_EOL = 'X'
          TABLES
            data_tab                = g_record
          EXCEPTIONS
            file_write_error        = 1
            no_batch                = 2
            gui_refuse_filetransfer = 3
            invalid_type            = 4
            no_authority            = 5
            unknown_error           = 6
            header_not_allowed      = 7
            separator_not_allowed   = 8
            filesize_not_allowed    = 9
            header_too_long         = 10
            dp_error_create         = 11
            dp_error_send           = 12
            dp_error_write          = 13
            unknown_dp_error        = 14
            access_denied           = 15
            dp_out_of_memory        = 16
            disk_full               = 17
            dp_timeout              = 18
            file_not_found          = 19
            dataprovider_exception  = 20
            control_flush_error     = 21
            OTHERS                  = 22.
    An example of data in g_record:
    Hans,Kruger,Berlin,Superstrass 3,0101709991,,,,,,,,,,,,
    When I open the resulting file in notepad the above data is present, and that's a good thing! The bad thing is that for every entry I have in the g_record table the GUI_DOWNLOAD puts 8000 characters into the file (the data from g_record and trailing blanks so that the line becomes 8000 chars long). I dont want the trailing blanks and TRUNC_TRAILING_BLANKS dont seem to work. Have any of you had hte same problem and/or is there a solution?!
    I have tried using filetype ASC and here I dont get the trailing blanks, but another problem hits me. I cant download more that 1024 characters from each entry in g_record and thats not good enough!
    Regards Anders

    Hi Andres,
    take this itab-definition for your download:
    TYPES:BEGIN OF ty_down,
          line TYPE string,
          END OF ty_down.
    DATA wa_down TYPE ty_down.
    DATA g_record  TYPE TABLE OF ty_down.
    regards Andreas

Maybe you are looking for