Click here to Skip to main content
15,850,921 members
Home / Discussions / C#
   

C#

 
QuestionInteracting with a Page Web Service (OData v4) Error Pin
MaWeRic3-Jan-17 23:03
MaWeRic3-Jan-17 23:03 
AnswerRe: Interacting with a Page Web Service (OData v4) Error Pin
Gerry Schmitz4-Jan-17 10:23
mveGerry Schmitz4-Jan-17 10:23 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic4-Jan-17 10:27
MaWeRic4-Jan-17 10:27 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
Gerry Schmitz4-Jan-17 10:31
mveGerry Schmitz4-Jan-17 10:31 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic4-Jan-17 12:01
MaWeRic4-Jan-17 12:01 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic4-Jan-17 12:43
MaWeRic4-Jan-17 12:43 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
Gerry Schmitz4-Jan-17 13:31
mveGerry Schmitz4-Jan-17 13:31 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic4-Jan-17 20:13
MaWeRic4-Jan-17 20:13 
Trying executing .Execute on the object of type :
Global.Microsoft.OData.Client.DataServiceQuery(Of Customer_Card)

Gives me this object and I can see in fiddler that response is received and correct but accoring to error TotalCount is missing:
https://postimg.org/image/eyv1hglnj/
However I got the objext I am supposed to.

If I try to call .ToList it first makes call to .Execute and then try to create :
System.Collections.Generic.List(Of NAVEntities.Customer_Card) 

But it produces an error and I the object looking like this:
https://postimg.org/image/e3ewt9b5j/

Full stacktrace is:
Microsoft.OData.Core.ODataException was unhandled
  HResult=-2146233079
  Message=When writing a JSON response, a user model must be specified and the entity set and entity type must be passed to the ODataMessageWriter.CreateODataEntryWriter method or the 
  ODataFeedAndEntrySerializationInfo must be set on the ODataEntry or ODataFeed that is being written.
  Source=Microsoft.OData.Core
  StackTrace:
       at Microsoft.OData.Core.ODataFeedAndEntryTypeContext.ValidateAndReturn[T](T value)
       at Microsoft.OData.Core.ODataFeedAndEntryTypeContext.get_NavigationSourceName()
       at Microsoft.OData.Core.Evaluation.ODataConventionalEntityMetadataBuilder.ComputeId()
       at Microsoft.OData.Core.Evaluation.ODataConventionalEntityMetadataBuilder.ComputeAndCacheId()
       at Microsoft.OData.Core.Evaluation.ODataConventionalEntityMetadataBuilder.GetId()
       at Microsoft.OData.Client.Materialization.MaterializerEntry.UpdateEntityDescriptor()
       at Microsoft.OData.Client.Materialization.FeedAndEntryMaterializerAdapter.ReadEntryCore()
       at Microsoft.OData.Client.Materialization.FeedAndEntryMaterializerAdapter.TryReadEntry(MaterializerEntry& entry)
       at Microsoft.OData.Client.Materialization.FeedAndEntryMaterializerAdapter.<LazyReadEntries>d__0.MoveNext()
       at Microsoft.OData.Client.Materialization.FeedAndEntryMaterializerAdapter.Read()
       at Microsoft.OData.Client.Materialization.ODataReaderEntityMaterializer.ReadNextFeedOrEntry()
       at Microsoft.OData.Client.Materialization.ODataEntityMaterializer.ReadImplementation()
       at Microsoft.OData.Client.MaterializeAtom.MoveNextInternal()
       at Microsoft.OData.Client.MaterializeAtom.MoveNext()
       at System.Linq.Enumerable.<CastIterator>d__94`1.MoveNext()
       at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
       at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
       at Data.WebServices.ODataTestApp.MainModule.Main() in Data.WebServices.OData.TestApp\MainModule.cs:line 19
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 


Update : I Have error on TotalCount on the Company-call that worked so thats not the case.

modified 5-Jan-17 1:26am.

GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
Gerry Schmitz4-Jan-17 20:47
mveGerry Schmitz4-Jan-17 20:47 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic4-Jan-17 21:10
MaWeRic4-Jan-17 21:10 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic4-Jan-17 21:13
MaWeRic4-Jan-17 21:13 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
zequion5-Jan-17 0:08
professionalzequion5-Jan-17 0:08 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
Pete O'Hanlon5-Jan-17 0:09
subeditorPete O'Hanlon5-Jan-17 0:09 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
Gerry Schmitz4-Jan-17 22:19
mveGerry Schmitz4-Jan-17 22:19 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic5-Jan-17 0:12
MaWeRic5-Jan-17 0:12 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic5-Jan-17 2:00
MaWeRic5-Jan-17 2:00 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
Gerry Schmitz5-Jan-17 6:23
mveGerry Schmitz5-Jan-17 6:23 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic5-Jan-17 9:00
MaWeRic5-Jan-17 9:00 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
Gerry Schmitz5-Jan-17 9:25
mveGerry Schmitz5-Jan-17 9:25 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic5-Jan-17 9:26
MaWeRic5-Jan-17 9:26 
QuestionGlobal structure in Main, Functions and .dlls Pin
zequion3-Jan-17 22:58
professionalzequion3-Jan-17 22:58 
AnswerRe: Global structure in Main, Functions and .dlls Pin
Richard MacCutchan4-Jan-17 0:32
mveRichard MacCutchan4-Jan-17 0:32 
GeneralRe: Global structure in Main, Functions and .dlls Pin
zequion4-Jan-17 2:11
professionalzequion4-Jan-17 2:11 
GeneralRe: Global structure in Main, Functions and .dlls Pin
Richard MacCutchan4-Jan-17 2:16
mveRichard MacCutchan4-Jan-17 2:16 
GeneralRe: Global structure in Main, Functions and .dlls Pin
zequion4-Jan-17 7:41
professionalzequion4-Jan-17 7:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.