Hi,
 
I have two services, both return vectors of objects. The first, called getAllDepartments(), returns Department objects. The second getAllEmployees() returns Employee objects. Both Department and Employee are very simple classes, containing private data and get and set methods.
 
When I call getAllDepartment(), the return message is:
 
HTTP/1.0 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 798
Set-Cookie2: JSESSIONID=lshg4z3g81;Version=1;Discard;Path="/soap"
Set-Cookie: JSESSIONID=lshg4z3g81;Path=/soap
Servlet-Engine: Tomcat Web Server/3.2.3 (JSP 1.1; Servlet 2.2; Java 1.2.2; Windows 95 4.10 x86; java.vendor=Sun Microsystems Inc.)
 
<?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:getAllDepartmentsResponse xmlns:ns1="urn:Personnel" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xmlns:ns2="http://xml.apache.org/xml-soap" xsi:type="ns2:Vector">
<item xsi:type="ns1:com.transync.data.Department">
<ID xsi:type="xsd:int">1</ID>
<name xsi:type="xsd:string">Marketing</name>
</item>
<item xsi:type="ns1:com.transync.data.Department">
<ID xsi:type="xsd:int">2</ID>
<name xsi:type="xsd:string">Finance</name>
</item>
</return>
</ns1:getAllDepartmentsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
 
This is perfect, great, just what I want. However, when I call getAllEmployees(), I get this message:
 
HTTP/1.0 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 520
Set-Cookie2: JSESSIONID=6awmcg3jz1;Version=1;Discard;Path="/soap"
Set-Cookie: JSESSIONID=6awmcg3jz1;Path=/soap
Servlet-Engine: Tomcat Web Server/3.2.3 (JSP 1.1; Servlet 2.2; Java 1.2.2; Windows 95 4.10 x86; java.vendor=Sun Microsystems Inc.)
 
<?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:getAllEmployeesResponse xmlns:ns1="urn:Personnel" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xmlns:ns2="http://xml.apache.org/xml-soap" xsi:type="ns2:Vector">
</return>
</ns1:getAllEmployeesResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
 
It's empty. I wrote a test driver for my service to make sure it is returning something, and it is. Here's the mapping code in the client:
 
    SOAPMappingRegistry smr = new SOAPMappingRegistry();
    BeanSerializer beanSer = new BeanSerializer();

    smr.mapTypes(Constants.NS_URI_SOAP_ENC,
                 new QName("urn:Personnel", "com.transync.data.Employee"),
                 com.transync.data.Employee.class, beanSer, beanSer);
 
    smr.mapTypes(Constants.NS_URI_SOAP_ENC,
                 new QName("urn:Personnel", "com.transync.data.Department"),
                 com.transync.data.Department.class, beanSer, beanSer);
 
And here's the mapping in DeploymentDescriptor.xml:
 
<isd:mappings>
        <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                 xmlns:x="urn:Personnel" qname="x:com.transync.data.Employee"
                 javaType="com.transync.data.Employee"
                 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:Personnel" qname="x:com.transync.data.Department"
                javaType="com.transync.data.Department"
                 java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
                 xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>        
       </isd:mappings>
 
Any ideas on why these two very similar objects are behaving differently would be very welcome.
 
Thanks,
Chris

Reply via email to