我的一位同事給了我一個SOAP UI模擬服務項目的副本。我可以在我的機器上打開並運行這個模擬服務。 它是運行在地址:http://localhost:8088/mockShipmentInformationService使用WCF調用SOAP UI模擬服務:「提供的URI方案'https'無效;期望'http'。」
的WSDL提供地址:http://localhost:8088/mockShipmentInformationService_SOAPBinding?WSDL
使用提供的WSDL,我添加了一個服務引用到應用程序項目。爲了測試調用服務的方法,我還將服務引用添加到單元測試項目中。
這兩個項目,下面添加到的app.config:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ShipmentInformationService_SOAPBinding" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8088/mockShipmentInformationService_SOAPBinding"
binding="basicHttpBinding" bindingConfiguration="ShipmentInformationService_SOAPBinding"
contract="ShipmentInformationService.ShipmentInformationService"
name="ShipmentInformationServicePort" />
</client>
</system.serviceModel>
正如你所看到的,URL使用普通的HTTP協議,而不是HTTPS。另外,我的安全模式設置爲「無」。然而,在嘗試調用服務方法時,我仍然收到以下錯誤消息:
The provided URI scheme 'https' is invalid; expected 'http'.
Parameter name: via
什麼給出了?可能會有一些網址被定義爲造成嚴重破壞的地方?我應該在哪裏看?