markus / KCOM_API_AutoStamping / AutoApproval.aspx.cs @ e1c892f7
이력 | 보기 | 이력해설 | 다운로드 (2.24 KB)
1 |
using System; |
---|---|
2 |
using System.Data; |
3 |
using System.Configuration; |
4 |
using System.Web; |
5 |
using System.Web.Security; |
6 |
using System.Web.UI; |
7 |
using System.Web.UI.WebControls; |
8 |
using System.Web.UI.WebControls.WebParts; |
9 |
using System.Web.UI.HtmlControls; |
10 |
|
11 |
//using Microsoft.SharePoint; |
12 |
|
13 |
using System.Net; |
14 |
using System.Xml; |
15 |
|
16 |
public partial class AutoApproval : System.Web.UI.Page |
17 |
{ |
18 |
protected void Page_Load(object sender, EventArgs e) |
19 |
{ |
20 |
} |
21 |
|
22 |
protected void Button1_Click(object sender, EventArgs e) |
23 |
{ |
24 |
string project_no = this.txtproject_no.Text.Trim().ToString(); |
25 |
string slip_no = this.txtslip_no.Text.Trim().ToString(); |
26 |
string user_id = this.txtuser_id.Text.Trim().ToString(); |
27 |
|
28 |
WebClient client = new WebClient(); |
29 |
string reqstr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" |
30 |
+ "<soapenv:Header/>" |
31 |
+ "<soapenv:Body>" |
32 |
+ "<AutoStamping>" |
33 |
+ "<project_no>" + project_no + "</project_no>" |
34 |
+ "<slip_no>" + slip_no + "</slip_no>" |
35 |
+ "<user_id>" + user_id + "</user_id>" |
36 |
+ "</AutoStamping>" |
37 |
+ "</soapenv:Body>" |
38 |
+ "</soapenv:Envelope>"; |
39 |
client.Headers.Add(HttpRequestHeader.ContentType, "text/xml"); |
40 |
client.Headers.Add("SOAPAction", "urn:ServiceDeepView/AutoStamping"); |
41 |
|
42 |
string _result = client.UploadString(new Uri("http://10.11.252.3/ServiceDeepView.svc"), reqstr); |
43 |
XmlTextReader reader = new XmlTextReader(new System.IO.StringReader(_result)); |
44 |
string msg = "Success"; |
45 |
|
46 |
while (reader.Read()) |
47 |
{ |
48 |
switch (reader.NodeType) |
49 |
{ |
50 |
case XmlNodeType.Element: |
51 |
if (reader.Name == "AutoStampingResult") |
52 |
{ |
53 |
reader.Read(); |
54 |
if (!string.IsNullOrEmpty(reader.Value)) |
55 |
msg = "Error:"+reader.Value; |
56 |
} |
57 |
break; |
58 |
} |
59 |
} |
60 |
|
61 |
Response.Write("<script language='Javascript'> "); |
62 |
Response.Write("alert('" + msg + "'); "); |
63 |
Response.Write("</script>"); |
64 |
} |
65 |
} |