web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    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

  • Suggested answer
    Andrey Baludin Profile Picture
    3,941 on at

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans