3 Replies Latest reply on Jul 11, 2015 12:48 AM by Vasudevan Madubhushi

    Simple.OData.Client Exception

    Vasudevan Madubhushi Newbie

      Hi All,

        We are writing a simple .NET (4.5) client App, which uses Simple.OData.Client library. Teiid server is 8.11 Final deployed on Ubuntu. The data model is fairly straightforward with two related entities FirePanels and SoftwareUnits which have a one to one mapping.

      When querying for a single Entity with a  request like this : http://10.47.86.130:8080/odata/FirePanels2.1/FirePanels?$format=json  , we get a response with deferred content. It appears that Teiid is returning the related entities by default. I would have expected this to be returned with an $expand directive.  A .NET client which uses the Simple.OData.Client library throws an exception because of this. See attached code sample and the exception message below.

      Is there a way deferred entries can be suppressed in Teiid when querying for a single entity and return only for $expand directive? (I know expand is not supported on 8.11 Final based on Ramesh's response to a previous question.)  

      Thanks for your help on this!

       

      Exception Message:

      {Microsoft.Data.OData.ODataException: A entry was found in a navigation link of type feed; however, only a deferred feed can occur in a navigation link of type feed.

       

      Json response for above URL:

       

      {

      "d" : {

      "results" : [

      {

      "__metadata" : {

      "uri" : "http://10.47.86.130:8080/odata/FirePanels2.1/FirePanels.FirePanels(1L)", "type" : "FirePanels.FirePanels"

      }, "pkey" : "1", "keySerialModel" : "asset-one", "assetType" : "FirePanel", "SoftwareUnits" : {

      "__deferred" : {

      "uri" : "http://10.47.86.130:8080/odata/FirePanels2.1/FirePanels.FirePanels(1L)/SoftwareUnits"

      }

      }

      }, {

      "__metadata" : {

      "uri" : "http://10.47.86.130:8080/odata/FirePanels2.1/FirePanels.FirePanels(2L)", "type" : "FirePanels.FirePanels"

      }, "pkey" : "2", "keySerialModel" : "asset-two", "assetType" : "FirePanel", "SoftwareUnits" : {

      "__deferred" : {

      "uri" : "http://10.47.86.130:8080/odata/FirePanels2.1/FirePanels.FirePanels(2L)/SoftwareUnits"

      }

      }

      }

      ]

      }

      }