public static string getCnMainXmlContent(string strApNo) { String xmlContent = ""; try { //strApNo = "201210002022"; String xmlpath = cnDataService.getAbsXmlFile(strApNo); xmlContent = System.IO.File.ReadAllText(xmlpath, System.Text.Encoding.GetEncoding("gb2312")); } catch (Exception err) { logger.Error(err.ToString()); WSYQ.CprsGIISWebSvcSoapClient wsyq = new WSYQ.CprsGIISWebSvcSoapClient(); xmlContent = wsyq.GetPatentData(UrlParameterCode_DE.encrypt(strApNo), WSYQ.PatentDataType.CnMabXmlTxt); } return xmlContent; }
public static string getEnMainXmlContent(string strPubNo) { String xmlContent = ""; try { //strApNo = "US2012000001A1"; String xmlpath = DocdbDataService.getXmlFile(strPubNo); if (File.Exists(xmlpath)) { xmlContent = File.ReadAllText(xmlpath, Encoding.GetEncoding("gb2312")); if (xmlContent.Contains("cpic-format-docment")) //US2012000600A1 { xmlContent = xmlContent.Replace("cpic-format-docment", "exchange-document"); xmlContent = xmlContent.Replace("data-format=\"dcdb", "data-format=\"docdb"); xmlContent = xmlContent.Replace("data-format=\"ecdb", "data-format=\"epodoc"); xmlContent = xmlContent.Replace("-dcdb=\"", "-docdb=\""); } } else { logger.Debug("----------" + xmlpath + "NO FIle"); WSYQ.CprsGIISWebSvcSoapClient wsyq = new WSYQ.CprsGIISWebSvcSoapClient(); xmlContent = wsyq.GetPatentData(UrlParameterCode_DE.encrypt(strPubNo), WSYQ.PatentDataType.EnMabXmlTxt); } } catch (Exception err) { logger.Error(err.ToString()); } return xmlContent; }
/// <summary> /// 根据专利号,查询详细信息 /// </summary> /// <param name="PatentID">专利号。中国专利为申请号、世界专利为公开号</param> /// <param name="SearchDbType">中国的CN,世界EN</param> /// <param name="LeiXing"> /// 0:权利要求xml文件内容 /// 1: 说明书,xml文件内容 /// 2:PDF全文,,多个用|切分 /// 3:法律状态 /// 4: 外观图形路径,多个用|切分 /// 5: 著录项目信息 /// </param> /// <returns>文件路径</returns> public string getInfoByPatentID(string PatentID, string SearchDbType, string LeiXing) { string FilePath = ""; WSYQ.CprsGIISWebSvcSoapClient wsyq = new WSYQ.CprsGIISWebSvcSoapClient(); BNS.ServiceSoapClient bns = new BNS.ServiceSoapClient(); List<string> pdf = new List<string>(); string strJMPatentID = UrlParameterCode_DE.DecryptionAll(PatentID); switch (LeiXing) { case "0": FilePath = wsyq.GetPatentData(PatentID, WSYQ.PatentDataType.CnClmXmlTxt); break; case "1": FilePath = wsyq.GetPatentData(PatentID, WSYQ.PatentDataType.CnDesXmlTxt); break; case "2": if (SearchDbType == "CN") { pdf = bns.BnsByAppNo(strJMPatentID); } if (SearchDbType == "EN") { pdf = bns.BnsByPubNo(strJMPatentID); } foreach (string s in pdf) { FilePath = FilePath + s + "|"; } FilePath = FilePath.TrimEnd('|'); break; case "4": //FilePath = wsyq.GetPatentData(UrlParameterCode_DE.encrypt(cnDataService.ApNo8To12(strJMPatentID)), WSYQ.PatentDataType.CnWGImgUrls); FilePath = bns.getCnWgImgUrlsByAN(strJMPatentID); break; case "5": FilePath = getCnMainXmlContent(strJMPatentID); //wsyq.GetPatentData(PatentID, WSYQ.PatentDataType.CnMabXmlTxt); break; } return FilePath; }