Click here to Skip to main content
15,888,263 members
Home / Discussions / C#
   

C#

 
GeneralRe: A Better Way? Pin
Kevin Marois5-Jan-17 4:32
professionalKevin Marois5-Jan-17 4:32 
GeneralRe: A Better Way? Pin
Eddy Vluggen5-Jan-17 4:36
professionalEddy Vluggen5-Jan-17 4:36 
GeneralRe: A Better Way? Pin
Pete O'Hanlon5-Jan-17 6:00
mvePete O'Hanlon5-Jan-17 6:00 
AnswerRe: A Better Way? Pin
#realJSOP6-Jan-17 4:45
mve#realJSOP6-Jan-17 4:45 
GeneralRe: A Better Way? Pin
Kevin Marois6-Jan-17 4:47
professionalKevin Marois6-Jan-17 4:47 
QuestionC#.net:Listen to event fire on app minimize to tray Pin
hassaan mustafa4-Jan-17 3:07
hassaan mustafa4-Jan-17 3:07 
AnswerRe: C#.net:Listen to event fire on app minimize to tray Pin
Eddy Vluggen4-Jan-17 7:05
professionalEddy Vluggen4-Jan-17 7:05 
QuestionInteracting with a Page Web Service (OData v4) Error Pin
MaWeRic3-Jan-17 22:03
MaWeRic3-Jan-17 22:03 
Hi!
I have published a Microsoft Dynamics NAV page as an OData web service V4.
I used Odata v4 Client Code Genrator ver 2.4.0 to create the Client side proxy classes for my C# project.
When I make a simple call to "myhost/.../Company" everything works like a charm using simple code like this:

C#
NAVCient = new NAVEntities.NAV(new Uri("myhost/.../ODataV4"));
NAVCient.Credentials = new Net.NetworkCredential("usr", "psw");
List<NAVEntities.Company> company = NAVCient.Company.ToList;


I get my list of available Companies. Now I want to get the CustomerCards for my selected Company. I do like this:

C#
NAVCient = new NAVEntities.NAV(new Uri("myhost/.../ODataV4/Company('MyTest')")); 
NAVCient.Credentials = new Net.NetworkCredential("usr", "psw"); 
List<NAVEntities.Customer_Card> Customers = NAVCient.Customer_Card.ToList;


The uri genrated is correct and I can see the response comming back correct using fiddler with all my data. Code gets an exception trying to parse the information. At first i thought the backend had some issues but clearly its the client producing this error bec in fiddler I can see my result and nothing else as a response from server :

"An unhandled exception of type 'Microsoft.OData.Core.ODataException' occurred in Microsoft.OData.Core.dll
Additional information: 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."


Any suggestions/advice?
I have tried other sources and they work as it seem.
Thanks for your help
// henrik
Tags:
AnswerRe: Interacting with a Page Web Service (OData v4) Error Pin
Gerry Schmitz4-Jan-17 9:23
mveGerry Schmitz4-Jan-17 9:23 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic4-Jan-17 9:27
MaWeRic4-Jan-17 9:27 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
Gerry Schmitz4-Jan-17 9:31
mveGerry Schmitz4-Jan-17 9:31 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic4-Jan-17 11:01
MaWeRic4-Jan-17 11:01 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic4-Jan-17 11:43
MaWeRic4-Jan-17 11:43 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
Gerry Schmitz4-Jan-17 12:31
mveGerry Schmitz4-Jan-17 12:31 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic4-Jan-17 19:13
MaWeRic4-Jan-17 19:13 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
Gerry Schmitz4-Jan-17 19:47
mveGerry Schmitz4-Jan-17 19:47 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic4-Jan-17 20:10
MaWeRic4-Jan-17 20:10 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic4-Jan-17 20:13
MaWeRic4-Jan-17 20:13 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
zequion4-Jan-17 23:08
professionalzequion4-Jan-17 23:08 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
Pete O'Hanlon4-Jan-17 23:09
mvePete O'Hanlon4-Jan-17 23:09 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
Gerry Schmitz4-Jan-17 21:19
mveGerry Schmitz4-Jan-17 21:19 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic4-Jan-17 23:12
MaWeRic4-Jan-17 23:12 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic5-Jan-17 1:00
MaWeRic5-Jan-17 1:00 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
Gerry Schmitz5-Jan-17 5:23
mveGerry Schmitz5-Jan-17 5:23 
GeneralRe: Interacting with a Page Web Service (OData v4) Error Pin
MaWeRic5-Jan-17 8:00
MaWeRic5-Jan-17 8:00 

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.