Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Adding NAV ODATA web service to ASP.NET Project as a service reference

(0) ShareShare
ReportReport
Posted on by 5

Hello, 

Am trying to Add NAV ODATA web service to my .NET application. The end point is able to return data on postman and when I try to access it from a browser.

However, when I try adding the endpoint as a service reference to my solution project. I get the error below.

3630.test.png

Any help to go about this will be appreciated

  • Lars Lohndorf-Larsen Profile Picture
    on at
    RE: Adding NAV ODATA web service to ASP.NET Project as a service reference

    How about if you create a new page and then have very simple names for each field. I think that even space in field names get converted into _,

    In the example below I have field "Search Name", but I changed the Name to SearchName, which is what reflects in the OData:

    pastedimage1603897708916v1.png

    Would that work?

  • Lynmat Profile Picture
    5 on at
    RE: Adding NAV ODATA web service to ASP.NET Project as a service reference

    I can comfortably use soap URL, the issue is ODATA Url which returns the service I want but it fails to scaffold.

    Now this is the issue. If am able to remove these fields from NAV pastedimage1603869927165v2.pngpastedimage1603869967461v3.pngpastedimage1603870000781v4.png and pastedimage1603870040494v5.png then I wil be able to fix the below problem

    3782.test.png

    I think NAV does not allow this naming convention for the fields. These fields do not exist in my Services though they must be inheriting from fields 'Branch_Code', 'Bank_Code' and 'Citizenship' since these fields exist. I want to do away with the latter fields but i dont know how 

  • Lars Lohndorf-Larsen Profile Picture
    on at
    RE: Adding NAV ODATA web service to ASP.NET Project as a service reference

    Hello, please try a few more steps. From "Service Reference", click on "Advanced", then "Add Web Reference", and then copy the URL into the URL field there:

    pastedimage1603800745462v1.png

    Also, rather than putting in a general URL (metadata), I cannot remember if you may need to specify either this URL:

    http://MYPCk:13047/BC130/WS/CRONUS%20International%20Ltd./Services

    Or from there a specific service like this:

    http://MyPC:13047/BC130/WS/CRONUS%20International%20Ltd./Page/Chart_of_Accounts

    And notice that here I am using SOAP URL, not OData.

    Then follow the steps here as much as you can:

    https://docs.microsoft.com/en-us/archive/blogs/nav_developer/nav-2009-sample-c-project-to-consume-a-nav-web-service

    I am sure that things have changed since then, so I don't think it applies 100%.

    And consider if you do need to use OData or SOAP (or just anything that works), but I think integration differes depending on which method.

  • Lynmat Profile Picture
    5 on at
    RE: Adding NAV ODATA web service to ASP.NET Project as a service reference

    I right clicked on my application ->Add -> Service Reference.

    Screenshot-_2800_75_2900_.png

    Then I pasted the OData end point from NAV which when I click GO, it will find the service I want. The issue is when I proceed it doesn't retrieve the contents of the service. There is an error something to do with naming conventions of the field names from NAV.

    Screenshot-_2800_76_2900_.png

    Here it is

    2388.test.png

    But the above fields are absent in any of my tables. Am wondering how to fix this.

  • Lars Lohndorf-Larsen Profile Picture
    on at
    RE: Adding NAV ODATA web service to ASP.NET Project as a service reference

    Hello, I think that there are different ways to add services from VS (assuming that this is what you use), can you add screenshots of how and where you do this?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
YUN ZHU Profile Picture

YUN ZHU 432 Super User 2025 Season 1

#2
Sagar Dangar, MCP Profile Picture

Sagar Dangar, MCP 308

#3
Mansi Soni Profile Picture

Mansi Soni 302

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans