Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Accessing 2013 Web Service from VS 2013/Framework 4.5

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
nicola.garone
479 Views, 2 Replies

Accessing 2013 Web Service from VS 2013/Framework 4.5

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

2 REPLIES 2
Message 2 of 3
Redmond.D
in reply to: nicola.garone

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?



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 3 of 3
nicola.garone
in reply to: Redmond.D

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report