Yes I think so:


smr.mapTypes(encodingStyle,
             new QName("urn:" + nameSpaceURI,
"OrganisationListMemberModel"),
             OrganisationListMemberModel.class,
             org.apache.soap.encoding.soapenc.BeanSerializer,
             org.apache.soap.encoding.soapenc.BeanSerializer);


The basic question I think is how does SOAP (de)serialize a vector of user
defined types that contain other UDT's?

e.g.:
class Type1
{
  private Type2 member1;
  private Type3 member2;

  // Ctors, Accessors etc...
}


Assuming Type1, Type2 and Type3 all have a no-args ctor and getters/setters
for their properties, how should one specify the mapping?


Thanks - Adam











-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 13 July 2001 22:38
To: [EMAIL PROTECTED]
Subject: Re: Problems serializing a vector of user defined classes with
BeanSerializer



Did you use SOAPMappingRegistry to set the map types in your client code,
before invoking the call?




                    "Adam Lipscombe"
                    <[EMAIL PROTECTED]        To:
<[EMAIL PROTECTED]>
                    ess.co.uk>                 cc:
                                               Subject:     Problems
serializing a vector of
                    07/13/2001 11:36 AM        user defined classes with
BeanSerializer
                    Please respond to
                    soap-user





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








Reply via email to