Hi,
 
I'm new to Axis Soap. I have made a Soap webservice with axis and a Soap client which can communicate. But now I need to create a client which can send serialized objects. But after a long search on the web I still haven't found anything which can help me further.
The following code is the Soap client one I have now.
 
    Integer i1 = new Integer(1);
    Integer i2 = new Integer(2);
    call.setTargetEndpointAddress(url);
    call.setOperationName(new QName("add", "add"));
    call.addParameter("num1", XMLType.XSD_INT, ParameterMode.IN);
    call.addParameter("num2", XMLType.XSD_INT, ParameterMode.IN);
    call.setReturnType(XMLType.XSD_INT);

    Integer ret = null;
    try {
      //Call the SOAP Service with i1 and i2 as arguments.
      ret = (Integer) call.invoke(new Object[] {i1, i2});
    }
    catch (RemoteException ex2) {
      //If connection to SOAP Service failes.
      System.out.println("Remote Exception");
      ex2.printStackTrace();
    }

 
What I would like to try is to have a Bean which stores the Integers and then I want to serialize this object and send it to the Soap Webservice.
Could anyone help me out on modifying the code so that it can do that or give me pointers on how to do it?
 
I think the bean should look like this although I don't know if I've made any mistakes with this bean:
 
public class NumBean{
  private intNum1;
  private int Num2;
  public Test() {
  }
 
  public intgetNum1(){
    return Num1;
  }
  public void setNum1(int Num1){
    this.Num1 = Num1;
  }
 
  public int getNum2(){
    return Num2;
  }
  public void setNum2(int Num2){
    this.Num2 = Num2;
  }
}
 
Many thanks in advance.
 
Regards,
 
Willem Liu
 

Reply via email to