none
The provided URI scheme 'https' is invalid; expected 'http'. RRS feed

  • 问题

  • 写了一个非常简单的web service, 部署到server上IIS上,在PC上调用web service里面的方法,返回如下错误,

    The remote server returned an unexpected response: (407) Proxy Authentication Required.

    通过在app.config里面加入如下设定解决,

      <system.net>
        <defaultProxy useDefaultCredentials="true"></defaultProxy>
      </system.net>

    当切换web service从http到https,又出现问题,请问如何解决了?谢谢!

    The provided URI scheme 'https' is invalid; expected 'http'.

    2014年7月16日 1:40

答案

  • 你好,

    你的问题应该和你的binding的配置有问题,有可以尝试下下面的配置:

    <bindings>
    <wsHttpBinding>
    <binding name="WSHttpBinding_IWSHttpService" closeTimeout="00:01:00"
    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
    allowCookies="false">
    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
    <reliableSession ordered="true" inactivityTimeout="00:10:00"
    enabled="false" />
    <security mode="Transport">
    <transport clientCredentialType="None" proxyCredentialType="None"
    realm="" />
    <message clientCredentialType="None" negotiateServiceCredential="true"
    algorithmSuite="Default" establishSecurityContext="true" />
    </security>
    </binding>
    </wsHttpBinding>
    </bindings>
    

    • 已标记为答案 JimmyGates 2014年7月29日 3:40
    2014年7月17日 1:37

全部回复

  • 你好,

    你的问题应该和你的binding的配置有问题,有可以尝试下下面的配置:

    <bindings>
    <wsHttpBinding>
    <binding name="WSHttpBinding_IWSHttpService" closeTimeout="00:01:00"
    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
    allowCookies="false">
    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
    <reliableSession ordered="true" inactivityTimeout="00:10:00"
    enabled="false" />
    <security mode="Transport">
    <transport clientCredentialType="None" proxyCredentialType="None"
    realm="" />
    <message clientCredentialType="None" negotiateServiceCredential="true"
    algorithmSuite="Default" establishSecurityContext="true" />
    </security>
    </binding>
    </wsHttpBinding>
    </bindings>
    

    • 已标记为答案 JimmyGates 2014年7月29日 3:40
    2014年7月17日 1:37
  • 你好,

    你的问题应该和你的binding的配置有问题,有可以尝试下下面的配置:

    <bindings>
    <wsHttpBinding>
    <binding name="WSHttpBinding_IWSHttpService" closeTimeout="00:01:00"
    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
    allowCookies="false">
    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
    <reliableSession ordered="true" inactivityTimeout="00:10:00"
    enabled="false" />
    <security mode="Transport">
    <transport clientCredentialType="None" proxyCredentialType="None"
    realm="" />
    <message clientCredentialType="None" negotiateServiceCredential="true"
    algorithmSuite="Default" establishSecurityContext="true" />
    </security>
    </binding>
    </wsHttpBinding>
    </bindings>
    

    谢谢

    2014年7月29日 3:41