xfire 返回复杂类型

配置返回类型说明:

<?xml version="1.0" encoding="UTF-8"?>
    <!--
        该文件用来描述CommService接口中getUsers()方法返回值的类型
        该文件必须与CommService位于同一目录中,且该文件遵循如下命名规则
        接口名.aegis.xml 如本文件CommService.aegis.xml
    -->
<mappings>
    <!-- 映射getUsers方法返回值类型 -->
    <mapping>
        <method name="getRecommendContents">
         <parameter index="0"  mappedName="User" componentType="#User" />   
            <return-type componentType="#Content" mappedName="Contents"/>
        </method>
        <method name="getCategories">
         <parameter index="0"  mappedName="User" componentType="#User" />  
            <return-type componentType="#Category" mappedName="Categories" />
        </method>
         <method name="getContents">
         <parameter index="0"  mappedName="User" componentType="#User" />  
            <return-type componentType="#Content" mappedName="Contents" />
        </method>
         <method name="getContentsByCateId">
         <parameter index="0"  mappedName="User" componentType="#User" />  
         <parameter index="1"  mappedName="categoryId" componentType="java.lang.String" />   
            <return-type componentType="#Content" mappedName="Contents" />
        </method>
        <method name="getDescImgPaths">
         <parameter index="0"  mappedName="User" componentType="#User" />  
         <parameter index="1"  mappedName="contentId" componentType="java.lang.String" />
         <return-type  componentType="java.lang.String"  mappedName="imgPaths" />  
        </method>
        <!--
            name对应<return-type componentType="#users"/>中的componentType
            class为实体bean的类型即list中存放的类型
            componentType为实体bean的类型
                               如果返回List 不能设置class为List,component 不能设置typeName,不然客户端无法获取数据
        -->
        <component name="User"  class="com.szboeye.webservice.entity.User" />
        <component name="Content"   class="com.szboeye.webservice.entity.Content"/>
        <component name="Category"   class="com.szboeye.webservice.entity.Category"/>
    </mapping>
   

   

</mappings>

你可能感兴趣的:(xfire)