facebook

Reg: Web Service Operations using or returning complex types

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 2 posts - 16 through 17 (of 17 total)
  • Author
    Posts
  • #273140

    geek.shrek
    Member

    Hi Ram,

    I wonder if you be able to give me the code example hoe to use the Collection in XFire?

    I have problem when I creating the client to received the Collection as an Object.

    Thanks,
    Shrek

    #273246

    rkm258
    Member

    If u are using Collection like Map in the service operation as return type or parameter, fo ex
    public interface IOfficeSetupHierService {
    public Map getDetails(String username,String password,int deptid);
    }

    use IOfficeSetupHierService.aegis.xml as

    <?xml version=”1.0″ encoding=”UTF-8″?>

    <mappings xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
    xsi:schemaLocation=”http://xfire.codehaus.org/schemas/1.0/mapping.xsd”&gt;
    <mapping>
    <method name=”getDetails”>
    <return-type mappedName=”OfficeMap” keyType=”java.lang.String” componentType=”com.hr.service.Office”/>
    </method>
    </mapping>
    </mappings>

    where office is object in map.

    Also when u are using Map as property in a class like

    public class ClassName
    {
    private Map mapping;
    public Map getMapping()
    {
    }
    public Map setMapping()
    {
    }
    }

    use ClassName.aegis.xml as

    <?xml version=”1.0″ encoding=”UTF-8″?>

    <mappings xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
    xsi:schemaLocation=”http://xfire.codehaus.org/schemas/1.0/mapping.xsd”&gt;
    <mapping>
    <property name=”mapping” keyType=”java.lang.String” componentType=”com.hr.service.Office”/>
    </mapping>
    </mappings>

    Make sure to keep these xml files in the same folder as the classes.
    Similarly for List

    <?xml version=”1.0″ encoding=”UTF-8″?>

    <mappings xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
    xsi:schemaLocation=”http://xfire.codehaus.org/schemas/1.0/mapping.xsd”&gt;
    <mapping>
    <method name=”getDetails”>
    <return-type mappedName=”SeasonalOfficeList” componentType=”com.hr.service.SeasonalOffice”/>
    </method>
    </mapping>
    </mappings>

    where getDetails is an service operation that is returning a List.

    On using List, on the client side the class obtained will be like ArrayOfSeasonalOffice from which u can get the SeasonalOffice. This is due to the way WSDL is generated.

    Ask me if u need any thing else.

    Do provide your contact number or email in case u need more help

    bye

Viewing 2 posts - 16 through 17 (of 17 total)
Reply To: Reg: Web Service Operations using or returning complex types

You must be logged in to post in the forum log in