- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
[WebMethod]
public void runCompareService(string mAuthToken, int documentId, int origVerNum, int revisedVerNum)
{
//string result = null;
DirectoryInfo tmpDirInfo = getTempDirectoryPath(documentId);
try
{
//authToken = authClient.AuthenticateUser(username, password);
authToken = mAuthToken;
otAuth.AuthenticationToken = authToken;
try
{
string origFilePath = String.Format(tmpFilePath, tmpDirInfo.ToString(), origVerNum);
string revisedFilePath = String.Format(tmpFilePath, tmpDirInfo.ToString(), revisedVerNum);
string resultFilePath = String.Format(tmpResFilePath, tmpDirInfo.ToString(), origVerNum, revisedVerNum);
string origContextId = getDocContextId(documentId, origVerNum);
string revisedContextId = getDocContextId(documentId, revisedVerNum);
try
{
downlodFileByContextId(origContextId, origFilePath);
downlodFileByContextId(revisedContextId, revisedFilePath);
try
{
doCompare(origFilePath, revisedFilePath, resultFilePath);
try
{
DownloadToBrowser(resultFilePath);
//uploadResultToCS(targetId, resultFilePath);
}
catch (Exception e)
{
throw new Exception(String.Format("Failed to Download To Browser. Error: {0}", e.ToString()));
}
}
catch (Exception e)
{
throw new Exception(String.Format("Failed to do compare method . Error: {0}", e.ToString()));
}
}
catch (Exception e)
{
throw new Exception(String.Format("Failed to create and download file. Error: {0}", e.ToString()));
}
}
catch (Exception e)
{
throw new Exception("Failed to get Context ID for version Exeption details: " + e.ToString());
}
}
catch (Exception e)
{
throw new Exception("Failed to auth user. Exeption details: " + e.ToString());
}
finally
{
docManClient.Close();
contentServiceClient.Close();
if (Directory.Exists(tmpDirInfo.ToString()))
{
tmpDirInfo.Delete(true);
}
}
}