Login problem Vault 2017 in custom web service

Login problem Vault 2017 in custom web service

psaarloos
Collaborator Collaborator
6,666 Views
21 Replies
Message 1 of 22

Login problem Vault 2017 in custom web service

psaarloos
Collaborator
Collaborator
Hi,

I ran into an issue with logging into Vault from a custom webservice.

Vault Professional server and client are installed. The new 2017 WebService dll's, Interop and clmloader (64-bit) are deployed in the Virtual Directory of the custom web service. The ApplicationPool used by the custom web service is also running in 64-bit

The WebServiceManager is failing to be created.

The weird thing is that when I install a Vault Basic client the problem doesn't occur!

I also tried to add the configsection to the web.config file (as explained in the Vault API help, Clic licensing app.config sample).

Anybody an idea how to solve the issue?
Regards,
Pim Saarloos
Product Manager
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
0 Likes
Accepted solutions (1)
6,667 Views
21 Replies
Replies (21)
Message 2 of 22

wayne.brill
Collaborator
Collaborator

Hi,

 

Here is a suggestion to try:

 

>> >>

By default the SDK tries to locate the native DLLs in the same folder as the Autodesk.Connectivity.Webservices.dll assembly, but this breaks down when run under IIS, since IIS will copy a web-applications assemblies (but not native DLLs) to a “Temporary ASP.NET Files” folder where they are actually invoked from.  To solve this (assuming this is the problem they are seeing), they can set an “appPath” attribute to the location of the native DLLs in the licensing section of their web.config.  

For example:
<Licensing edition="Professional" appPath=”c:\full\path\to\folder\with\native\DLLs” />

<< <<

 

Please let me know if this solves it.

 

Thanks,

Wayne



Wayne Brill
Developer Technical Services
Autodesk Developer Network

Message 3 of 22

psaarloos
Collaborator
Collaborator

Thanks for your feedback Wayne. Thats sounds logical.

 

Although your solution works as well, I tested another solution. I added the lines below to the web.config of the web service. (Got that from the Thin Client web.config). This works as well. What is the difference between your solution and mine? Is it that Licensing edition="None" is using the 'old' behavior by getting a license through the ADMS server?

 

<configSections>
    <section name="Licensing" type="Autodesk.Connectivity.WebServices.LicensingSection, Autodesk.Connectivity.WebServices"/>
  </configSections>
  <Licensing edition="None"/>

 

 

Regards,
Pim Saarloos
Product Manager
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
0 Likes
Message 4 of 22

wayne.brill
Collaborator
Collaborator
Accepted solution

Hi,

 

Thanks for letting me know the suggestion worked.

 

Here is the feedback about   <Licensing edition="None"/>

 

"That will only work if the client will only be doing a read-only signin (which does not require a license)."

 

Thanks,

Wayne



Wayne Brill
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 22

psaarloos
Collaborator
Collaborator
Thanks for this valuable information Wayne!

Regards,
Pim
Regards,
Pim Saarloos
Product Manager
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
0 Likes
Message 6 of 22

gavbath
Collaborator
Collaborator

Just thought I'd mention that I've been having this issue too, but mine was caused by the fact that I had:

 

<Licensing edition="none" />  (The "N" needs to be capitalized)

 

And I forgot to set the AuthenticationFlags to ReadOnly.

 

Works now, yay.

Thanks for the info Wayne.

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


   

0 Likes
Message 7 of 22

ola_andersson
Explorer
Explorer

Hi Wayne.

I'm facing the same problem, and can't get the webservice to work.

Can you provide a web.config file that has the "appPath" attribute specified?

 

bReg Ola

0 Likes
Message 8 of 22

rjay75
Advisor
Advisor

Hello Wayne,

 

I had this very issue and this post helped. Now however I need to be able to submit a job from a webservice so I need to consume a license. What should this value be set too?

 

Is there a list of valid values?

 

Thanks

0 Likes
Message 9 of 22

gavbath
Collaborator
Collaborator

If it's Vault Professional, then you would use:

 

<Licensing edition="Professional"/>

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


   

0 Likes
Message 10 of 22

rjay75
Advisor
Advisor

Thanks. That's what I thought.

 

However setting it to Professional results in this exception 'System.Runtime.InteropServices.SEHException'  being thrown when trying to actually login. Am I missing something else needed for getting a license.

 

Logging in readonly and with it set to None has no problems. 

0 Likes
Message 11 of 22

gavbath
Collaborator
Collaborator

Would you mind including your code for the login call? I think the authenticationflags will need to be set to "Normal"

Also, are you deploying these files to the build folder?

 

  • "Autodesk.Connectivity.WebServices.Interop.dll"
  • "Autodesk.Connectivity.WebServices.WCF.dll"
  • "clmloader.dll"

I don't know exactly what your error means, but those are the main things to check, as well as making sure that the build platform target (bitness) matches the versions of the dlls that you're referencing.

 

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


   

0 Likes
Message 12 of 22

rjay75
Advisor
Advisor

Here's the code to login.

 

Snippet

