Hi,

I'm new to both Axis2 and web services and I'm having a hard time
grasping all the various types of databinding that can be created (POJO,
AXIOM, ADB, XMLBeans and JiBX). I have a couple of general questions
about Axis2 and web services. 

 

I need to create a service that can pass complex objects between the
client and the server. Something like my modified weather example below.

 

My questions about this are as follows:

 

1) In the testing I've done I noticed that it fails when there are any
java.util.Vector or java.util.List objects within the object being
transferred. I have seen several other posts about this but with no
responses. Does anyone know why this is the case? How can I get around
this?

  

  I read that using an ArrayList object will work which I did verify,
but I need to be able to user List and Vectors.

  

2) In the following modified Weather class where I have an ArrayList
called children with its set and get methods (this is from the
sample.pojo.rpcclient package distributed with Axis2). When I send this
weather class on a round trip to the WeatherService service calling the
setWeather then the getWeather methods, then I take the returned weather
class and call it's getChildren method I end up with an ArrayList of
OMEElement objects rather than Weather objects as I wanted. I understand
that everything is converted to XML during transport, but how do I get
these elements mapped back into the Weather class? 

 

  package sample.pojo.data;

  import java.util.ArrayList;

 

  public class Weather{

    float temperature;

    String forecast;

    boolean rain;

    float howMuchRain;

    ArrayList<Weather> children=null;

    

    public Weather() {

      children=new ArrayList<Weather>();

    }

    

    public Weather(String forecast) {

      children=new ArrayList<Weather>();

      this.forecast=forecast;

    }

    .

    .

    .

  

    public void setChildren(ArrayList<Weather> c) {

      children=c;

    }

    

    public void addChild(Weather w) {

      children.add(w);

    }

    

    public ArrayList<Weather> getChildren() {

      return children;

    }

  }

 

3) Based on needing to transfer this kind of object what type of
databinding would be best for me to use. Are there some that would work
better than others, In my testing I'm using this POJO sample? But I'm
thinking that I should use ADB or XMLBean. Any suggestions?

  

4) The client that will be accessing this service will be running within
both a standalone application and a Java applet. For the sake of the
Java applet I would like the client footprint to be as small as
possible. Based on this requirement are there some databindings that
have a smaller footprint than others?

  

I realized that I'm not grasping all the concepts that I need to
understand here, I'm not even sure I'm asking the right questions? I
have been looking at the documentation and samples that come with Axis2.
Are there any other good resources that I can look at that might help me
out here, such as some good tutorials or FAQ's. Some more good code
samples would be helpful tool. Any comments offered would be greatly
appreciated.

  

Thanks,

David

 

Reply via email to