It would help if he told you which object had this function. There are quite a lot of objects in the assembly. Each object probably has multiple functions...
There's a regLogin function in com.itac.mes.imsapi.client.dotnet.IIMSApiDotNet and one in com.itac.mes.imsapi.client.dotnet.IMSApiDotNet.
However, both objects are not creatable with a constructor node. So, you'd need instructions on how to use the assembly.
This tree should have all function in the hierarchy:
Also attached as VI.
That was a lot of work, typing all those tree items 😉!
I decompiled that assembly (luckily its not obfuscated). Using the starting point indicated by wiebe@CARYA, I decompiled the IMSApiDotNet class.
It look like this class implements the Singleton pattern. In order to obtain the (single) instance of the class, you need to call the "loadLibrary()" method, which returns the single instance. Like other implementations of Singleton, the single instance is stashed in the single created type class (static) so its only created once. You could then attempt to call the method you're after.
Thank you, wiebe. Actually, I've got some instructions from the DLL creator. Like this:
regLogin() Started: Mon Apr 12 15:22:16 CST 2021 Input values: sessionValidationStruct.class=com.itac.mes.imsapi.domain.container.IMSApiSessionValidationStruct sessionValidationStruct.stationNumber=S06OBC01-00010-01
Finished in: 109 ms ------------------------------------------------------------------
I want to know how to implement this function using LabVIEW. Can you give me some suggestions?
That looks like a log of an execution, not actual code.
I'd start with creating a constant of the type. Even though you'd normally create an object with a constructor, this object doesn't have a constructor. It might be static, or have static methods or properties that facilitate it's creation. A constant doesn't create the object, but wired to a property node or invoke node does show it's functions. Static properties and methods will usually work.
I'd also look into the LoadLibrary function.
I have two issues:
1. My LabVIEW is 2017 and I cannot open your VI;
2. Since we can not using the DLL with a constructor node, how do I use it to obtain these functions in the tree?
loadLibrary() is a static method of your assembly. You simply configure an Invoke Node in LabVIEW to connect to this class (right clicking on the Node and selecting "Select Class->.Net->Browse), or create a .Net refnum control or constant that is configured to be this class and connect it to the invoke node, and then call it. There is no need and no way to "construct" this object, you simply call it directly, since the static loadLibrary() method does this internally when first called.
It will either return an error (which your friend will have to help you with if that happens as we have not seen any documentation or whatsoever about this library), or it returns an object instance that you can then use further.
That's all there is to static methods (and properties) in an assembly.
Your friend should have given you some real source code which would probably have looked similar to this:
IMSApiSessionValidationStruct imsValidation = new IMSApiSessionValidationStruct(stationNumber, stationPassword, user, password, client, registrationType, systemIdentifier); IMSApiDotNet imsAPI = IMSApiDotNet.loadLibrary(); imsAPI.regLogin(imsValidation);
The "new" keyword is synonymous to the LabVIEW .Net Constructor node. For the IMSApiDotNet object you do not have any new keyword but simply call the static loadLibrary() method of the IMSApiDotNet class to get an instance to the internally created class. That it is a singleton is an internal detail that should not concern you at all, how to obtain that object however is something that should be documented in the hopefully existing documentation for this assembly.
If it isn't documented, or even worse that documentation doesn't exist, you should whack your friend around his ears for this. 😀
And you shouldn't forget to call the LabVIEW CloseReference node on these two refnums (and any others you may create or get returned to by API functions) after you are done with them. You called a (static) method that returned you an object. You should then dispose that object when you are done with it, that it was returned by a static method has no further meaning for the object it returned.