You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Doug Haigh <dh...@gatorzone.com> on 2003/03/07 18:44:50 UTC

Nested Classes for Java Beans

I have a class that does all soap that looks like

=======================================

public class SoapMgr
{
  public int GetInfo()
  {
      Service service = new Service();
      Call    call    = (Call) service.createCall();
      QName   qn      = new QName( "urn:remote-adap", "NumAdaptersInfo" );

      call.registerTypeMapping(InfoBean.class,
                               qn,
                               new
org.apache.axis.encoding.ser.BeanSerializerFactory(InfoBean.class, qn),
                               new
org.apache.axis.encoding.ser.BeanDeserializerFactory(InfoBean.class, qn));

      call.setTargetEndpointAddress(serverUrl);
      call.setOperationName(new QName("urn:remote-adap",
"GetNumAdapters") );

      call.setReturnType(qn);

      InfoBean ai = (InfoBean)call.invoke(new Object[]{} );
     ...
    }
    catch (javax.xml.rpc.ServiceException se)
    {
      System.err.println("Caught ServiceException:" + se.getMessage());
    }
    catch (java.rmi.RemoteException re)
    {
      System.err.println("Caught RemoteException:" + re.getMessage());
    }
  }

  public class InfoBean() implements Serializable
  {
    public InfoBean()
    {
    }
    ...
  }
}

==========================

but the call fails because it says the InfoBean does not have a public
constructor (which it does). Does Axis not support nested classes to be used
as deserializers?

Doug