当前位置: 首页 > news >正文

贵阳做网站找哪家好建网站的公司叫什么

贵阳做网站找哪家好,建网站的公司叫什么,影楼行业网站,网站返回404注意#xff1a;该文章涉及到的调用方法若找不到 请移步第一部分内容查找 C# 生成wsdl和dll教程请移步 【超细完整版】C# WebService 通过URL生成WSDL文件和DLL文件 【生成篇】 开始 首先实现一个类#xff0c;用于实现对URL的验证等 public class InputFormatVerifica…注意该文章涉及到的调用方法若找不到 请移步第一部分内容查找 C# 生成wsdl和dll教程请移步 【超细完整版】C# WebService 通过URL生成WSDL文件和DLL文件 【生成篇】 开始 首先实现一个类用于实现对URL的验证等 public class InputFormatVerification {/// summary/// 是否合法Url地址统一资源定位/// /summary/// param namestrValueurl地址/param/// returns成功返回true 失败返回false/returnspublic static bool IsUrl(string strValue){string RegexStr string.Empty;RegexStr ^(http|https)\://([a-zA-Z0-9\.\-](\:[a-zA-Z0-9\.%\$\-])*)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]\.)*[a-zA-Z0-9\-]\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{1,10}))(\:[0-9])*(/($|[a-zA-Z0-9\.\,\?\\\\%\$#\~_\-]))*$;return formatChecks(RegexStr, strValue);}/// summary/// 检测串值是否为合法的格式/// /summary/// param namestrRegex正则表达式/param/// param namestrValue要检测的String值/param/// returns成功返回true 失败返回false/returnspublic static bool formatChecks(string strRegex, string strValue){if (string.IsNullOrWhiteSpace(strValue)){return false;}Regex re new Regex(strRegex);return re.IsMatch(strValue);} }实现Invoke 获取WebService中的所有web 方法 #region 获取web方法 /// summary /// 获取WebService接口的所有WebMethod方法 /// 通过WebService方法的特性为【System.Web.Services.Protocols.SoapDocumentMethodAttribute】 /// 根据特性SoapDocumentMethodAttribute来筛选出所有WebMethod方法 /// /summary /// param nameurl/param public static ListMethodInfo GetAllWebMethodsFromLink(string url, out string className) {className GetClassNameFromUrl(url);CompilerResults result UrlToDllFile(url);Assembly assembly result.CompiledAssembly;Type type assembly.GetType(className);return GetWebMethods(type); } /// summary /// 获取WebService接口的所有WebMethod方法 /// 通过WebService方法的特性为【System.Web.Services.Protocols.SoapDocumentMethodAttribute】 /// 根据特性SoapDocumentMethodAttribute来筛选出所有WebMethod方法 /// /summary /// param namewsdlFilePath/param public static ListMethodInfo GetAllWebMethodsFromWsdl(string wsdlFilePath, out string className) {className GetClassNameFromWsdl(wsdlFilePath);CompilerResults result WsdlToDll(wsdlFilePath);Assembly assembly result.CompiledAssembly;Type type assembly.GetType(className);return GetWebMethods(type); }private static ListMethodInfo GetWebMethods(Type type) {ListMethodInfo methodInfoList new ListMethodInfo();if (type null){return methodInfoList;}MethodInfo[] methodInfos type.GetMethods();for (int i 0; i methodInfos.Length; i){MethodInfo methodInfo methodInfos[i];//WebMethod方法的特性为System.Web.Services.Protocols.SoapDocumentMethodAttribute Attribute attribute methodInfo.GetCustomAttribute(typeof(System.Web.Services.Protocols.SoapDocumentMethodAttribute));if (methodInfo.MemberType MemberTypes.Method attribute ! null){methodInfoList.Add(methodInfo);}}return methodInfoList; } #endregion通过wsdl或url进行调用 /// summary /// 调用WebService /// /summary /// param nameaddressWebService地址/param /// param namemethodName方法名称/param /// param nameargs参数列表/param /// param nametimeOut/param /// returns返回调用结果/returns /// exception crefException/exception private static object InvokeWebService(string address, string methodName, object[] args, string timeOut ) {try{string className string.Empty;CompilerResults result null;//支持直接URL或wsdl类型文件的调用if (InputFormatVerification.IsUrl(address)){className GetClassNameFromUrl(address);result UrlToDllFile(address);}else{className GetClassNameFromWsdl(address);result WsdlToDll(address);}Assembly assembly result.CompiledAssembly;Type type assembly.GetType(className);FieldInfo[] arry type.GetFields();//实例类型对象 object obj Activator.CreateInstance(type);System.Reflection.MethodInfo mi type.GetMethod(methodName);//添加超时时间if (!string.IsNullOrEmpty(timeOut)){int timeout 0;int.TryParse(timeOut, out timeout);if (timeout 0) timeout 1200;//设置超时时间((System.Web.Services.Protocols.WebClientProtocol)(obj)).Timeout timeout * 1000;//毫秒s,timeOut超时时间设置为分钟}var res mi.Invoke(obj, args);return res;}catch (Exception ex){throw new Exception(ex.InnerException.Message, new Exception(ex.InnerException.StackTrace));} }老规矩
http://www.zqtcl.cn/news/260426/

相关文章:

  • 高密建网站龙门城乡规划建设局网站
  • 阿里云从哪里建设网站企业设计网站公司排名
  • 长春做网站推广的公司公司要做个网站吗
  • 天水 网站建设招聘个人网站建设的国外文献综述
  • 什么网站做推广最好建行网站用户名是什么
  • 网站建设和维护需要学的东西服务器学生
  • 电子工厂网站建设企业管理咨询报告
  • 敖汉旗网站建设网站建设班级通讯录
  • 把手机做网站服务器做网站商丘
  • 婚恋咨询网站运营做速卖通代码的网站
  • 网站建设流程有哪七步c语言做的网站有什么优缺点
  • 树在线网页制作网站邢台中北世纪城网站兼职
  • 备案网站建设方案模板怎么看网站域名
  • asp iis设置网站路径效果好网站建设哪家好
  • 河南做外贸网站的公司大连在哪个省的什么位置
  • 网站架构怎么做wordpress e-commerce themes
  • 哪些网站微信支付平台经营管理系统
  • 教育教学成果展示网站建设桂林网站开发公司
  • 唐山房产网站建设asp.net 网站压缩
  • 卫浴网站设计大型网站建设的必须条件
  • 肇庆制作企业网站seo网站建设课程
  • 没有公司自己做网站wordpress lms插件
  • 申请一个网站需要怎么做北京网络公司信息
  • 珠海市建设局网站分销系统价格多少
  • 杭州建网站企业seo营销工具
  • php旅游类网站开发wordpress 文章内
  • 企业管理外贸企业网站优化
  • 免费图纸网东莞百度快照优化排名
  • 南宁网站建设培训学校青海网站建设加q5299丶14602做词
  • 鱼台做网站多少钱wordpress pot