protected VaultWebServiceConnection(string VaultServer, string DefaultVault, string VaultUserName, string VaultPassword)
{
    if (string.IsNullOrEmpty(VaultServer)) VaultServer = Settings.VaultServer;
    if (string.IsNullOrEmpty(DefaultVault)) DefaultVault = Settings.DefaultVault;
    if (string.IsNullOrEmpty(VaultUserName)) VaultUserName = Settings.VaultUserName;
    if (string.IsNullOrEmpty(VaultPassword)) VaultPassword = Settings.VaultPassword;
    ServerIdentities si = new ServerIdentities() { DataServer = Settings.VaultServer, FileServer = Settings.VaultServer };
    UserPasswordCredentials usrpc = new UserPasswordCredentials(si, DefaultVault, VaultUserName, VaultPassword);
    try
    {
        _WebServiceManagerInstance = new WebServiceManager(usrpc);
    }
    catch (Exception ex)
    {
        throw ex;
    }
}

 

And in my web.config

 

Snippet

  <configSections>
    <section name="Licensing" type="Autodesk.Connectivity.WebServices.LicensingSection, Autodesk.Connectivity.WebServices" />
  </configSections>
  <Licensing edition="Professional" />

 

Setting the licensing edition to Non get results in this exception. 'Autodesk.Connectivity.WebServices.VaultLicenseMismatchException'.

 

 

Setting the licensing edition to None and adding the readonly flag to the credentials allows it to login but it a permission denied error when trying to submit a Job to the the JobService.

 

0 Likes
Message 13 of 22

gavbath
Collaborator
Collaborator

Hmmm... I don't create the WebServiceManager directly, I use the VDF:

 

LogInResult results = vdf.Vault.Library.ConnectionManager.LogIn("servername", "Vaultname", "username", "password",
                    AuthenticationFlags.Standard, null);

 

And then the results object contains a connection object, which manages the WebServiceManager.

 

So you'd get to your WSM like so:

 

var wsm = results.Connection.WebServiceManager

 

Would that work for you?

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


   

0 Likes
Message 14 of 22

psaarloos
Collaborator
Collaborator

Hi,

 

I am having an issue as well with getting a licensed connection. I am using the VDF ConnectionManager.LogIn method. It works when the app.config contains 'Licensing="None"', but I need a writeable (ServerOnly) connection!

 

The error I am getting is 'Error: Exception of type ‘Autodesk.Connectivity.WebServices.VaultLicenseException’ was thrown.'

 

I am using this code:

result = Library.ConnectionManager.LogIn(this.textBoxServer.Text.Trim(), string.Empty, this.textBoxUsername.Text.Trim(), this.textBoxPassword.Text.Trim(), AuthenticationFlags.ServerOnly, null);
                   

 

I am 100% sure all the references are in place. How can I solve the issue? On some machines it's working normally, even without the licensing attributes in the app.config, but on other machines the error as mentioned pops up. Vault Client itself works normally, as well as the job processor application on this machine.

Regards,
Pim Saarloos
Product Manager
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
0 Likes
Message 15 of 22

rjay75
Advisor
Advisor

Ok, tried it using the ConnectionManager. Same result, unable to login due to an exception. Using the ConnectionManager just doesn't throw the exception. The login still fails.

 

I'll keep trying different things.

0 Likes
Message 16 of 22

Anonymous
Not applicable

Hello Pim,

 

I am running into the same issue and I am wondering if you ever got a solution.

 

I am also using VDF to authenticate. If the AuthenticationFlag is Read-only it will log in but if it is set to Standard, it fails to log in. I also have the app.config set to use "Professional" instead of "None". But doesn't seem to do correct anything. Any insight would be greatly appreciated.

 

Thanks,

 

Dan

0 Likes
Message 17 of 22

gavbath
Collaborator
Collaborator

Hi Dan,

 

Have you checked all the other prerequisites, such as installing a Vault client and connecting to a Vault to build the license information, now that licensing is client-side?

 

 

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


   

0 Likes
Message 18 of 22

Anonymous
Not applicable

Gavin,

 

Thanks for the response. Yeah I have all the prerequisites and I have the Vault Pro client installed. I can log in from the Vault Pro client but when I try to start the windows service, it hangs when it tries to log in. It doesn't return a Login Result. I have to kill the service through the command prompt.

 

Thanks,

 

Dan

0 Likes
Message 19 of 22

psaarloos
Collaborator
Collaborator

Hi Dan,

 

Which user account is being used when you run the service? If it's the Network Service or something like that, you might want to try to change the log on of the service to another user account. Make sure you launch Vault Client using that user account as well at least one time. You can do this by right-clicking the Vault Professional application and choose 'Run as different user'. 

Regards,
Pim Saarloos
Product Manager
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
Message 20 of 22

Anonymous
Not applicable

Pim,

 

Thanks for your response. The user account running the service is Local System. I will try a different user account and will let you know. But below is a screencast of what I am experiencing.

 

http://autode.sk/2Iu1gai

 

Thanks,

 

Dan

0 Likes