Login to Enovia LCA Server using CAA

COE Administrator

Login to Enovia LCA Server using CAA
Hi,

I am new to CAA programming and had hard time for even compiling the code/usecases in VC++. I am trying to write a small program to connect to Enovia Server using CAA V5R16 to do some queries (searching for parts with name). I tried different frameworks (VPMXBom, VPMSession and others) but couldn't quite understand which framework I am supposed to use to connect to Enovia Server giving the role, username and password.

If someone can shed some light here showing the correct path or a sample piece of code is greatly appreciated. Thanks to all of you in advance.

Best Regards,
vv_ramana

COE Administrator

Login to Enovia LCA Server using CAA
(in response to COE Administrator)
(If you still haven't found an answer...)

You don't mention whether you're trying to login from your client or from the LCA server itself. We never had any success in logging in from the client side...so if you come up with something, be sure to say so... The documentation isn't explicit either way... However, VPMSession->CreateLoginSession has a networkmode option...maybe something there that we missed.

Anywho.

When connecting to LCA Server from LCA Server, we use/have used:

VPMPersistency VPMSession
followed up with...VPMInterfaces CATIVpmSCLogin
followed up with...VPMInterfaces CATIVpmLoginSession

(see VPMInterfaces Interface CATIVpmSCLogin API reference for login example...you should be able to use it directly)

seems to behave much the same way as...

VPMPersistency VPMSession
followed up with...VPMInterfaces CATIVpmLoginSession by way of VPMSession -> CreateLoginSession

Hope that helps...

COE Administrator

Login to Enovia LCA Server using CAA
(in response to COE Administrator)
Hi JMiller,

Thanks for the response. Yes, I haven't found a way yet!!
I am trying to connect to the LCA server from the machine where the LCA Client is installed.
And, I VPN to the network before I run this sample as our server is on a network!!

Please find the code snippet below which I am using.
My code returns with the error "Failed to create a SC Login Session!!".

// Create a VPM Session
VPMSession *pVpmSession = VPMSession:penSession();
if ( !pVpmSession )
{
printf ( "Failed to create a VPM Session!!\n" );
return 0;
}

CATUnicodeString catStrRoleId = ( (const char*) "VPMADMIN.ADMIN.DEFAULT" );
CATUnicodeString catStrUserName ( (const char*)"Username" );
CATUnicodeString catStrPassWord ( (const char*)"Password" );

// Create a Login Session
CATIVpmLoginSession_var vLoginSession = NULL_var;
hResult = pVpmSession->CreateLoginSession ( catStrUserName, catStrPassword, catStrRoleId, 0, vLoginSession );
if ( hResult != S_OK )
{
printf ( "Failed to create a Login Session!!\n" );

// Close the Session
VPMSession::CloseSession();
return 1;
}

// Get the Factory Manager
CATIVpmFactoryManager_var pFactory;
hResult = pVpmSession->GetVPMObjectFactory ( pFactory );

// Create the SC Login
CATIVpmSCLogin_var pLogin ( pFactory );
if ( !pLogin )
{
// Close the Session
VPMSession::CloseSession();
return 1;
}

// Login
hResult = pLogin->Login ( catStrUserName, catStrPassword, VPMLoginDEFAULT, catStrRoleId );
if ( hResult != S_OK )
{
printf ( "Failed to create a SC Login Session!!" );

// Close the Session
VPMSession::CloseSession();
return 1;
}


I tried passing empty(" ") username/password which didn't help me either!!
Please let me know if I am missing something and thanks in advance.

COE Administrator

Login to Enovia LCA Server using CAA
(in response to COE Administrator)
some thoughts...

on line:

hResult = pVpmSession->CreateLoginSession ( catStrUserName, catStrPassword, catStrRoleId, 0, vLoginSession );

maybe rather try:

hResult = pVpmSession->CreateLoginSession ( catStrUserName, catStrPassword, catStrRoleId, 1, vLoginSession );

Also, since this step succeeds, can you then get a factory and start working without running SCLogin?

Little Cthulhu

RE: Login to Enovia LCA Server using CAA
(in response to COE Administrator)

Dozen years ahead, problem still persists.

Has anyone found out how to connect to ENOVIA V5 from CAA batch running on a client, not server?

All mentioned above as well as StartEV5Server calls work only when batch is being ran on a server.

Cliff Johnson, Cliff

RE: Login to Enovia LCA Server using CAA
(in response to Little Cthulhu)

Hey why not ask on 3DSwym?? HA HA HA HA HA HA! Just kidding. 

Seriously,  The closest I have seen working is that it is possible to reverse engineer the REST API that is used by the web interface using the Chrome debugging tools. But our understanding is this is not a stable approach and we should do as we are told. 

 

How to ask questions