|
1 | | -<%@ Page Language="C#" validateRequest="false" Debug="true" %> |
2 | | -<%@ Import Namespace="System" %> |
3 | | -<%@ Import Namespace="System.Net" %> |
4 | | -<%@ Import Namespace="System.Xml" %> |
5 | | -<%@ Import Namespace="System.Web" %> |
| 1 | +<%@ Page Language="C#" validateRequest="false" %> |
6 | 2 | <script runat="server"> |
7 | | - public class RqlWebServiceConnector |
| 3 | +public class RqlWebServiceConnector |
8 | 4 | { |
9 | 5 | public string SendRql(string Rql) |
10 | 6 | { |
|
17 | 13 | if (string.IsNullOrEmpty(Rql)) |
18 | 14 | return ""; |
19 | 15 |
|
20 | | - string WebServiceUri = GetWebServiceUrl(); |
| 16 | + string WebServiceUri = this.GetWebServiceUrl(); |
21 | 17 |
|
22 | | - string Response = SendRqlToWebService(WebServiceUri, Rql); |
| 18 | + string Response = this.SendRqlToWebService(WebServiceUri, Rql); |
23 | 19 |
|
24 | 20 | return Response; |
25 | 21 | } |
26 | 22 |
|
27 | 23 | private string SendRqlToWebService(string WebServiceUrl, string Rql) |
28 | 24 | { |
29 | | - ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback( |
| 25 | + System.Net.ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback( |
30 | 26 | delegate |
31 | 27 | { |
32 | 28 | return true; |
33 | 29 | } |
34 | 30 | ); |
35 | 31 |
|
36 | 32 | string Response = ""; |
37 | | - WebClient oWC = new WebClient(); |
| 33 | + System.Net.WebClient oWC = new System.Net.WebClient(); |
38 | 34 | oWC.Headers.Add("Content-Type", "text/xml; charset=utf-8"); |
39 | 35 | oWC.Headers.Add("SOAPAction", "http://tempuri.org/RDCMSXMLServer/action/XmlServer.Execute"); |
40 | 36 |
|
|
50 | 46 | return Response; |
51 | 47 | } |
52 | 48 |
|
53 | | - private string GetWebServiceUrl() |
| 49 | + public string GetWebServiceUrl() |
54 | 50 | { |
55 | 51 | if (HttpContext.Current.Session["WebServiceUrl"] == null) |
56 | 52 | { |
|
62 | 58 | Rql += "<s:Body><q1:Execute xmlns:q1=\"http://tempuri.org/RDCMSXMLServer/message/\"><sParamA></sParamA><sErrorA></sErrorA><sResultInfoA></sResultInfoA></q1:Execute></s:Body>"; |
63 | 59 | Rql += "</s:Envelope>"; |
64 | 60 | |
65 | | - string Response = SendRqlToWebService(WebServiceUri.ToString(), Rql); |
| 61 | + string Response = this.SendRqlToWebService(WebServiceUri.ToString(), Rql); |
66 | 62 |
|
67 | 63 | if(Response == "") |
68 | 64 | { |
|
79 | 75 |
|
80 | 76 | return HttpContext.Current.Session["WebServiceUrl"].ToString(); |
81 | 77 | } |
82 | | -
|
83 | | - private string XmlEscape(string unescaped) |
84 | | - { |
85 | | - XmlDocument doc = new XmlDocument(); |
86 | | - XmlNode node = doc.CreateElement("root"); |
87 | | - node.InnerText = unescaped; |
88 | | - return node.InnerXml; |
89 | | - } |
90 | 78 | } |
91 | 79 | </script> |
92 | 80 | <% |
|
0 commit comments