日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > asp.net >内容正文

asp.net

asp.net 调用带证书的webservice解决办法

發(fā)布時間:2025/3/15 asp.net 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 asp.net 调用带证书的webservice解决办法 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

最近在朋友弄一個調(diào)整省政府政務(wù)工作流的程序。。

?

需要把當(dāng)前的信息推送到政務(wù)網(wǎng)上,采用的是帶證書的https webservice。。

?

下面說一下實現(xiàn)過程

?

第一步,引用webservice地址,刪除web.config中相關(guān)配置。同時安裝好證書

?

用如下數(shù)據(jù)替換:

?

[html]?view plain?copy ?
  • <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">??
  • ??????????<!--?政務(wù)大廳接口需要使用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網(wǎng)址/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>??

  • 但在實際調(diào)用時,提示找不到對應(yīng)的證書用戶

    ?

    ?

    我猜測可能是iis用戶訪問證書有關(guān),那么就在用戶和計算機上都導(dǎo)入證書。運行MMC,打開兩個證書管理器,都把證書導(dǎo)入一次。

    如圖

    ?

    ?

    完成之后,果然錯誤不一樣。。

    繼續(xù)運行,出現(xiàn)沒有權(quán)限的錯誤

    ?

    繼續(xù)設(shè)計證書權(quán)限

    ?

    ?

    ?

    OK完成。。。。。

    轉(zhuǎn)載于:https://www.cnblogs.com/4color/p/5691482.html

    總結(jié)

    以上是生活随笔為你收集整理的asp.net 调用带证书的webservice解决办法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。