public static string HospitalDataInvoke(string mothed, string xmlString) { string result = ""; string[] parm = new string[] { mothed, xmlString }; WebInvoke invoke = new WebInvoke(); result = invoke.Invoke(WSURL + "ClientInvoke.asmx", "ClientInvoke", mothed, parm).ToString(); return(result); }
private void button5_Click(object sender, EventArgs e) { //FileHelper.UploadImage(base64String, "", "cui.jpg", "1001", "wwwww1111"); XmlDocument doc = new XmlDocument(); string xmlString = "<UploadRegImage>" + "<AuthCode>1d340262-52e0-413f-b0e7-fc6efadc2ee5</AuthCode>" + "<Base64String></Base64String>" + "<FileName>cui.jpg</FileName>" + "<PageID>MKT001</PageID>" + "<OwnerID>082d3899-e880-4784-a09b-97ad407e08b5</OwnerID>" + "<FileNum>1|1</FileNum>" + "</UploadRegImage>"; doc.LoadXml(xmlString); string path = @"D:\cui.jpg"; //本地路径 byte[] bytes = GetBytesByPath(path); //获取文件byte[] string base64String = Convert.ToBase64String(bytes); doc.SelectSingleNode("UploadRegImage/Base64String").InnerText = base64String; xmlString = doc.InnerXml; RegApplication reg = new RegApplication(); //doc.Save(@"D:\Work\yaodaibao\Release\uploadfile.xml"); //reg.UploadFile(xmlString); //doc.LoadXml(xmlString); //string pstring = "UploadRegImage" + ";" + xmlString; WebInvoke invoke = new WebInvoke(); //object[] p = pstring.Split(';'); string result = reg.UploadImage(xmlString); //FileLogger.WriteLog("test", 1); //string path = @"D:\发票2.jpg";//本地路径 //byte[] bytes = GetBytesByPath(path);//获取文件byte[] //string base64String = Convert.ToBase64String(bytes); //object[] parm = new object[] { "2", base64String }; ////object result = invoke.Invoke("http://oa.tenrypharm.com:8888/seeyon/services/authorityService?wsdl", "authorityService", "authenticate", parm, null, 60); ////string url = @"http://duzy.top:8080/microService/api/invoice/check"; ////object result = Post(url, parm, 15); ////object[] parm = new object[] { "service-admin", "123456" }; ////object result = invoke.Invoke("http://oa.tenrypharm.com:8888/seeyon/services/authorityService?wsdl", "authorityService", "authenticate", parm, null, 60); ////xmlString = invoke.Invoke(@"http://ydb.tenrypharm.com:6060/RegistrationInvoke.asmx", "RegistrationInvoke", "UploadRegImage", p).ToString(); ////doc.LoadXml(result); ////doc.Save(@"D:\Work\yaodaibao\Release\result.xml"); }
public static string DeptDatanvoke(string mothed, string xmlString) { string result = ""; string[] parm = new string[] { mothed, xmlString }; WebInvoke invoke = new WebInvoke(); result = invoke.Invoke(WSURL + "OrganizationInvoke.asmx", "OrganizationInvoke", mothed, parm).ToString(); return(result); }
public static string OASyncInvoke(string mothed, string xmlString) { string result = ""; string[] parm = new string[] { mothed, xmlString }; WebInvoke invoke = new WebInvoke(); result = invoke.Invoke(WSURL + "ReportDataInvoke.asmx", "ReportDataInvoke", mothed, parm).ToString(); return(result); }
/// <summary> /// 获取OA数据库的产品列表 /// </summary> /// <param name="xmlString"></param> /// <returns>XML String</returns> public string GetListEx(string xmlString) { string result = "", oawsUrl = ""; XmlDocument cfgDoc = new XmlDocument(); cfgDoc = new XmlDocument(); cfgDoc.Load(AppDomain.CurrentDomain.BaseDirectory + "\\cfg.xml"); oawsUrl = cfgDoc.SelectSingleNode("Configuration/OAWSUrl").InnerText; WebInvoke invoke = new WebInvoke(); object[] param = new object[] { xmlString }; oawsUrl = oawsUrl + "OWLAppService.asmx"; result = invoke.Invoke(oawsUrl, "OWLAppService", "GetOAProductList", param, null, 8000).ToString(); return(result); }
private void classInvoke_Click(object sender, EventArgs e) { try { if (methodList.SelectedItem == null) { throw new Exception("请先选择方法"); } if (parameterBox.Text.Trim().Length == 0) { throw new Exception("调用参数不能为空"); } string [] methodString = methodList.SelectedItem.ToString().Split('|'); object[] p = parameterBox.Text.Split(';'); string[] classString = methodString[1].Trim().Split('.');//ydb.CommonService.Invoke WebInvoke invoke = new WebInvoke(); outputBox.Text = invoke.Invoke(methodString[2].Trim(), classString[classString.Length - 1].Trim(), methodString[0].Trim(), p).ToString(); } catch (Exception err) { MessageBox.Show(err.Message); } }
public string InvoiceCheck(string xmlString) { string mode = "0", base64String = "", InvoiceCode = "", InvoiceNo = "", InvoiceDate = "", InvoiceMoney = "", InvoieVCode = ""; string formID = "", formType = ""; string result = "<UpdateData> " + "<Result>{0}</Result>" + "<InvoiceResult>{1}</InvoiceResult>" + "<Description>{2}</Description></UpdateData>"; try { XmlDocument doc = new XmlDocument(); doc.LoadXml(xmlString); XmlNode node = doc.SelectSingleNode("UpdateData/Mode"); if (node != null && node.InnerText.Trim().Length > 0) { mode = node.InnerText.Trim(); } node = doc.SelectSingleNode("UpdateData/FormID"); if (node != null && node.InnerText.Trim().Length > 0) { formID = node.InnerText.Trim(); } else { throw new System.Exception("FormID不能为空"); } node = doc.SelectSingleNode("UpdateData/Form"); if (node != null && node.InnerText.Trim().Length > 0) { formType = node.InnerText.Trim(); } else { throw new System.Exception("OA表单不能为空"); } InvoiceCheckResult chkresult = null; if (mode == "0")//扫描查验 { node = doc.SelectSingleNode("UpdateData/InvoiceData"); if (node != null && node.InnerText.Trim().Length > 0) { base64String = node.InnerText.Trim(); } else { throw new System.Exception("发票数据不能为空"); } chkresult = KingDeeApi.Check(OAInvoiceHelper.GetID(), base64String); } if (mode == "1")//手工 { node = doc.SelectSingleNode("UpdateData/InvoiceCode"); if (node != null && node.InnerText.Trim().Length > 0) { InvoiceCode = node.InnerText.Trim(); } else { throw new System.Exception("发票代码不能为空"); } node = doc.SelectSingleNode("UpdateData/InvoiceNo"); if (node != null && node.InnerText.Trim().Length > 0) { InvoiceNo = node.InnerText.Trim(); } else { throw new System.Exception("发票代码不能为空"); } node = doc.SelectSingleNode("UpdateData/InvoiceDate"); if (node != null && node.InnerText.Trim().Length > 0) { InvoiceDate = node.InnerText.Trim(); } else { throw new System.Exception("发票日期为空"); } node = doc.SelectSingleNode("UpdateData/InvoiceMoney"); if (node != null && node.InnerText.Trim().Length > 0) { InvoiceMoney = node.InnerText.Trim(); } else { throw new System.Exception("发票不含税金额为空"); } node = doc.SelectSingleNode("UpdateData/InvoiceVCode"); if (node != null && node.InnerText.Trim().Length > 0) { InvoieVCode = node.InnerText.Trim(); } chkresult = KingDeeApi.ManualCheck(InvoiceCode, InvoiceNo, InvoiceDate, InvoiceMoney, InvoieVCode); } string xmlResult = ""; // 只有通过验证的发票财务更新到OA发票数据库 if (chkresult != null) { if (chkresult.errcode == "0000" && chkresult.CheckDetailList.Count > 0) { xmlResult = InvoiceCheckResult2Xml(chkresult); WebInvoke invoke = new WebInvoke(); object[] param = new object[] { xmlResult, formID, formType }; //OAInvoiceHelper o = new OAInvoiceHelper(); //o.UpdateInvoiceDB(xmlResult, formID, formType); oawsUrl = oawsUrl + "FinaceAppService.asmx"; xmlResult = invoke.Invoke(oawsUrl, "FinaceAppService", "CheckInvoiceData", param, null, 8000).ToString(); result = xmlResult; } } else { result = string.Format(result, "False", "异常", "不是发票或接口异常"); } } catch (System.Exception err) { throw err; } return(result); }