Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

https web service with C#

(0) ShareShare
ReportReport
Posted on by

Hi, we tried to connect NAV web service via https on c# with no success so far. Could someone lead me to a working example ?

What we need is editing data on NAV via https web service on a web page ( using c#)


Ths is what we have :

_binding = new BasicHttpBinding();
_binding.Security.Mode = BasicHttpSecurityMode.TransportWithMessageCredential;
_binding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.Certificate;
_binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
EndpointAddress _endpoint = new EndpointAddress(new Uri("https://192.168.1.19:8047/TEST/WS/TEST/Codeunit/Web_Fonksiyonlari";));
recws2 = new WS_WEBPAGE2.Web_Fonksiyonlari_PortClient(_binding, _endpoint);
recws2.ClientCredentials.UserName.UserName = xxx@st.com";
recws2.ClientCredentials.UserName.Password = "xxxxxx";
recws2.ClientCredentials.ClientCertificate.SetCertificate(StoreLocation.LocalMachine, StoreName.My,
X509FindType.FindByThumbprint, "852F6AF8CC8F64EB4DD7C9EF26FDD866275B32C4");
recws2.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode =
System.ServiceModel.Security.X509CertificateValidationMode.PeerOrChainTrust;
recws2.EF_Post_NAV();

*This post is locked for comments

  • Suggested answer
    Andrey Baludin Profile Picture
    Andrey Baludin 3,941 on at
    RE: https web service with C#

    Try to use NTLM instead of basic auth.

    For this set an NTLM authentication mark on NAV instance and restart it. Also change basic to ntlm in c#

    ntlm.jpg

  • Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: https web service with C#

    What type of error or problem do you have in detail?

    Normally it's just using like any other WS:

    https://support.microsoft.com/en-us/help/901183/how-to-call-a-web-service-by-using-a-client-certificate-for-authentica

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,407 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans