It turns out I am having trouble setting the Authors. Specifically,
the client is sending them, but the server doesn't seem to be reading
them.
Authors is a list in LibraryItemInfoData and has the following getter
and setter:
public final void setAuthors( final List<Author> allAuthors )
public final List<Author> getAuthors()
I wired the server to send an instance of the LibraryItemInfoData to
the client and tried to make the client send back a message formatted
as closely as possible. If you look below at the Author sections for
what the client is sending and what the server is sending, I think I
was successful at that.
As far as the Author type goes, it is an interface. The
implementation class is AuthorData. Could that be causing this
problem? Is there a way to tell XFire to create AuthorData instances
whenever it gets an Author inside a SOAP body, rather than changing
the method signatures? I actually tried to change the method
signatures, saw the WSDL update, but didn't get any change in
behavior; the authors were still not set.
Any thoughts?
Thanks,
Mark
-------------
You can see in the log output that the keywords I previously had
trouble with have been set successfully, but the authors List is empty.
2006-04-18 21:24:40,685 INFO
[edu.ucsc.whisper.rpc.JaxRpcLibraryService] - <incoming item:
{LibraryItemInfoData: whisperId=null; title=rice;
primaryKeyword=rice; keywords=(cuban, raisens, rice); authors=();
dateCreated=java.util.GregorianCalendar[...]; charEncoding=null;
mimeType=application/octet-stream; size=0; uuid=null; dateEntered=null}>
-------------
This is the relevant section of the WSDL;
<xsd:complexType name="LibraryItemInfoData">
<xsd:sequence>
<xsd:element name="UUID" type="xsd:string" minOccurs="0"
nillable="true" />
<xsd:element name="authors" type="ns1:ArrayOfAuthor"
minOccurs="0" nillable="true" />
<xsd:element name="dateCreated" type="xsd:dateTime"
minOccurs="0" nillable="true" />
<xsd:element name="dateEntered" type="xsd:dateTime"
minOccurs="0" nillable="true" />
<xsd:element name="encoding" type="xsd:string"
minOccurs="0" nillable="true" />
<xsd:element name="keywords" type="tns:ArrayOfString"
minOccurs="0" nillable="true" />
<xsd:element name="lastModified" type="xsd:dateTime"
minOccurs="0" nillable="true" />
<xsd:element name="mimeType" type="xsd:string"
minOccurs="0" nillable="true" />
<xsd:element name="primaryKeyword" type="xsd:string"
minOccurs="0" nillable="true" />
<xsd:element name="size" type="xsd:long" minOccurs="0" />
<xsd:element name="title" type="xsd:string" minOccurs="0"
nillable="true" />
<xsd:element name="typeExtension" type="xsd:string"
minOccurs="0" nillable="true" />
<xsd:element name="username" type="xsd:string"
minOccurs="0" nillable="true" />
<xsd:element name="whisperId" type="xsd:string"
minOccurs="0" nillable="true" />
<xsd:any minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:anyAttribute />
</xsd:complexType>
<xsd:complexType name="ArrayOfAuthor">
<xsd:sequence>
<xsd:element name="Author" type="ns1:Author"
nillable="true" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Author">
<xsd:sequence>
<xsd:element name="familyName" type="xsd:string"
minOccurs="0" nillable="true" />
<xsd:element name="firstName" type="xsd:string"
minOccurs="0" nillable="true" />
<xsd:element name="fullName" type="xsd:string"
minOccurs="0" nillable="true" />
<xsd:element name="organizationName" type="xsd:string"
minOccurs="0" nillable="true" />
<xsd:element name="otherNames" type="xsd:string"
minOccurs="0" nillable="true" />
<xsd:element name="person" type="xsd:boolean"
minOccurs="0" />
<xsd:element name="username" type="xsd:string"
minOccurs="0" nillable="true" />
<xsd:any minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:anyAttribute />
</xsd:complexType>
-------------
The message going to the server is:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="http://rpc.whisper.ucsc.edu"
xmlns:ns5="http://core.whisper.ucsc.edu"
>
<SOAP-ENV:Header>
...
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns4:addItemToLibrary>
<in0>
<ns5:authors>
<Author>
<person>false</person>
<organizationName>cuba</organizationName></Author></ns5:authors>
<ns5:dateCreated>1969-12-31T16:00:00-08:00</ns5:dateCreated>
<ns5:primaryKeyword>rice</ns5:primaryKeyword>
<ns5:title>rice</ns5:title>
<ns5:keywords>
<ns4:string>cuban</ns4:string>
<ns4:string>raisens</ns4:string></ns5:keywords></in0></
ns4:addItemToLibrary>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
-------------
When the server sends an instance of LibraryItemInfo to the client,
it looks like this:
<ns1:LibraryItemInfoData xmlns:ns1="http://core.whisper.ucsc.edu">
<UUID xmlns="http://core.whisper.ucsc.edu">This is not a UUID.</UUID>
<authors xmlns="http://core.whisper.ucsc.edu">
<Author>
<familyName xsi:nil="true" />
<firstName xsi:nil="true" />
<fullName>org author</fullName>
<organizationName>org author</organizationName>
<otherNames xsi:nil="true" />
<person>false</person>
<username xsi:nil="true" />
</Author>
</authors>
<dateCreated xmlns="http://
core.whisper.ucsc.edu">2006-04-18T21:22:54.534-07:00</dateCreated>
<dateEntered xmlns="http://
core.whisper.ucsc.edu">2006-04-18T21:22:54.536-07:00</dateEntered>
<encoding xmlns="http://core.whisper.ucsc.edu">none</encoding>
<keywords xmlns="http://core.whisper.ucsc.edu">
<ns2:string xmlns:ns2="http://rpc.whisper.ucsc.edu">test2</ns2:string>
<ns2:string xmlns:ns2="http://rpc.whisper.ucsc.edu">test</ns2:string>
</keywords>
<lastModified xmlns="http://
core.whisper.ucsc.edu">2006-04-18T21:22:54.536-07:00</lastModified>
<mimeType xmlns="http://core.whisper.ucsc.edu">text/plain</mimeType>
<primaryKeyword xmlns="http://core.whisper.ucsc.edu">test</
primaryKeyword>
<size xmlns="http://core.whisper.ucsc.edu">1024</size>
<title xmlns="http://core.whisper.ucsc.edu">test title</title>
<typeExtension xmlns="http://core.whisper.ucsc.edu">bin</typeExtension>
<username xmlns="http://core.whisper.ucsc.edu">mark</username>
<whisperId xmlns="http://core.whisper.ucsc.edu" xsi:nil="true" />
</ns1:LibraryItemInfoData>