You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Fran <fc...@gmail.com> on 2007/05/25 13:51:43 UTC

[AXIS2] Problem with a HashMap in Web Services

Hi!

I have the following problem:

 - I have three classes: ClassA, ClassB and ClassC
 - ClassA is the service
 - ClassB is a class that receive the ClassA data
 - ClassB has a HashMap<Integer, ClassC>
 - ClassC is a class that save three atributes: String attA, String
attB, String attC

In this case it would be like this:

public ClassA {

  private ClassB classB = new ClassB ();

  public SampleMethodResponse sampleMethod (SampleMethod param) {
     //Get the data of param
     this.classB.setData (data);
   }
}

public ClassB {

   private Map<Integer, ClassC> map = new HashMap<Integer, ClassC> ();

   public void setData (data) {
      ClassC myClass = new ClassC (data);
      //Generate a random integer
      ClassC ret = this.map.put (random, myClass)
      // Here I have an error, ret == null
   }
}

public ClassC {

   public ClassC (data) {
      // Create an instance of ClassC
   }
}


Without web services, I haven't problems. Can help me?

-- 
Saludos

Fran

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org