Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/321.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 提供的URI方案';http';无效;预期';https';。参数名称:via_C#_.net_Wcf_Iis_Deployment - Fatal编程技术网

C# 提供的URI方案';http';无效;预期';https';。参数名称:via

C# 提供的URI方案';http';无效;预期';https';。参数名称:via,c#,.net,wcf,iis,deployment,C#,.net,Wcf,Iis,Deployment,我想我会提出一个新问题,因为我的问题充满了噪音。不管怎样,我通过那里的建议工作,现在当我尝试访问客户机时,我得到了以下错误 堆栈跟踪: [ArgumentException: The provided URI scheme 'http' is invalid; expected 'https'. Parameter name: via] System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(Uri via

我想我会提出一个新问题,因为我的问题充满了噪音。不管怎样,我通过那里的建议工作,现在当我尝试访问客户机时,我得到了以下错误

堆栈跟踪:

[ArgumentException: The provided URI scheme 'http' is invalid; expected 'https'.
Parameter name: via]
   System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(Uri via) +12692384
   System.ServiceModel.Channels.HttpChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) +24
   System.ServiceModel.Channels.HttpsChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) +276
   System.ServiceModel.Channels.HttpsChannelFactory`1.OnCreateChannelCore(EndpointAddress address, Uri via) +29
   System.ServiceModel.Channels.HttpChannelFactory`1.OnCreateChannel(EndpointAddress remoteAddress, Uri via) +71
   System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via) +52
   System.ServiceModel.Channels.ChannelFactoryBase`1.CreateChannel(EndpointAddress address, Uri via) +55
   System.ServiceModel.Channels.ServiceChannelFactoryOverRequest.CreateInnerChannelBinder(EndpointAddress to, Uri via) +35
   System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via) +23
   System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via) +71
   System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via) +468
   System.ServiceModel.ChannelFactory`1.CreateChannel() +29
   System.ServiceModel.ClientBase`1.CreateChannel() +95
   System.ServiceModel.ClientBase`1.CreateChannelInternal() +23
   System.ServiceModel.ClientBase`1.get_Channel() +281
   _Default.btSubmit_click(Object sender, EventArgs e) +73
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9553178
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724
以下是web.config(用于客户端应用程序):



我已经尝试在相关问题中实现建议,但还没有找到任何帮助。

您可以使用
Mex绑定
代替此选项

除了mex绑定之外,还有几种选择

签出以下链接>>


在web.config中,将端点URL更改为https://...

谢谢您的回复。还有其他更简单的选择吗?
<configuration>
    <connectionStrings>
        <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
    </connectionStrings>
    <system.web>
        <compilation debug="false" targetFramework="4.0">
            <assemblies>
                <add assembly="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>
        <authentication mode="Forms">
            <forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
        </authentication>
        <membership>
            <providers>
                <clear/>
                <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
            </providers>
        </membership>
        <profile>
            <providers>
                <clear/>
                <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
            </providers>
        </profile>
        <roleManager enabled="false">
            <providers>
                <clear/>
                <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/>
                <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
            </providers>
        </roleManager>
    </system.web>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
    </system.webServer>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
        <binding name="BasicHttpBinding_IService">
          <security mode="Transport">
            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
            <message clientCredentialType="Certificate" algorithmSuite="Default" />

           </security>
        </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://10.0.2.141/Services/SunSetSunRiseService/Service.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService" contract="ServiceReference1.IService" name="BasicHttpBinding_IService"/>
        </client>
    </system.serviceModel>
</configuration>