473,382 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Faxdocument.submit creates excess Fax Jobs in Fax queue

Hi,

I am developing a Fax application using FAXCOMEXLIB in visual studio .net 2005 on Windows XP professional and have come across a strange behaviour. A thread in a class receives the Fax request and the Fax details are filled in and submitted. Note - Even if there are multiple fax numbers i send the FAX one receipient at a time.
For the first fax received the Submit function returns single JOBID. The next FAx submitted returns 2 JObIDs and the third one returns 3 and so on. I thought probably it is holding the previous JOBID and giving it back but that is not the case. I compared all the JOBIDs and they are different. I did convert all these values to decimal and compared and still different.

This is what i get...

Sending 1st Fax..
JOBID - 201c9a0e5136e99

Sending 2nd Fax..
201c9a0e51d7658
201c9a0e51d78c9

Sending 3rd Fax..
201c9a0e52ea797
201c9a0e52eaec3
201c9a0e52ea9e1

The code ..
Class FaxServer
{
private FAXCOMEXLib.FaxDocument m_FaxDocument;
private FAXCOMEXLib.FaxServer m_FaxServer;
private FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM FaxSvrEnum;

Public FaxServer()
{
//Constructor..
m_FaxServer = new FAXCOMEXLib.FaxServer();
m_FaxServer.Connect(Environment.MachineName);
m_FaxDocument = new FAXCOMEXLib.FaxDocument();

FaxSvrEnum = (FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetOUT_Q UEUE | FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetFXSSVC _ENDED);
m_FaxServer.ListenToServerEvents(FaxSvrEnum);
m_FaxServer.OnOutgoingJobAdded += new IFaxServerNotify_OnOutgoingJobAddedEventHandler(fa xserver_OnOutgoingJobAdded);
m_FaxServer.OnOutgoingJobChanged += new IFaxServerNotify_OnOutgoingJobChangedEventHandler( faxserver_OnOutgoingJobChanged);
}


public void SendFax(FileDetails objFileDetails)
{
string RecipientName = "";
string FaxNumber = "";
char[] delimiterChars = { ',' };


Common.GetSectionInfo(objFileDetails.GetMsgFilePat h(), "TO", ref RecipientName); //Get Receipient Name
Thread.Sleep(500);
Common.GetLineInfo(objFileDetails.GetMsgFilePath() , 2, ref FaxNumber); //Get Fax Number

if (RecipientName == "")
{
Log.Info("Recipient Name missing for File - " + objFileDetails.GetMsgFileName());
}

if (FaxNumber == "")
{
//Log that fax number is missing and hence could not be sent..
return;
}

string[] arrFaxNumbers = FaxNumber.Split(delimiterChars);

try
{
foreach (string strFaxNumber in arrFaxNumbers)
{

m_FaxDocument.Body = objFileDetails.GetTxtFilePath();
m_FaxDocument.Recipients.Add(strFaxNumber, RecipientName);

m_FaxDocument.DocumentName = objFileDetails.GetMsgFileName();
Log.Info("Sending Fax for File - " + objFileDetails.GetMsgFileName());

//This JobID[0] can be used to store the JobID of the fax job for later reference.
string[] JobIDs = (string [])m_FaxDocument.Submit(null);

//Expecting only 1 JobID as sending Fax to different receipient in a loop..
objFileDetails.SetJobID(JobIDs[0].ToString());
m_dJobIDList.Add(JobIDs[0].ToString(), objFileDetails);

//Lets save the JOBID in the MSG file properties.
//string fileName = objFileDetails.GetMsgFilePath().Substring(FileFull Path.LastIndexOf("\\") + 1);
string fileName = objFileDetails.GetMsgFileName();
string filePath = objFileDetails.GetMsgFilePath().Substring(0, objFileDetails.GetMsgFilePath().LastIndexOf("\\")) ;

DSOFile.OleDocumentProperties dso = new DSOFile.OleDocumentProperties();
DSOFile.SummaryProperties summary;
dso.Open(objFileDetails.GetMsgFilePath(), false, DSOFile.dsoFileOpenOptions.dsoOptionDefault);
summary = dso.SummaryProperties;
summary.Comments = string.Join(",", JobIDs);
dso.Close(true);

}
}
catch (Exception ex)
{
Log.Error("Exception occured while sending Fax for File - " + objFileDetails.GetMsgFilePath() + ".Please Investigate." ,ex);
}
}
}
Any clues guys..
Mar 10 '09 #1
2 2747
Hi,

