asp.net 调用带证书的webservice解决办法
2016-07-06 23:02
639 查看
最近在朋友弄一个调整省政府政务工作流的程序。。
需要把当前的信息推送到政务网上,采用的是带证书的https webservice。。
下面说一下实现过程
第一步,引用webservice地址,删除web.config中相关配置。同时安装好证书
用如下数据替换:
但在实际调用时,提示找不到对应的证书用户
我猜测可能是iis用户访问证书有关,那么就在用户和计算机上都导入证书。运行MMC,打开两个证书管理器,都把证书导入一次。
如图
完成之后,果然错误不一样。。
继续运行,出现没有权限的错误
继续设计证书权限
OK完成。。。。。
需要把当前的信息推送到政务网上,采用的是带证书的https webservice。。
下面说一下实现过程
第一步,引用webservice地址,删除web.config中相关配置。同时安装好证书
用如下数据替换:
<system.serviceModel> <bindings> <customBinding> <binding name="IServiceSoapBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"> <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap11" writeEncoding="utf-8"> <!-- 政务大厅接口需要使用Soap11 --> <readerQuotas maxDepth="32" maxStringContentLength="819200000" maxArrayLength="1638400000" maxBytesPerRead="4096000" maxNameTableCharCount="16384000" /> </textMessageEncoding> <httpsTransport manualAddressing="false" maxBufferPoolSize="52428800" maxReceivedMessageSize="6553600" allowCookies="false" authenticationScheme="Anonymous" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" keepAliveEnabled="true" maxBufferSize="6553600" proxyAuthenticationScheme="Anonymous" realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false" useDefaultWebProxy="true" requireClientCertificate="true" /> </binding> </customBinding> </bindings> <client> <endpoint address="https://WebService网址/CXFWebService/webservice/iservice" behaviorConfiguration="endpointBehavior1" binding="customBinding" bindingConfiguration="IServiceSoapBinding" contract="ZwdtServices.IService" name="ServiceImplPort" /> </client> <behaviors> <endpointBehaviors> <behavior name="endpointBehavior1"> <dataContractSerializer maxItemsInObjectGraph="209715200"/> <clientCredentials> <clientCertificate findValue="证书用户" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="My"/> <serviceCertificate> <authentication certificateValidationMode="None"/> <!--<defaultCertificate findValue="ShanXi Digital Certificate Authority" x509FindType="FindBySubjectName" storeLocation="CurrentUser" storeName="My"/>--> </serviceCertificate> </clientCredentials> </behavior> </endpointBehaviors> </behaviors> </system.serviceModel>
但在实际调用时,提示找不到对应的证书用户
我猜测可能是iis用户访问证书有关,那么就在用户和计算机上都导入证书。运行MMC,打开两个证书管理器,都把证书导入一次。
如图
完成之后,果然错误不一样。。
继续运行,出现没有权限的错误
继续设计证书权限
OK完成。。。。。
相关文章推荐
- jdk中密钥和证书管理工具keytool常用命令详解
- windows下部署免费ssl证书(letsencrypt)的方法
- Spring Boot工程支持HTTP和HTTPS,HTTP重定向HTTPS
- openssl生成ssl证书
- win7系统无法安装农行网银证书解决方法
- Mozilla、思科和EFF将为网站免费提供SSL证书
- DDC连接vCenter
- 脚本实现CA的制作以及证书的颁发
- 脚本实现CA的制作以及证书的颁发
- 先安装证书服务(CA),再安装IIS,导致默认certsrv站点不能访问
- 服务器证书是什么?
- 服务器证书
- SecureCRT密钥远程ssh证书登录Linux
- exchange2007证书
- 什么是 SSL 证书?如何检查网址是否部署了 SSL 证书?
- VeriSign SSL证书已经涨价,欢迎买一送一替换为WoSign品牌SSL证书
- SSL 证书助力奥巴马问鼎白宫
- Win2003证书服务配置/客户端(服务端)证书申请/IIS站点SSL设置
- OpenSSL:实现创建私有CA、签署证书请求详解
- 2、安装Lync Server 2013