Is it Possible to Manipulate NAV Data from an OData Web Service Outside of Dynamics NAV 2018?

GigadrosGigadros Posts: 7Member
I am currently trying to do something identical to what is done in the following video:



Essentially, the goal is to have some sort of external website or application that can manipulate the records in NAV 2018. I have followed tutorials like this, and others from the Microsoft Docs website to no success. Whenever I get to the step in Visual Studio to Add Service Reference, I am always met with the same error:

zgrfwyk3vkbj.png

The link in this error is not relevant to NAV, and I can't find a tutorial that does a method that isn't identical to this one, the most recent one I could fine was done in NAV 2016. I am unable to find any tutorials that use this 'OData Client Code Generation Tool' with NAV either.

Does there exist alternatives to achieve this in Dynamics NAV 2018?

Answers

  • SanderDkSanderDk Posts: 214Member
    I think you are mission some text in your URL..
    Normally it's http://server:port/Instance/Protocol/company/service
    Aren't there missing service and company ?
    For help, do not use PM, but use forum instead, perhaps other people have the same question, or better answers.
  • GigadrosGigadros Posts: 7Member
    edited 2018-12-10
    I am currently trying to complete this on a Chronus Demo Database on a remote server. Also, I display the XML data in a web browser when using that same address, so I am unsure what the issue is here.
  • SanderDkSanderDk Posts: 214Member
    edited 2018-12-10
    Have you copyed the URL for the page webservice?
    As I wrote above, it looks like your URL is incomplet.
    Do you have a screenshot of the webservice page?
    For help, do not use PM, but use forum instead, perhaps other people have the same question, or better answers.
  • GigadrosGigadros Posts: 7Member
    Thank you for pointing out the issue with the URL, I had changed it and am now receiving a more meaningful error message. It seems to be something relating to authorization:

    There was an error downloading 'http://addresshere:7048/DynamicsNAV110/OData/Company('CRONUS%20Canada%2C%20Inc.')/Customers/$metadata'.
    The request failed with HTTP status 400: Bad Request.
    Metadata contains a reference that cannot be resolved: 'http://addresshere:7048/DynamicsNAV110/OData/Company('CRONUS Canada%2C Inc.')/Customers'.
    The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'NTLM'.
    The remote server returned an error: (401) Unauthorized.
    If the service is defined in the current solution, try building the solution and adding the service reference again.

    Also, do I need to have developed the webservice first? I haven't made anything yet because I am having problems connecting my Visual Studio Service Reference to my address, which is odd since I do get an XML displayed in both IE and Chrome, along with the built in IE in Visual Studio.
  • SanderDkSanderDk Posts: 214Member
    You new/Next problem is a worse problem, you need to connect to your webservice as a NAV user.
    And perhaps you need to look at using a certificate :)
    For help, do not use PM, but use forum instead, perhaps other people have the same question, or better answers.
Sign In or Register to comment.