我得到的錯誤是:
System.ArgumentException: "提供的URI方案'http'無效;預期為'https'。 引數名稱:via"
我的xml代碼看起來像這樣:
<system.serviceModel>
<bindings>/span>
<customBinding>/span>
<binding name="serviceSoapBinding"/span>>
< security allowInsecureTransport="true" enableUnsecuredResponse="true" includeTimestamp="false" "false" includeTimestamp="false
authenticationMode='CertificateOverTransport'。
defaultAlgorithmSuite="Basic256"。
requireDerivedKeys="true"。
messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"/span>>
</security>/span>
<textMessageEncoding messageVersion="Soap11"/span>> </textMessageEncoding>>
<httpsTransport maxReceivedMessageSize="2000000000"/span>/>
</binding>/span>
</customBinding>/span>
</bindings>/span>
<client>/span>
<endpoint address="http://...Service"/span>
binding="customBinding" bindingConfiguration="serviceSoapBinding" >。
contract="service.service" name="servicePort" >
</endpoint>
</client>/span>
</system.serviceModel>
將http改為https不是的解決方案,因為我需要http。我認為我必須改變authenticationMode*,但我不知道哪種模式適合我的情況。
在我的情況下,客戶是通過X509Certificate來認證的,服務使用http協議。
uj5u.com熱心網友回復:
關于CertificateOverTransport的要求,DavidG似乎是正確的。 https://docs.microsoft.com/en-us/dotnet/api/system.servicemodel.configuration.authenticationmode?view=netframework-4.8
其他的一個可能作業得更好,但是正如已經提到的,現在不使用https被認為是非常不正常的。
也就是說,其中一個可能是你最好的選擇。
標籤:CertificateOverTransport 2 指定發起者由X.509版本3證書認證,回應者由SSL over HTTPS認證。
MutualCertificate 9
指定發起者和回應者使用X.509版本3證書進行認證。
MutualCertificateDuplex 10
指定發起者和回應者用X.509版本3證書進行認證。
MutualSslNegotiated 11
指定發起者和應答者使用X509版本3證書相互認證,應答者的證書可以從SOAP SSL協商中獲得。
