You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Adam Lipscombe <ad...@cobar.fsbusiness.co.uk> on 2001/07/13 18:36:02 UTC

Problems serializing a vector of user defined classes with BeanSerializer

Folks,


Apologies if this is a well know question - I am a relative newbie to SOAP.


I need to pass a Vector of types via SOAP.
My understanding is that provided the the types conform the JavaBean specs I
should be able to use the Bean Serializer...


The Type in the Vector is:
public class  OrganisationListMemberModel
              implements    Serializable
{
  private OrganisationName  organisationName;


  public OrganisationListMemberModel(OrganisationName  organisationName)
  {
    this.organisationName = organisationName;
    return;
  }
  public OrganisationListMemberModel()
  {
    return;
  }

  public OrganisationName getOrganisationName()
  {
    return organisationName;
  }

  public void setOrganisationName(OrganisationName organisationName)
  {
    this.organisationName = organisationName;
    return;
  }
}


The OrganisationName type is:

public class OrganisationName
       implements java.io.Serializable
{
  private String value;

  public OrganisationName(String value) throws TypeException
  {
      this.value = value;
      return;
  }
  public OrganisationName()
  {
      return;
  }


  public String getValue()
  {
    return value;
  }
  public void setValue(String value)
  {
    this.value = value
    return;
  }
}

The deployment descriptor is:

isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
             id="urn:OrganisationListFetcher">
  <isd:provider type="java"
                scope="Application"
                methods="allElements">
    <isd:java
class="uk.co.landmark.contactmanager.server.organisation.soapservice.Organis
ationListSoapService" static="false"/>
  </isd:provider>


<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListene
r>

  <isd:mappings>
    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:ContactManager"
qname="x:OrganisationListMemberModel"

javaType="uk.co.landmark.contactmanager.common.model.OrganisationListMemberM
odel"

java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"

xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
  </isd:mappings>
</isd:service>




All is well if the OrganisationListMemberModel class contains a native
String instead of an OrganisationName.
However when I use OrganisationName I get the following error:


SOAP-ENV:Server, message = java.lang.IllegalArgumentException: No Serializer
found to serialize a
'uk.co.landmark.contactmanager.common.types.OrganisationName' using encoding
style 'http://schemas.xmlsoap.org/soap/encoding/'.



It looks to me that the Vector and OrganisationListMemberModel classes are
being handled OK, but the OrganisationName class is not.


Any ideas why not?


Thanks in advance - Adam