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 Tania Durán <du...@almabioinfo.com> on 2003/10/01 17:08:44 UTC

help on mapping

hi all,

I´m having problems on serializing/deserializing beans and don´t know what´s happening. The thing is that I have a service which returns an arrayList of beans. The client´s code that invokes the services is:

QName qn = new QName("urn:ReportService","Bioentity");
call.registerTypeMapping(ArrayList.class, XMLType.SOAP_ARRAY, 
                        new ArraySerializerFactory(), new ArrayDeserializerFactory());
call.registerTypeMapping(samples.tania.Bioentity.class, qn,
                        new org.apache.axis.encoding.ser.BeanSerializerFactory(samples.tania.Bioentity.class, qn),
                        new org.apache.axis.encoding.ser.BeanDeserializerFactory(samples.tania.Bioentity.class, qn));
call.addParameter("name",XMLType.XSD_STRING,ParameterMode.IN);
call.addParameter("id",XMLType.XSD_STRING,ParameterMode.IN);
call.setReturnType(XMLType.SOAP_ARRAY);
...
ArrayList list = (ArrayList)call.invoke(new QName("doService"),new Object[]{name, id});

and the wsdd file i´m using to deploy the services is:

<?xml version="1.0"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
 xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
 <service name="ReportService" provider="java:RPC">
  <parameter name="className" value="samples.tania.ServiceController"/> 
  <parameter name="allowedMethods" value="doService"/>
  <beanMapping qname="ns:Bioentity" xmlns:ns="urn:ServiceController" languageSpecificType="java:samples.tania.Bioentity"/>
 </service>
</deployment>


... no idea what´s happening here but it doesn´t work. The exception I get is:

org.xml.sax.SAXException: No deserializer for {ServiceController}Bioentity
        at org.apache.axis.encoding.DeserializerImpl.onStartElement(DeserializerImpl.java:485)
        at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:428)
....


Any help will be welcome. 
Thanks, Tania.


RE: help on mapping

Posted by Gary L Peskin <ga...@firstech.com>.
It looks like your actual service is returning a
 
  {ServiceController}Bioentity
 
 
rather than a
 
  {urn:ServiceController}Bioentity
 
 
HTH,
Gary
  
-----Original Message-----
From: Tania Durán [mailto:duran@almabioinfo.com] 
Sent: Wednesday, October 01, 2003 8:09 AM
To: axis-user@ws.apache.org
Subject: help on mapping



hi all,
 
I´m having problems on serializing/deserializing beans and don´t know what´s
happening. The thing is that I have a service which returns an arrayList of
beans. The client´s code that invokes the services is:
 
QName qn = new QName("urn:ReportService","Bioentity");
call.registerTypeMapping(ArrayList.class, XMLType.SOAP_ARRAY, 
                        new ArraySerializerFactory(), new
ArrayDeserializerFactory());
call.registerTypeMapping(samples.tania.Bioentity.class, qn,
                        new
org.apache.axis.encoding.ser.BeanSerializerFactory(samples.tania.Bioentity.c
lass, qn),
                        new
org.apache.axis.encoding.ser.BeanDeserializerFactory(samples.tania.Bioentity
.class, qn));
call.addParameter("name",XMLType.XSD_STRING,ParameterMode.IN);
call.addParameter("id",XMLType.XSD_STRING,ParameterMode.IN);
call.setReturnType(XMLType.SOAP_ARRAY);
...
ArrayList list = (ArrayList)call.invoke(new QName("doService"),new
Object[]{name, id});
 
and the wsdd file i´m using to deploy the services is:
 
<?xml version="1.0"?>
<deployment xmlns=" <http://xml.apache.org/axis/wsdd/>
http://xml.apache.org/axis/wsdd/"
 xmlns:java=" <http://xml.apache.org/axis/wsdd/providers/java>
http://xml.apache.org/axis/wsdd/providers/java">
 <service name="ReportService" provider="java:RPC">
  <parameter name="className" value="samples.tania.ServiceController"/> 
  <parameter name="allowedMethods" value="doService"/>
  <beanMapping qname="ns:Bioentity" xmlns:ns="urn:ServiceController"
languageSpecificType="java:samples.tania.Bioentity"/>
 </service>
</deployment>
 
 
... no idea what´s happening here but it doesn´t work. The exception I get
is:
 
org.xml.sax.SAXException: No deserializer for {ServiceController}Bioentity
        at
org.apache.axis.encoding.DeserializerImpl.onStartElement(DeserializerImpl.ja
va:485)
        at
org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java
:428)
....
 
 
Any help will be welcome. 
Thanks, Tania.