facebook

web service returning list

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #272347 Reply

    patel_123
    Member

    hi
    this is code snippet that i tried.
    @WebMethod()
    public List<CustomerInfo> getAccountList()
    {
    Query query=em.createQuery(“from CustomerInfo c”);
    return query.getResultList();
    }

    i tested this code using web service explorer but there it returns null.

    could anybody tell me where i went wrong

    #272381 Reply

    Loyal Water
    Member

    Moving to Off Topic >> Software Development

    #272383 Reply

    rkm258
    Member

    hi,

    When using types like list and other complex type, the xfire expects to have the aegis.xml file for the corresponding service interface or the class using this type.

    ex:

    on using a service with interface like

    public interface IListService {

    public List getListOfDiv();

    }

    give a xml file IListService.aegis.xml file in the same folder as this class with contents like

    <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=”getListOfDiv”>
    <return-type mappedName=”DivInfoList” componentType=”com.cdb.list.DeptInfo”/>
    </method>
    </mapping>
    </mappings>

    Also on using objects i think the default aegis binding expects the class to have properties with setters and getters. I never tried returning other type of classes.

    Other than this other configuration will be taken care by the myeclipse and the xfire.

    reply if any concerns.

    bye

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: web service returning list

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