asp.net-core – .NetStandard或.NET核心中的WSHttpBinding
发布时间:2020-12-16 06:50:56 所属栏目:asp.Net 来源:网络整理
导读:我想在我的应用程序中集成NMVS协议,该应用程序提供用于测试的wsdl文件,该文件是在.net框架库中编写的示例代码. 我想在.netstandard,.netcore或UWP应用程序中测试它,但wsdl文件仅支持.netstandard,.net core和UWP不支持的“WSHttpBinding”. wsdl:binding nam
我想在我的应用程序中集成NMVS协议,该应用程序提供用于测试的wsdl文件,该文件是在.net框架库中编写的示例代码.
我想在.netstandard,.netcore或UWP应用程序中测试它,但wsdl文件仅支持.netstandard,.net core和UWP不支持的“WSHttpBinding”. <wsdl:binding name="WSHttpBinding_ISinglePackServices" type="ns:ISinglePackServices"> WSHttpBinding binding = new WSHttpBinding(); binding.Security.Mode = SecurityMode.Transport; binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate; 我使用了basichttpbinding,但是我收到的错误是“内容类型application / soap xml;响应消息的charset = UTF-8与绑定的内容类型(text / xml; charset = utf-8)不匹配.” 解决此问题的其他方法有哪些? 谢谢 解决方法
这是您的问题的解决方案:
var transportSecurityBinding = new BasicHttpBinding(); transportSecurityBinding.Security.Mode = BasicHttpSecurityMode.Transport; transportSecurityBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate; var customTransportSecurityBinding = new CustomBinding(transportSecurityBinding); var textBindingElement = new TextMessageEncodingBindingElement { MessageVersion = MessageVersion.CreateVersion(EnvelopeVersion.Soap12,AddressingVersion.None) }; // Replace text element to have Soap12 message version customTransportSecurityBinding.Elements[0] = textBindingElement; Nicolas Giannone SPRL(https://www.facebook.com/Nicolas.Giannone.SPRL) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net:控件/页面的页面生命周期顺序与其中的用户contorl
- asp.net-mvc-3 – 如何从@ Html.EditForModel()中排除一个字
- 坚石诚信ETz201应用于ASP.NET项目中
- ASP.NET:如何将HtmlAnchor转换为静态文本?
- asp.net-mvc-3 – MVC3 Html.BeginForm – 在RouteValueDic
- 什么是ASP.NET vNext?
- asp.net-mvc – 城堡温莎IoC在一个MVC应用程序
- ASP.Net下载大文件的实现方法
- ASP.NET MVC 3应用程序中每个浏览器选项卡/窗口的新会话
- asp.net – 为jQuery寻找一个好的数据网格插件
推荐文章
站长推荐
- asp.net-mvc – 使用SharpDevelop构建ASP.NET MV
- 如何排序. .NET中的resx(资源文件)
- asp.net-mvc – MVC 4 ModelBinder
- asp.net – Dotnetopenauth oAuth服务提供商的解
- asp.net-mvc-3 – 使用AutoMapper携带元数据查看
- asp.net-mvc-3 – “..必须从WebViewPage或WebVi
- asp.net – 如何在Page_Load上获取参数
- asp.net – NHibernate log4net性能问题 – 如何
- ASP.NET AJAX pageLoad()和JavaScript window.on
- asp.net – JS,图像和CSS被HTTPModule拦截
热点阅读