General discussion


Adventures in the Blue Nowhere

By TruthCommission ·
Tags: Off Topic
blog root

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

RightFax COM API Authentication Issues

by TruthCommission In reply to Adventures in the Blue No ...

<p>If you use the RightFax COM API to dynamically create and/or send out faxes this is a pretty important issue.</p>
<p>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.</p>
<p>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.</p>
<p>CODE (VB.NET)</p>
<p><em>Imports RFCOMAPILIB<br /><br />....<br />public someEventorFunction()<br />Dim FaxSrv as New FaxServer<br />Dim FaxOBJ as Fax 'Object Referencing a fax to be created or referenced by the server<br /><br />FaxSrv.ServerName="ServerName" 'optional, if not specified the API will look for a default server name<br />FaxSrv.AuthenticationUserID=System.Environment.UserName<br />FaxSrv.UseNTAuthentication=Booltype.True<br /><br />FaxSrv.OpenServer() 'Optional, tells the Fax Server to open communications to either send or recieve faxes<br />'If not specified the server will automatically open when it needs to either send or receive faxes<br /><br />'Create fax object<br />FaxOBJ=FaxSrv.CreateObject(RFCOMAPILIB.coFax,booltype)</em></p>
<p><em>' do something to the fax: create a fax or return a fax sent prior on the server<br /><br />End someEventofFunction</em></p>
<p>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.<br /><br /><br />Happy Coding!<br />Matt</p>

Related Discussions

Related Forums