Can't connect to Vault using API

Can't connect to Vault using API

Anonymous
Not applicable
3,149 Views
8 Replies
Message 1 of 9

Can't connect to Vault using API

Anonymous
Not applicable

We recently upgraded from AD2013 to 2016.  I have a vb app that worked until the upgrade.

 

This used to work but now does not:

 

Dim login As New UserPasswordCredentials("engserver", "Vault", UserName, UserPW, True)  ' log in as read-only, which doesn't consume a license

 

        Using ServiceManager As New WebServiceManager(login)

 

The code errors on the "using. . . " line.

 

 

From the output window:

 

Exception thrown: 'System.Net.WebException' in Autodesk.Connectivity.WebServices.dll

An unhandled exception of type 'System.Net.WebException' occurred in Autodesk.Connectivity.WebServices.dll

Additional information: The request failed with HTTP status 404: Not Found.

The thread 0x14f0 has exited with code 0 (0x0).

The program '[5088] dwfx.vshost.exe' has exited with code 0 (0x0).

 

 

Any suggestions?

 

 

 

 

 

0 Likes
3,150 Views
8 Replies
Replies (8)
Message 2 of 9

gavbath
Collaborator
Collaborator

Hi Steve. The way you login has changed. You now create or get a Connection object (from the VDF) that you use to access the WebServiceManager.

 

Here is an article all about it: http://knowledge.autodesk.com/support/vault-products/learn-explore/caas/CloudHelp/cloudhelp/Help/ENU...

 

 

Gavin Bath
MFG / CAM Technical Specialist
Design and Motion Blog
Facebook | Twitter | LinkedIn | YouTube


   

0 Likes
Message 3 of 9

Anonymous
Not applicable

Thanks, Gavin.  Can anyone provide me with the vb equivalent of the following C# code?

 

0 Likes
Message 4 of 9

gavbath
Collaborator
Collaborator

Gee, I haven't done any VB in ages but...

 

I think it'd be:

 

 

Dim results As VDF.Vault.Results.LoginResult

results = VDF.Vault.Library.ConnectionManager.Login("localhost", "Vault", "Administrator", "", VDF.Vault.Currency.Connections.AuthenticationFlags.Standard, null)


Dim conn As VDF.Vault.Currency.Connections.Connection = null

If results.Success Then

         conn = results.Connection

End If

 

You'll need to set up the namespace alias for VDF. Usually VDF refers to the Autodesk.DataManagement.Client.Framework library.

 

If you haven't used the VDF, start here: http://knowledge.autodesk.com/support/vault-products/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU...

 

If you can't get it to work, explore one of the VB.net code samples in the Vault SDK folder.

 

Gavin Bath
MFG / CAM Technical Specialist
Design and Motion Blog
Facebook | Twitter | LinkedIn | YouTube


   

0 Likes
Message 5 of 9

Anonymous
Not applicable

Once again, thanks, Gavin.

 

I was able to get the vb to accept the connection string.  Then my code failed on the next line since it called for "using ServiceManager".

 

I set up the namespace alias - following another example I found in the forums.  Still having problems.

 

Unfortunately, I am unable to check out the VB.net code samples in the Vault SDK folder because I can't download the developer tools (problem also posted for help in this forum).

 

Normally, I'm not this inept.  The utility that we have was developed by a person who is no longer with our company.  It looks like he cobbled together all sorts of tasks that are now more easily done through the API.  Trying to troubleshoot what he did rather than to re-develop the entire utility is the dilemma I now face.  I believe that if I were to start from scratch, the solution I could develop would be much more elegant.  Unfortunately, what he developed took him years.  I don't have that much time.  So, I'm debugging the code line by line as it fails.

 

I really appreciate your help so far.  I spent a long time trying to determine why the connection string didn't work.  Even created an incident with AD.  The only response I got was to check the references to the Vault dlls. 

 

One further question for you:  In your reply, you seem to indicate that using the VDF method of connection is required  - in place of using the web service manager?  Is it really just a choice of method, or is it truly required?

 

Reason for my question:  if I can get the Web Services Manager to work, then all of the calls already in the program should continue to work.

 

Thanks again for your help

 

 

Steve Sibley

0 Likes
Message 6 of 9

minkd
Alumni
Alumni

You don't have to use the VDF Connection to login to a 2016 Vault Server ... you can still use the WebServiceManager in the SDK.

 

What you have to do it is port to a newer SDK instead of the 2013 SDK.  A 2013 client cannot connect to a 2016 server.

 

You could port to the 2014 SDK or 2015 SDK since a 2016 server has backwards compatibility for N-1 & N-2; but the compability is not perfect.  In fact, if you are doing anything related to Items, you must port to the 2016 SDK since we were not able to maintain compatibility for the ItemService (the changes were too significant). So IMHO, it would be best to port to the 2016 SDK.

 

-Dave



Dave Mink
Fusion Lifecycle
Autodesk, Inc.
0 Likes
Message 7 of 9

Anonymous
Not applicable

Thanks, guys for your help.

 

Here is an update.  I deleted all of the References in my project and relinked them to the latest Vault/Inventor dll's.

 

Now, it appears that the member "DownloadFile" is no longer a member of ServiceManager.DocumentService.  None of the suggested replacements have the same number of arguments.

 

Dim newfileName As String = ServiceManager.DocumentService.DownloadFile(ECOFiles(2, k), False, fileData).

 

So, basically, the Project will no longer build without errors.

 

When I comment out the Sub that has the errors, the rest of the Project seems to work.

 

Since the statement above is using values determined by preceding code, it would be nice to have a statement that replaces the original one using the same arguments. 

 

Any suggestions?

0 Likes
Message 8 of 9

gavbath
Collaborator
Collaborator
The best way to download the files now would be using the "AcquireFiles" method, but as you say, there are a different number of arguments, and the types are different. I don't think there's any way around this, because the mechanism is now different.

Gavin Bath
MFG / CAM Technical Specialist
Design and Motion Blog
Facebook | Twitter | LinkedIn | YouTube


   

0 Likes
Message 9 of 9

rajesh
Contributor
Contributor

{[InvalidServer, 1.0.0.0 is not compatible with the following applications on 192.168.1.17:

Vault Basic Server 24.0.49.0
Vault Workgroup Server 24.0.49.0
Vault Collaboration Server 24.0.49.0
Vault Professional Server 24.0.49.0]}

 

What could be the reason for the above error.

Can anyone help me with the answer?

0 Likes