1 reply
If you use the RightFax COM API to dynamically create and/or send out faxes this is a pretty important issue.
I am working on a project that mixes an InfoPath form in with dynamic creation of a PDF based of the form and then use the RightFax COM API to send out a fax (all done using VB.NET managed code) so this may seem a bit confusing.
An issue arises when using the Form in a distributed environment (such as SharePoint or a networked share). The RightFax server will only authenticate the user on the development machine, and if another user tries to access the form and use it on their machine, they will get a COM Exception with the error "The user or object does not exist". This is because the Server does not by default give a user name for authentication. The way around this is to hard code the username and password (If RightFax is not linked to NT user accounts) or specify the user and tell the server to use NT Authentication credentials.
CODE (VB.NET)
Imports RFCOMAPILIB
....
public someEventorFunction()
Dim FaxSrv as New FaxServer
Dim FaxOBJ as Fax 'Object Referencing a fax to be created or referenced by the server
FaxSrv.ServerName="ServerName" 'optional, if not specified the API will look for a default server name
FaxSrv.AuthenticationUserID=System.Environment.UserName
FaxSrv.UseNTAuthentication=Booltype.True
FaxSrv.OpenServer() 'Optional, tells the Fax Server to open communications to either send or recieve faxes
'If not specified the server will automatically open when it needs to either send or receive faxes
'Create fax object
FaxOBJ=FaxSrv.CreateObject(RFCOMAPILIB.coFax,booltype)
' do something to the fax: create a fax or return a fax sent prior on the server
End someEventofFunction
This workaround will tell the RightFax server object to use the login name of the person currently using the computer, and then the UseNTAuthentication property tells the RightFax Server to plug in the password and log into the Fax Server. Before using this workaround, make sure that your RightFax Server uses NT Authentication, if not you need to hard code the username and password to log into the server. Make sure that either the assembly (if doing a standalone app) or the InfoPath form is fully trusted or this will not work.
Happy Coding!
Matt
This discussion is closed to new replies.
Trending After Hours posts
Sort by Trending