Hi, I am currently experimenting with NAV 2017 and Visual Studio and was wondering how to execute a codeunit web service built in NAV 2017 from Visual Studio 2015 to post an item journal. Some example code would be greatly appreciated.
*This post is locked for comments
Hi Silva, I have set up a user on the Role tailored Client of NAV 2017, but I receive this error when logging in.
The web page at <webserviceurl> might be temporarily down or it may have moved permanently to a new web address.
That means your web service setup or authentication setup is wrong. You need to correct that before you do anything.
The place you need to look at is the dynamics nav administration/setup.
Unfortunatly the login does not work, though the xml properties of the service is displayed when I type 'localhost' in the web url. The xml only contains 'ServiceName' and 'ServiceName_Port'.
Ok Try pasting the web service url on the web browser and you should see xml properties and methods (It will ask you user and password). If that works the way you are adding service reference is wrong. try above first and if it works i will guide you how to add service reference (bit different its called web reference)
Hi Silva, I have followed the code you have posted but the service does not show on the program when I am trying to create the service object. Just to let you know the codeunit I am trying to implement is 241 'Itm Journal Post'.
Hi,
first create the web service and publish the code unit in web services
Then in VS create the service reference
then use it as the service as example below(Below is a sales order creation in VB.net)
Dim service As New PostSalesOrder_Service
service.Url = webservicepageurl & "PostSalesOrder"
service.UseDefaultCredentials = True
Dim newOrder As New PostSalesOrder
service.Create(newOrder)
newOrder.Sell_to_Customer_Name = txtTCno.Text
newOrder.Posting_Date = DateTime.Now()
-----at the end
service.Update(newOrder)
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156