Пример #1
0
        public static ProcessInfo GetProcessInfo(IP ip, out string msg)
        {
            string xml = GetXML("IP", new string[] { "IPAddress=" + ip.IPAddress });

            ServiceAPI ws = new ServiceAPI();

#if ISOFFLINE
            string returnXml = @"<?xml version='1.0' encoding='utf-8'?>
                                <response>
                                    <table>
                                        <rows>
                                            <Process_Code>A22</Process_Code>
                                            <Process_Name>上料</Process_Name>
                                        </rows>
                                    </table>
                                </response>";
#else
            string returnXml = string.Empty;
            try
            {
                returnXml = ws.Get_ProcessInfo(xml);
            }
            catch (Exception ex)
            {
                msg = ex.Message;
                return(new ProcessInfo {
                    ProcessCode = "", ProcessName = ""
                });
            }
#endif
            ProcessInfo pi = ConvertXMLtoProcess(returnXml, out msg);

            if (!string.IsNullOrEmpty(msg))
            {
                LogHelper.WriteError(msg + "xml" + xml);
            }
            return(pi);
        }