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 grega <gr...@gmail.com> on 2006/03/20 09:20:31 UTC

WS returns bean

Hello,

I am new in axis and WS. I want to create simple WS which sets some
bean attributes on the client side and then send this to the server
where fills other bean attributes  and sends bean back.


Code:

Bean.java
---------------
package bean;

public class Bean {

  private String Type;
  private String Filter;
  private String Names[];
  private String Description[];



   // Bean accessors

            public String getType()
            { return Type; }
            public void setType(String type)
            { Type = type; }

            public String getFilter()
            { return Filter; }
            public void setFilter(String filter)
            { Filter = filter; }


BeanInfo.java
-----------------

package bean;

public class BeanInfo
{
     public Bean processBean(Bean bean)  {
       String [] aa = new String [] { "AAAAA", "BBBBBB", "CCCC" };
       String [] bb = new String [] { "1111", "2222", "3333" };
       bean.setDescription(aa);
       bean.setNames(bb);
       return bean;
  }
}

Procedure:
javac -cp $AXISCLASSPATH:/home/tomcat/workspace/axistest/WEB-INF/src/
bean/*.java

java -cp $AXISCLASSPATH:/home/tomcat/workspace/axistest/WEB-INF/src/
org.apache.axis.wsdl.Java2WSDL -o bean.wsdl
-l"http://localhost:8080/axis/services/bean" -n urn:bean -p"bean"
urn:bean bean.BeanInfo

java -cp $AXISCLASSPATH org.apache.axis.wsdl.WSDL2Java -o . -d Session
-s -p bean.ws bean.wsdl

Now I have to change

bean/ws/BeanSoapBindingImpl.java

to add my impl.

generated file:

package bean.ws;

public class BeanSoapBindingImpl implements bean.ws.BeanInfo{

    public bean.ws.Bean processBean(bean.ws.Bean in0) throws
java.rmi.RemoteException {
        return null;
    }
}

I would need to do something like this:

package bean.ws;

import bean.BeanInfo;

public class BeanSoapBindingImpl implements bean.ws.BeanInfo{
    BeanInfo bI = new BeanInfo();
    public bean.ws.Bean processBean(bean.ws.Bean in0) throws
java.rmi.RemoteException {
        return bI.processBean(in0);
    }
}

But this doesn't compile. This works for java built in types but not
for user defined.

Probably it is a simple solution, but I don't know how to solve this problem.

Regards,
Grega.