I am developing a Fax application using FAXCOMEXLIB in visual studio .net 2005 on Windows XP professional and have come across a strange behaviour. A thread in a class receives the Fax request and the Fax details are filled in and submitted. Note - Even if there are multiple fax numbers i send the FAX one receipient at a time.
For the first fax received the Submit function returns single JOBID. The next FAx submitted returns 2 JObIDs and the third one returns 3 and so on. I thought probably it is holding the previous JOBID and giving it back but that is not the case. I compared all the JOBIDs and they are different. I did convert all these values to decimal and compared and still different.

This is what i get...

Sending 1st Fax..
JOBID - 201c9a0e5136e99

Sending 2nd Fax..
201c9a0e51d7658
201c9a0e51d78c9

Sending 3rd Fax..
201c9a0e52ea797
201c9a0e52eaec3
201c9a0e52ea9e1

The code ..
Expand|Select|Wrap|Line Numbers
  1. Class FaxServer
  2. {
  3.     private FAXCOMEXLib.FaxDocument m_FaxDocument;
  4.         private FAXCOMEXLib.FaxServer m_FaxServer;
  5.         private FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM FaxSvrEnum;
  6.  
  7.     Public FaxServer()
  8.       {
  9.         //Constructor..
  10.         m_FaxServer = new FAXCOMEXLib.FaxServer();
  11.             m_FaxServer.Connect(Environment.MachineName);
  12.             m_FaxDocument = new FAXCOMEXLib.FaxDocument();
  13.  
  14.             FaxSvrEnum = (FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetOUT_QUEUE |         FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetFXSSVC_ENDED);
  15.                 m_FaxServer.ListenToServerEvents(FaxSvrEnum);
  16.                 m_FaxServer.OnOutgoingJobAdded += new         IFaxServerNotify_OnOutgoingJobAddedEventHandler(faxserver_OnOutgoingJobAdded);
  17.                 m_FaxServer.OnOutgoingJobChanged += new         IFaxServerNotify_OnOutgoingJobChangedEventHandler(faxserver_OnOutgoingJobChanged);
  18.     }
  19.  
  20.  
  21.     public void SendFax(FileDetails objFileDetails)
  22.         {
  23.             string RecipientName = "";
  24.             string FaxNumber = "";
  25.             char[] delimiterChars = { ',' };
  26.  
  27.  
  28.             Common.GetSectionInfo(objFileDetails.GetMsgFilePath(), "TO", ref RecipientName);     //Get Receipient Name
  29.             Thread.Sleep(500);
  30.             Common.GetLineInfo(objFileDetails.GetMsgFilePath(), 2, ref FaxNumber);               //Get Fax Number
  31.  
  32.             if (RecipientName == "")
  33.             {
  34.                 Log.Info("Recipient Name missing for File - " + objFileDetails.GetMsgFileName());
  35.             }
  36.  
  37.             if (FaxNumber == "")
  38.             {
  39.                 //Log that fax number is missing and hence could not be sent..
  40.                 return;
  41.             }
  42.  
  43.             string[] arrFaxNumbers = FaxNumber.Split(delimiterChars);
  44.  
  45.             try
  46.             {
  47.                 foreach (string strFaxNumber in arrFaxNumbers)
  48.                 {
  49.  
  50.                     m_FaxDocument.Body = objFileDetails.GetTxtFilePath();
  51.                     m_FaxDocument.Recipients.Add(strFaxNumber, RecipientName);
  52.  
  53.                     m_FaxDocument.DocumentName = objFileDetails.GetMsgFileName();
  54.                     Log.Info("Sending Fax for File - " + objFileDetails.GetMsgFileName());
  55.  
  56.                     //This JobID[0] can be used to store the JobID of the fax job for later reference.
  57.                     string[] JobIDs = (string [])m_FaxDocument.Submit(null);
  58.  
  59.                     //Expecting only 1 JobID as sending Fax to different receipient in a loop..
  60.                     objFileDetails.SetJobID(JobIDs[0].ToString());
  61.                     m_dJobIDList.Add(JobIDs[0].ToString(), objFileDetails);
  62.  
  63.                     //Lets save the JOBID in the MSG file properties.
  64.                     //string fileName = objFileDetails.GetMsgFilePath().Substring(FileFullPath.LastIndexOf("\\") + 1);
  65.                     string fileName = objFileDetails.GetMsgFileName();
  66.                     string filePath = objFileDetails.GetMsgFilePath().Substring(0, objFileDetails.GetMsgFilePath().LastIndexOf("\\"));
  67.  
  68.                     DSOFile.OleDocumentProperties dso = new DSOFile.OleDocumentProperties();
  69.                     DSOFile.SummaryProperties summary;
  70.                     dso.Open(objFileDetails.GetMsgFilePath(), false, DSOFile.dsoFileOpenOptions.dsoOptionDefault);
  71.                     summary = dso.SummaryProperties;
  72.                     summary.Comments = string.Join(",", JobIDs);
  73.                     dso.Close(true);
  74.  
  75.                 }
  76.             }
  77.             catch (Exception ex)
  78.             {
  79.                 Log.Error("Exception occured while sending Fax for File - " + objFileDetails.GetMsgFilePath() + ".Please Investigate." ,ex);
  80.             }
  81.     }
  82. }
  83.  
