axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Menke" <john.me...@eagleinfosystems.com>
Subject RE: Serialization and Deserialization of Beans Problem
Date Sat, 13 Nov 2004 02:14:33 GMT
It's amazing that there is virtually NO DOCUMENTATION ON THIS. -- PEOPLE
WANT TO LEARN THIS.

Suggestion:  Maybe if people needing the documentation commit to producing
the documentation to commit back to the Axis project then somebody will take
the time to walk us through this.

Is anyone listening?  I will sign up to the docs if somebody can flesh out
the content for me.

-jm

-----Original Message-----
From: Alexandre Camy [mailto:alexcamy@gmail.com]
Sent: Friday, November 12, 2004 8:05 PM
To: axis-user@ws.apache.org
Subject: Serialization and Deserialization of Beans Problem


Hi everybody

I have a problem  to do a service metho that return a ArrayList of
Beans. I found a lot of people on the net with the same problem but
everybody without solution for it.
I would like to know if somebody knows a good tutorial about
Serialization/Deserializatin of Beans and ArrayList, with java code
examples to do it.

Well, for who would like to help me in the code, my problem is:

- The Exception is: SAXException: No deserializer for...

My deploy.wsdd is:

<deployment
    xmlns="http://xml.apache.org/axis/wsdd/"
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

  <service name="ServerProdutosService" provider="java:EJB" >
      <parameter name="beanJndiName" value="ejb/ProdutosFacadeLocal"/>
      <parameter name="homeInterfaceName"
value="com.server.produtos.ejb.session.ProdutosFacadeLocalHome"/>
      <parameter name="remoteInterfaceName"
value="com.server.produtos.ejb.session.ProdutosFacadeLocal"/>
      <parameter name="allowedMethods" value="getAllProdutos"/>
      <beanMapping qname="ns:ProdutosModel"
xmlns:ns="urn:ProdutosFacadeLocal"
			 languageSpecificType="java:com.server.produtos.model.ProdutosModel"/>
      <parameter name="jndiURL" value="jnp://localhost:1099"/>
      <parameter name="jndiContextClass"
value="org.jnp.interfaces.NamingContextFactory"/>
  </service>


-My java code is:

URL urlServer =
				new
URL("http://localhost:8080/axis/services/ServerProdutosService?wsdl");

			QName qn = new QName("urn:ServerProdutosService", "ProdutosModel");

			Service service = new Service();

			Call call = (Call) service.createCall();

			call.setTargetEndpointAddress(urlServer);
			call.registerTypeMapping(
				ArrayList.class,
				XMLType.SOAP_ARRAY,
				new ArraySerializerFactory(),
				new ArrayDeserializerFactory());
			call.registerTypeMapping(
				ProdutosModel.class,
				qn,
				new BeanSerializerFactory(ProdutosModel.class, qn),
				new BeanDeserializerFactory(ProdutosModel.class, qn),false);

			call.setReturnType(XMLType.SOAP_ARRAY);

			System.out.println("configurou o call: "+call);

			Object[] params = new Object[0];

			ArrayList list =
				(ArrayList) call.invoke(new QName("getAllProdutos"), params);
</deployment>


Mime
View raw message