You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by David Wall <dw...@Yozons.com> on 2001/04/30 00:13:52 UTC

Embedded object not serialized

I have an object Message that contains another object of type MessageOptions.  They are both basic beans so that the BeanSerializer should work.

It seems that the calls work okay, but the options are empty in response.  Debug code in them shows that I've created the embedded MessageOptions object.  Is there a trick or namespace issue that I have to take care of when one bean is embedded in another bean?

Thanks,
David


In my deployment, I used mappings both to beanserializer:
  <isd:mappings>
    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn://yozons.net/ssd/IMessageManagement" qname="x:message"
             javaType="com.yozons.xmlapi.ssd.Message"
             java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
             xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn://yozons.net/ssd/IMessageManagement" qname="x:messageOptions"
             javaType="com.yozons.xmlapi.ssd.MessageOptions"
             java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
             xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
  </isd:mappings>    

And in my client, I did the same:
        smr.mapTypes( Constants.NS_URI_SOAP_ENC,
                      new QName("urn://yozons.net/ssd/IMessageManagement", "message"),
                      Message.class, 
                      beanSer, 
                      beanSer
                    );
        smr.mapTypes( Constants.NS_URI_SOAP_ENC,
                      new QName("urn://yozons.net/ssd/IMessageManagement", "messageOptions"),
                      MessageOptions.class, 
                      beanSer, 
                      beanSer
                    );


The TCP Tunnel trace shows:

Server: Apache/1.3.19 (Unix) mod_jk mod_ssl/2.8.1 OpenSSL/0.9.6
Content-Length: 1950
Set-Cookie2: JSESSIONID=5l4tafdcb1;Version=1;Discard;Path="/soap"
Set-Cookie: JSESSIONID=5l4tafdcb1;Path=/soap
Connection: close
Content-Type: text/xml; charset=utf-8

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:getMessageByIdResponse xmlns:ns1="urn://yozons.net/ssd/IMessageManagement" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="ns1:message">
<folderId xsi:type="xsd:long">8592082075650</folderId>
<ownerUserId xsi:type="xsd:long">8592082075648</ownerUserId>
<replyToMessageId xsi:type="xsd:long">0</replyToMessageId>
<roleCc xsi:type="xsd:boolean">false</roleCc>
<options xsi:type="ns1:messageOptions">
</options>
<roleFrom xsi:type="xsd:boolean">true</roleFrom>
<subject xsi:type="xsd:string">Test message</subject>
<fromSsdAppId xsi:type="xsd:int">2000</fromSsdAppId>
<body xsi:type="xsd:string">Hello, this is a test.</body>
<formattedSentTimestamp xsi:type="xsd:string">04/29/01 12:57 PM PDT</formattedSentTimestamp>
<readTimestamp xsi:type="xsd:long">988574828190</readTimestamp>
<toText xsi:type="xsd:string">dwall@expertrade.com</toText>
<fromUserId xsi:type="xsd:long">8592082075648</fromUserId>
<roleBcc xsi:type="xsd:boolean">false</roleBcc>
<fromEmail xsi:type="xsd:string">dwall@yozons.com</fromEmail>
<size xsi:type="xsd:int">10391</size>
<sentTimestamp xsi:type="xsd:long">988574250100</sentTimestamp>
<id xsi:type="xsd:long">10737418240</id>
<bccText xsi:type="xsd:string"></bccText>
<roleTo xsi:type="xsd:boolean">false</roleTo>
<sizeInUnits xsi:type="xsd:string">10.1k</sizeInUnits>
<formattedReadTimestamp xsi:type="xsd:string">04/29/01 1:07 PM PDT</formattedReadTimestamp>
<ccText xsi:type="xsd:string"></ccText>
<ownerEmail xsi:type="xsd:string">dwall@yozons.com</ownerEmail>
<fromDisplayName xsi:type="xsd:string">David Wall</fromDisplayName>
<role xsi:type="xsd:string">f</role>
</return>
</ns1:getMessageByIdResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Re: Embedded object not serialized

Posted by David Wall <dw...@Yozons.com>.
Sorry. Was my coding error.  My boolean getters were not prefixed with "is"
(I was using "allows"), which I'm pretty sure is the javabeans preference
for booleans (and when not using "get").

David


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Embedded object not serialized

Posted by David Wall <dw...@Yozons.com>.
Sorry. Was my coding error.  My boolean getters were not prefixed with "is"
(I was using "allows"), which I'm pretty sure is the javabeans preference
for booleans (and when not using "get").

David


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org