Hi all,
for a couple of reasons, I need to access (using windows authentication) to a Vault 2013 in an Web Application developed with VS 2013/Framework 4.5 so I couldn't add reference to Autodesk.Connectivity.WebServices.dll (maybe it is possible, and it's just my fault?).
So I tried the old way: connecting using the web services, but while I'm able to login using Vault User, I can't find the right way to do it using Windows domain user.
Here is a snippet of my code
string DomainName = "NGDEV"; string ticket = ""; long userId = 0; if (chkWindows.Checked) { // login with Windows User WinAuthServiceSoapClient winAuthSvc = new WinAuthServiceSoapClient(); winAuthSvc.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation; winAuthSvc.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential(txtUser.Text, txtPassword.Text, DomainName); WinAuthService.SecurityHeader secHdr = winAuthSvc.SignIn(txtVault.Text); ticket = secHdr.Ticket; userId = secHdr.UserId; } else { // Login with Vault User SecurityServiceSoapClient secSvc = new SecurityServiceSoapClient(); SecurityService.SecurityHeader secHdr = secSvc.SignIn(txtUser.Text, txtPassword.Text, txtVault.Text); ticket = secHdr.Ticket; userId = secHdr.UserId; } // now we tests to access to a service DocumentService.DocumentServiceSoapClient docSvc = new DocumentService.DocumentServiceSoapClient(); VaultMobileServices.DocumentService.SecurityHeader docSecHdr = new DocumentService.SecurityHeader(); docSecHdr.Ticket = ticket; docSecHdr.UserId = userId; Folder fld = docSvc.GetFolderRoot(docSecHdr); lblFolderId.Text = fld.Id.ToString();
here is the binding of the service
<endpoint address="http://192.168.219.182/autodeskdm/services/winauth/winauthservice.asmx" binding="basicHttpBinding" bindingConfiguration="WinAuthServiceSoap" contract="WinAuthService.WinAuthServiceSoap" name="WinAuthServiceSoap" />
when I try to access using Windows authenticatio I get the error
HTTP request is unauthorized with client authentication scheme 'Anonymous'.
The authentication header received from the server was 'NTLM'
I found a lot of informations but none worked for me, so if anyone could help me I would appreciate.
Thanks
Nicola
Solved! Go to Solution.
Solved by Redmond.D. Go to Solution.
The Vault 2013 SDK DLLs were built against .NET 4.0. I would expect them to load and run fine in a .NET 4.5 application.
What problems are you seeing when you try to add Autodesk.Connectivity.WebServices.dll?
Thanks for your answer Doug,
you're right
I've had some problem adding WebServices3.dll, and I thought it was no more possible, I've tried again with success and now I can use the Autodesk.Connectivity.WebServices.dll as a reference for my project.
Thanks