Skip to Content
avatar image
Former Member

Using $expand with multi-level relationships

Hello all,

I have a gateway service where I have defined entity types and their relationships in the service builder as follows:

Root -> NodeA -> NodeB

Root -> NodeC -> NodeD

Root -> NodeE -> NodeF

I have defined all relationships as 1-N. I have implemented GET_ENTITY_SET and GET_ENTITY methods for all entity types and when I run them individually they are returning the data I expect.

I have been studying using $expand for deep reads so that I can return the content of all entity types with one call. Ideally, as this data set is relatively small, I would like to perform a single GET like this:


When I test the $expand command returning all the second level entity sets like this:


it works as expected.

Also, when I test the $expand command returning the lower level entity set from the second level entity set like this:


it works as expected.

However, as soon as I attempt to return the lower level entity sets from the top level using a command like this:


I get a 500 connection timeout on the server.

I have not implemented GET_EXPANDED_ENTITYSET or GET_EXPANDED_ENTITY. Do you expect that not implementing these is causing my current timeout issues? Should these methods always be implemented for performance gains? Does anyone know of any good examples of implementing these methods to achieve what I'm trying to do?

Many thanks in advance.


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Jul 16, 2013 at 04:58 AM

    Hi Steve,

    You don't have to implement the Get_Expand* methods for expand to work,

    as the Gateway FW  offers a generic $expand functionality.

    Although then you do some performance compromizing.

    Check that all your navigations works without $expand , it might be a wrong navigation property that you used.

    And finally if you still don't find the problem, debug it , 500 is usually an issue with the specific service code.



    Add comment
    10|10000 characters needed characters exceeded