Hiya,
The exact error message is:
No deserializer for {urn:BeanService}com.greenpulse.demo.model.Student
Here's the client code and the wsdd file:
WSDD:
<?xml version="1.0" encoding="ISO-8859-1"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java
="http://xml.apache.org/axis/wsdd/providers/java">
<service name="students2" provider="java:RPC" style="rpc" use
="encoded">
<parameter name="className" value
="com.greenpulse.demo.model.Students"/>
<parameter name="allowedMethods" value="*"/>
<beanMapping qname="myNS:com.greenpulse.demo.model.Student"
xmlns:myNS="urn:BeanService" languageSpecificType
="java:com.greenpulse.demo.model.Student"/>
</service>
</deployment>
client method:
private static void getStudents(String search) throws ServiceException,
RemoteException
{
System.out.println("Getting students");
Service service = new Service();
Call call = (Call) service.createCall();
call.registerTypeMapping(Student.class,
new QName("urn:BeanService",
"com.greenpulse.demo.model.Student"),
BeanSerializerFactory.class,
BeanDeserializerFactory.class, true);
call.setTargetEndpointAddress(ADDRESS);
call.setOperation("getByName");
String[] args = {search};
System.out.println("invoking");
Object o = call.invoke(args);
System.out.println("o = " + o);
}
And, here's the signature for the method that's being called on Students:
public Vector getByName(String name)
Cheers,
Bryan
Venkatesh Kancharla
<[EMAIL PROTECTED] To: [EMAIL PROTECTED]
nomics.com> cc:
Subject: Re: Unregistered
Deserializer???
10/06/2003 05:51
p.m.
Please respond to
axis-user
Can you post your deploy.wsdd file?? and client code..
You have to add a type mapping for Vector at the client side.
Venkatesh Kancharla
Associate (Software)
Strand Genomics (http://www.strandgenomics.com)
Bangalore, India
Ph no: 3618992,93, 94, 95 (ext-210)
---------------------------------------------------------------------
If Necessity Is the Mother of Invention,
then frustration Is Its Father
-unknown
---------------------------------------------------------------------
On Tue, 10 Jun 2003 [EMAIL PROTECTED] wrote:
>
> Hi Venkatesh,
>
> I've just tried your idea, and it doesn't seem to work for me. I've added
a
> bean mapping for java.util.Vector, as you suggested, following the model
> from the code I originally posted, and I've added another
> registerTypeMapping to call for Vector using VectorSerialiser and
> VectorDeserialiser. I'm still getting the same error, which is telling me
> that there is no deserialiser for Student.
>
> Cheers,
>
> Bryan
>
>
>
>
> Venkatesh Kancharla
> <[EMAIL PROTECTED] To:
[EMAIL PROTECTED]
> nomics.com> cc:
> Subject: Re:
Unregistered Deserializer???
> 10/06/2003 03:48
> p.m.
> Please respond to
> axis-user
>
>
>
>
>
>
> Hi Bryan,
> You are returning a vector. So, you need to specify serializer for
> both vector and Student.
>
>
> Venkatesh Kancharla
> Associate (Software)
> Strand Genomics (http://www.strandgenomics.com)
> Bangalore, India
>
> Ph no: 3618992,93, 94, 95 (ext-210)
>
> ---------------------------------------------------------------------
> If Necessity Is the Mother of Invention,
> then frustration Is Its Father
> -unknown
> ---------------------------------------------------------------------
>
> On Tue, 10 Jun 2003 [EMAIL PROTECTED] wrote:
>
> > Hi,
> >
> > I'm trying to return an array of beans, and am having problems. I'm
using
> > axis 1.1 rc2. The first message I got was that my student class had no
> > registered serializer, so I added this to my deploy.wsdd:
> >
> > <beanMapping
> > qname="myNS:com.greenpulse.demo.model.Student"
> > xmlns:myNS="urn:BeanService"
> > languageSpecificType="java:com.greenpulse.demo.model.Student"
> > />
> >
> > Then I got a message about their being no registered deserializer, so I
> > added this to my simple client class:
> >
> > call.registerTypeMapping(Student.class,
> > new QName("urn:BeanService",
> > "com.greenpulse.demo.model.Student"),
> > BeanSerializerFactory.class,
> > BeanDeserializerFactory.class);
> >
> >
> > However, this didn't help.
> >
> > So, I'm lost, and would appreciate some help :-)
> >
> > Here's my java and deployment files:
> >
> > TIA -- Bryan
> >
> > Main:
> > private static void getStudents(String search) throws ServiceException,
> > RemoteException
> > {
> > System.out.println("Getting students");
> > Service service = new Service();
> > Call call = (Call) service.createCall();
> > call.registerTypeMapping(Student.class,
> > new QName("urn:BeanService",
> > "com.greenpulse.demo.model.Student"),
> > BeanSerializerFactory.class,
> > BeanDeserializerFactory.class);
> >
> > call.setTargetEndpointAddress(ADDRESS);
> > call.setOperation("getByName");
> > String[] args = {search};
> > System.out.println("invoking");
> > Object o = call.invoke(args);
> > System.out.println("o = " + o);
> > }
> >
> > --
> >
> > Students.java
> > package com.greenpulse.demo.model;
> >
> > import java.util.Vector;
> >
> > public class Students
> > {
> > public Vector getByName(String name)
> > {
> > Vector v = new Vector();
> > for (int i = 0; i < 10; i++)
> > v.add(new Student("id " + i,
> > "male",
> > "25/12/1980",
> > "En",
> > "comment " + i,
> > "email" + i + "
> > @nowhere.com",
> > "Mr",
> > "family " + i,
> > "given " + i));
> > return v;
> > }
> > }
> >
> > --
> > Student.java
> > package com.greenpulse.demo.model;
> >
> > import java.io.Serializable;
> >
> > /**
> > * Correspondence School (c) 2003 All rights reserved
> > * www.demo.greenpulse.com
> > */
> > public class Student
> > {
> > private String studentID;
> > private String gender;
> > private String birthDate;
> > private String FirstLanguage;
> > private String comment;
> > private String email;
> > private String title;
> > private String familyName;
> > private String givenNames;
> >
> > public Student()
> > {
> > }
> >
> > public Student(String studentID, String gender, String birthDate,
> > String firstLanguage, String comment, String email, String title,
String
> > familyName, String givenNames)
> > {
> > this.setStudentID(studentID);
> > this.setGender(gender);
> > this.setBirthDate(birthDate);
> > this.setFirstLanguage(firstLanguage);
> > this.setComment(comment);
> > this.setEmail(email);
> > this.setTitle(title);
> > this.setFamilyName(familyName);
> > this.setGivenNames(givenNames);
> > }
> >
> > public String getStudentID()
> > {
> > return studentID;
> > }
> >
> > public void setStudentID(String studentID)
> > {
> > this.studentID = studentID;
> > }
> >
> > public String getGender()
> > {
> > return gender;
> > }
> >
> > public void setGender(String gender)
> > {
> > this.gender = gender;
> > }
> >
> > public String getBirthDate()
> > {
> > return birthDate;
> > }
> >
> > public void setBirthDate(String birthDate)
> > {
> > this.birthDate = birthDate;
> > }
> >
> > public String getFirstLanguage()
> > {
> > return FirstLanguage;
> > }
> >
> > public void setFirstLanguage(String firstLanguage)
> > {
> > FirstLanguage = firstLanguage;
> > }
> >
> > public String getComment()
> > {
> > return comment;
> > }
> >
> > public void setComment(String comment)
> > {
> > this.comment = comment;
> > }
> >
> > public String getEmail()
> > {
> > return email;
> > }
> >
> > public void setEmail(String email)
> > {
> > this.email = email;
> > }
> >
> > public String getTitle()
> > {
> > return title;
> > }
> >
> > public void setTitle(String title)
> > {
> > this.title = title;
> > }
> >
> > public String getFamilyName()
> > {
> > return familyName;
> > }
> >
> > public void setFamilyName(String familyName)
> > {
> > this.familyName = familyName;
> > }
> >
> > public String getGivenNames()
> > {
> > return givenNames;
> > }
> >
> > public void setGivenNames(String givenNames)
> > {
> > this.givenNames = givenNames;
> > }
> >
> > public String toString()
> > {
> > return this.studentID + " " +
> > this.gender + " " +
> > this.birthDate + " " +
> > this.FirstLanguage + " \"" +
> > this.comment + "\" " +
> > this.email + " " +
> > this.title + " " +
> > this.familyName + " " +
> > this.givenNames;
> >
> > }
> > }
> >
> >
> > Cheers,
> >
> > Bryan
> >
> >
>
>
>
>
>
>