개정판 5e7c6f56
issue #937: upload UploadFinal project for SNI
Change-Id: I566ef9e593c4b9022e10aa6eae322244b159b30e
Site/SNI/FinalService.ini | ||
---|---|---|
1 |
[PDFMovePath] |
|
2 |
URL=\\192.168.0.67\finalpdf\ |
|
3 |
[ApprovedImgPath] |
|
4 |
URL=\\192.168.0.67\finalpdf\Approved.png |
|
5 |
[CheckmarkImgPath] |
|
6 |
URL=\\192.168.0.67\finalpdf\checkmark.png |
|
7 |
[DebugSavePath] |
|
8 |
URL=D:\\Develop\\Ensemble\\{0}_app\\VPCS_DOCLIB\\{1}\\{2}\\ToVendor\\ |
|
9 |
[DebugResultUrlPath] |
|
10 |
URL=http://cloud.devdoftech.co.kr:5977/FinalPDF/{0}_app/VPCS_DOCLIB/{1}/{2}/ToVendor/{3} |
|
11 |
[FinalServiceName] |
|
12 |
NAME=FinalService |
|
13 |
[UpLoadServiceUrl] |
|
14 |
URL= |
|
15 |
[FinalPDFRootUrl] |
|
16 |
URL=http://192.168.0.67:5977/finalpdf/ |
|
17 |
[ConnectionString] |
|
18 |
STRING=EVCOYxwadMNh7qzjMvRTwOacwyFatXgWjx//sssrSKTsvMkdvpdBa3Sj3mmhwABTiweSqNnWYgsIxUWXaBe8XE8G1CLaux2zPbyBWvqxJruTX0H5MqABZSEXXG82XaGL |
|
19 |
[MARKUS_API] |
|
20 |
URL=http://www.devdoftech.co.kr:5979/ServiceDeepView.svc |
Site/SNI/UploadFinal/Properties/AssemblyInfo.cs | ||
---|---|---|
1 |
using System.Reflection; |
|
2 |
using System.Runtime.CompilerServices; |
|
3 |
using System.Runtime.InteropServices; |
|
4 |
|
|
5 |
// General Information about an assembly is controlled through the following |
|
6 |
// set of attributes. Change these attribute values to modify the information |
|
7 |
// associated with an assembly. |
|
8 |
[assembly: AssemblyTitle("UploadFinal")] |
|
9 |
[assembly: AssemblyDescription("")] |
|
10 |
[assembly: AssemblyConfiguration("")] |
|
11 |
[assembly: AssemblyCompany("")] |
|
12 |
[assembly: AssemblyProduct("UploadFinal")] |
|
13 |
[assembly: AssemblyCopyright("Copyright © 2012")] |
|
14 |
[assembly: AssemblyTrademark("")] |
|
15 |
[assembly: AssemblyCulture("")] |
|
16 |
|
|
17 |
// Setting ComVisible to false makes the types in this assembly not visible |
|
18 |
// to COM components. If you need to access a type in this assembly from |
|
19 |
// COM, set the ComVisible attribute to true on that type. |
|
20 |
[assembly: ComVisible(false)] |
|
21 |
|
|
22 |
// The following GUID is for the ID of the typelib if this project is exposed to COM |
|
23 |
[assembly: Guid("9cf96b56-8129-4f59-a099-c911f56caaf6")] |
|
24 |
|
|
25 |
// Version information for an assembly consists of the following four values: |
|
26 |
// |
|
27 |
// Major Version |
|
28 |
// Minor Version |
|
29 |
// Build Number |
|
30 |
// Revision |
|
31 |
// |
|
32 |
// You can specify all the values or you can default the Build and Revision Numbers |
|
33 |
// by using the '*' as shown below: |
|
34 |
// [assembly: AssemblyVersion("1.0.*")] |
|
35 |
[assembly: AssemblyVersion("1.6.0.1")] |
|
36 |
[assembly: AssemblyFileVersion("1.6.0.1")] |
Site/SNI/UploadFinal/UploadFinal.csproj | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
3 |
<PropertyGroup> |
|
4 |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|
5 |
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|
6 |
<ProductVersion>8.0.30703</ProductVersion> |
|
7 |
<SchemaVersion>2.0</SchemaVersion> |
|
8 |
<ProjectGuid>{9CF3737A-E04D-4A55-924E-C88725DFBEC7}</ProjectGuid> |
|
9 |
<OutputType>Library</OutputType> |
|
10 |
<AppDesignerFolder>Properties</AppDesignerFolder> |
|
11 |
<RootNamespace>UploadFinal</RootNamespace> |
|
12 |
<AssemblyName>UploadFinal</AssemblyName> |
|
13 |
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> |
|
14 |
<FileAlignment>512</FileAlignment> |
|
15 |
<TargetFrameworkProfile> |
|
16 |
</TargetFrameworkProfile> |
|
17 |
</PropertyGroup> |
|
18 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|
19 |
<DebugSymbols>true</DebugSymbols> |
|
20 |
<DebugType>full</DebugType> |
|
21 |
<Optimize>false</Optimize> |
|
22 |
<OutputPath>bin\Debug\</OutputPath> |
|
23 |
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|
24 |
<ErrorReport>prompt</ErrorReport> |
|
25 |
<WarningLevel>4</WarningLevel> |
|
26 |
</PropertyGroup> |
|
27 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|
28 |
<DebugType>pdbonly</DebugType> |
|
29 |
<Optimize>true</Optimize> |
|
30 |
<OutputPath>bin\Release\</OutputPath> |
|
31 |
<DefineConstants>TRACE</DefineConstants> |
|
32 |
<ErrorReport>prompt</ErrorReport> |
|
33 |
<WarningLevel>4</WarningLevel> |
|
34 |
</PropertyGroup> |
|
35 |
<ItemGroup> |
|
36 |
<Reference Include="System" /> |
|
37 |
<Reference Include="System.Core" /> |
|
38 |
<Reference Include="System.Data.Entity" /> |
|
39 |
<Reference Include="System.Runtime.Serialization" /> |
|
40 |
<Reference Include="System.ServiceModel" /> |
|
41 |
<Reference Include="System.Web" /> |
|
42 |
<Reference Include="System.Xml.Linq" /> |
|
43 |
<Reference Include="System.Data.DataSetExtensions" /> |
|
44 |
<Reference Include="Microsoft.CSharp" /> |
|
45 |
<Reference Include="System.Data" /> |
|
46 |
<Reference Include="System.Xml" /> |
|
47 |
</ItemGroup> |
|
48 |
<ItemGroup> |
|
49 |
<Compile Include="UploadPDF.cs" /> |
|
50 |
<None Include="app.config" /> |
|
51 |
<Compile Include="Properties\AssemblyInfo.cs" /> |
|
52 |
</ItemGroup> |
|
53 |
<ItemGroup> |
|
54 |
<WCFMetadata Include="Service References\" /> |
|
55 |
</ItemGroup> |
|
56 |
<ItemGroup> |
|
57 |
<ProjectReference Include="..\..\..\FinalService\KCOM_FinalService\KCOMDataModel\KCOMDataModel.csproj"> |
|
58 |
<Project>{629dc8cd-d458-47ef-8f02-cd12c7001c3e}</Project> |
|
59 |
<Name>KCOMDataModel</Name> |
|
60 |
</ProjectReference> |
|
61 |
</ItemGroup> |
|
62 |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
|
63 |
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
|
64 |
Other similar extension points exist, see Microsoft.Common.targets. |
|
65 |
<Target Name="BeforeBuild"> |
|
66 |
</Target> |
|
67 |
<Target Name="AfterBuild"> |
|
68 |
</Target> |
|
69 |
--> |
|
70 |
</Project> |
Site/SNI/UploadFinal/UploadFinal.sln | ||
---|---|---|
1 |
|
|
2 |
Microsoft Visual Studio Solution File, Format Version 12.00 |
|
3 |
# Visual Studio 15 |
|
4 |
VisualStudioVersion = 15.0.28010.2046 |
|
5 |
MinimumVisualStudioVersion = 10.0.40219.1 |
|
6 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UploadFinal", "UploadFinal.csproj", "{9CF3737A-E04D-4A55-924E-C88725DFBEC7}" |
|
7 |
EndProject |
|
8 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KCOMDataModel", "..\..\..\FinalService\KCOM_FinalService\KCOMDataModel\KCOMDataModel.csproj", "{629DC8CD-D458-47EF-8F02-CD12C7001C3E}" |
|
9 |
EndProject |
|
10 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonLib", "..\..\..\FinalService\KCOM_FinalService\CommonLib\CommonLib.csproj", "{EE9AAABC-1678-43A4-878E-CEDBB577CF01}" |
|
11 |
EndProject |
|
12 |
Global |
|
13 |
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
|
14 |
Debug|Any CPU = Debug|Any CPU |
|
15 |
Release|Any CPU = Release|Any CPU |
|
16 |
EndGlobalSection |
|
17 |
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
|
18 |
{9CF3737A-E04D-4A55-924E-C88725DFBEC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
19 |
{9CF3737A-E04D-4A55-924E-C88725DFBEC7}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
20 |
{9CF3737A-E04D-4A55-924E-C88725DFBEC7}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
21 |
{9CF3737A-E04D-4A55-924E-C88725DFBEC7}.Release|Any CPU.Build.0 = Release|Any CPU |
|
22 |
{629DC8CD-D458-47EF-8F02-CD12C7001C3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
23 |
{629DC8CD-D458-47EF-8F02-CD12C7001C3E}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
24 |
{629DC8CD-D458-47EF-8F02-CD12C7001C3E}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
25 |
{629DC8CD-D458-47EF-8F02-CD12C7001C3E}.Release|Any CPU.Build.0 = Release|Any CPU |
|
26 |
{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
27 |
{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
28 |
{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
29 |
{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Release|Any CPU.Build.0 = Release|Any CPU |
|
30 |
EndGlobalSection |
|
31 |
GlobalSection(SolutionProperties) = preSolution |
|
32 |
HideSolutionNode = FALSE |
|
33 |
EndGlobalSection |
|
34 |
GlobalSection(ExtensibilityGlobals) = postSolution |
|
35 |
SolutionGuid = {9AD93E88-3AD0-46ED-9F0A-6B13F7ECF3F4} |
|
36 |
EndGlobalSection |
|
37 |
EndGlobal |
Site/SNI/UploadFinal/UploadPDF.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.IO; |
|
6 |
using System.Net; |
|
7 |
using System.Xml; |
|
8 |
using System.Xml.Linq; |
|
9 |
using System.Net.Mail; |
|
10 |
using System.Data.SqlClient; |
|
11 |
using KCOMDataModel.DataModel; |
|
12 |
using KCOMDataModel.Common; |
|
13 |
namespace UploadFinal |
|
14 |
{ |
|
15 |
public class UploadFinal |
|
16 |
{ |
|
17 |
|
|
18 |
public static KeyValuePair<bool, string> UploadFinalPDF(string PdfFilePath, string OriginFileName, FINAL_PDF FinalPDF, string UploadServiceUrl) |
|
19 |
{ |
|
20 |
|
|
21 |
try |
|
22 |
{ |
|
23 |
WebClient webClient = new WebClient(); |
|
24 |
string data = string.Empty; |
|
25 |
data = "<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:tem=\"http://tempuri.org/\"><soap:Header/><soap:Body><tem:CreateFinalPDF>" |
|
26 |
+ "<tem:userID>"+ FinalPDF.CREATE_USER_ID +"</tem:userID>" |
|
27 |
+ "<tem:objectID>"+FinalPDF.DOCUMENT_ID+"</tem:objectID>" |
|
28 |
+ "<tem:filePath>"+ PdfFilePath+"</tem:filePath>" |
|
29 |
+ " </tem:CreateFinalPDF></soap:Body></soap:Envelope>"; |
|
30 |
|
|
31 |
webClient.Headers.Add(HttpRequestHeader.ContentType, "text/xml"); |
|
32 |
webClient.Headers.Add("SOAPAction", "http://tempuri.org/CreateFinalPDF"); |
|
33 |
|
|
34 |
var result = webClient.UploadString(new Uri(UploadServiceUrl), data); |
|
35 |
XmlDocument xmlDoc = new XmlDocument(); |
|
36 |
xmlDoc.LoadXml(result); |
|
37 |
XmlNodeList list = xmlDoc.GetElementsByTagName("CreateFinalPDFResult"); |
|
38 |
if (list.Count > 0) |
|
39 |
{ |
|
40 |
if (!string.IsNullOrEmpty(list[0].InnerText)) |
|
41 |
{ |
|
42 |
return new KeyValuePair<bool, string>(true, "Success"); |
|
43 |
} |
|
44 |
else |
|
45 |
{ |
|
46 |
return new KeyValuePair<bool, string>(false, "Fail"); |
|
47 |
} |
|
48 |
} |
|
49 |
else |
|
50 |
{ |
|
51 |
return new KeyValuePair<bool, string>(false, "Not Completed"); |
|
52 |
} |
|
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
} |
|
58 |
catch (Exception ex) |
|
59 |
{ |
|
60 |
return new KeyValuePair<bool, string>(false, ex.Message); |
|
61 |
} |
|
62 |
|
|
63 |
//return new KeyValuePair<bool, string>(_ResultFlag,_ResultMsg); |
|
64 |
} |
|
65 |
|
|
66 |
static void webClient_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e) |
|
67 |
{ |
|
68 |
Console.WriteLine("UploadStringCompleted: {0}", e.Result); |
|
69 |
} |
|
70 |
public static void SendOnMessage(string subject, string content) |
|
71 |
{ |
|
72 |
|
|
73 |
//MailMessage mail = new MailMessage(); |
|
74 |
//mail.From = new MailAddress("h2011357@daelim.co.kr", "시스템관리자", System.Text.Encoding.UTF8); |
|
75 |
//mail.To.Add("h2011357@daelim.co.kr"); |
|
76 |
//mail.Subject = subject; |
|
77 |
//mail.Body = content; |
|
78 |
//mail.BodyEncoding = System.Text.Encoding.UTF8;//한글이 안깨지기 위해서 사용 |
|
79 |
//mail.SubjectEncoding = System.Text.Encoding.UTF8;//한글이 안깨지기 위해서 사용 |
|
80 |
|
|
81 |
//SmtpClient SmtpServer = new SmtpClient("any.daelim.co.kr"); |
|
82 |
//SmtpServer.Send(mail); // 메일 발송 |
|
83 |
//mail.Dispose(); |
|
84 |
} |
|
85 |
public static void WriteLog(string strLog) |
|
86 |
{ |
|
87 |
StreamWriter log; |
|
88 |
FileStream fileStream = null; |
|
89 |
DirectoryInfo logDirInfo = null; |
|
90 |
FileInfo logFileInfo; |
|
91 |
|
|
92 |
string logFilePath = "C:\\Logs\\"; |
|
93 |
logFilePath = logFilePath + "Log-" + System.DateTime.Today.ToString("MM-dd-yyyy") + "." + "txt"; |
|
94 |
logFileInfo = new FileInfo(logFilePath); |
|
95 |
logDirInfo = new DirectoryInfo(logFileInfo.DirectoryName); |
|
96 |
if (!logDirInfo.Exists) logDirInfo.Create(); |
|
97 |
if (!logFileInfo.Exists) |
|
98 |
{ |
|
99 |
fileStream = logFileInfo.Create(); |
|
100 |
} |
|
101 |
else |
|
102 |
{ |
|
103 |
fileStream = new FileStream(logFilePath, FileMode.Append); |
|
104 |
} |
|
105 |
log = new StreamWriter(fileStream); |
|
106 |
log.WriteLine(strLog); |
|
107 |
log.Close(); |
|
108 |
} |
|
109 |
} |
|
110 |
} |
내보내기 Unified diff