Please respond asap...thanks in advance..
Mar 10 '09 #2
tlhintoq
3,525 Expert 2GB
Since its the Submit method that seems to be problemmatic, it might help if you include that code. I see where you call it in line 57, but that doesn't help.

I do wonder though... The FaxDocument is a member variable? Does this mean it is the same instance of a fax document getting reused over and over? Are its values being cleared between re-uses? Could this be cleaned up to become a new instance of a new document each time?
Mar 11 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: RavenMaster | last post by:
I have a javascript form field validation script that I have used many times with no problems. However, I just started using the script in a PHP application that uses trans-sid for session...
2
by: Phillip Windell | last post by:
This is really an HTML question I think, but it probably won't take much effort to answer (unless I'm answering or course). The HTML is all ASP generated and the ASP generates exactly what I want...
1
by: Terence Parker | last post by:
I have a form which enables users to type in some text in a <TEXTAREA>, allowing them to use HTML. I have defined two submit buttons - one to submit as usual, but one which I would like to popup...
6
by: charlie_M | last post by:
I figured out via various help from this forum... EXAMPLE: onClick="document.forms.MYBUTTON.value='SIMPLE';document.forms.submit()" In my CGI I see "MYBUTTON" = "SIMPLE" and this works...
8
by: shandain | last post by:
Ok, I have done this a million times, and I can't get this to work... I hope I am just being an idiot and missing something... but I can't see it... so please call me an idiot and tell me what it...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
0
by: Brad | last post by:
What is the format of the server name be in the FaxDocument.Submit method? FaxDocument.Submit ("") is the example I keep coming across but there is no indication as what the format of the server...
6
by: mtn244 | last post by:
Print jobs are not deleting from print queue after completion. This problem is on a peer-to-peer network of four computers and one printer. Windows 2000 with Service Pack 2 is the operating system....
1
by: ujwalarali85 | last post by:
Site user can start some task by submitting some information. But he don't stay their to complete that task. I have to add the task in queue and done this at back end and after completion of task I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.