2
我已經看遍了所有的stackoverflow和互聯網,仍然無法找到這個解決方案 我已經設置了一個自定義basichttp綁定與'HTT'端點。 當我調用該方法時,它保持返回異常:自定義綁定:提供的URI方案'https'無效;預計'http'。參數名稱:通過
提供的URI方案'https'無效;預計'http'。參數名稱:經由
var endPoint = new EndpointAddress("https://xxxxx/v2_soap/index/");
var binding = new BasicHttpBinding
{
Name = "HandlerBinding",
CloseTimeout = TimeSpan.FromMinutes(1.0),
HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
MessageEncoding = WSMessageEncoding.Text,
MaxReceivedMessageSize = 65536000,
MaxBufferPoolSize = 65536000,
UseDefaultWebProxy = true,
AllowCookies = false,
BypassProxyOnLocal = false,
Security =
{
Mode =BasicHttpSecurityMode.Transport,
Transport =
{
ClientCredentialType = HttpClientCredentialType.None,
ProxyCredentialType = HttpProxyCredentialType.None
},
Message =
{
ClientCredentialType = BasicHttpMessageCredentialType.UserName
}
}
};
上述設置是精確的與加入的服務引用當VS產生的app.config:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="HandlerBinding" 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="Transport">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://xxxxx/v2_soap/index/?SID=qttkobaa5jrmaj22il8mn9n342"
binding="basicHttpBinding" bindingConfiguration="HandlerBinding"
contract="HandlerPortType"
name="HandlerPort" />
</client>
</system.serviceModel>
我甚至試圖從basicHttpBinding的到的WSHttpBinding改變,並且仍然沒有運氣。
參考http://stackoverflow.com/questions/2435823/the-provided-uri-scheme-https-is-invalid-expected-http-parameter -name-通過/ 13742104#13742104 – Lijo 2013-04-18 04:59:07