提供的 URI 方案 'https' 无效;预计 'http'。参数名称--需要立即帮助
The provided URI scheme 'https' is invalid; expected 'http'. Parameter name--Immediate Help Needed
您好,我尝试了 stack over flow 中提供的所有解决方案。我收到 "The provided URI scheme 'https' is invalid; expected 'http'. Parameter name: via" 错误。 IIS7 中的服务运行良好,每当我尝试使用此服务时都会收到此错误 service.Please 请参阅我的 wcf 服务配置和客户端配置。
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation targetFramework="4.0"/>
<httpRuntime/>
</system.web>
<system.serviceModel>
<serviceHostingEnvironment >
<serviceActivations>
<add factory="System.ServiceModel.Activation.ServiceHostFactory" relativeAddress="./CARetriever.svc" service="CARetrieverInterface.CARetriever"/>
</serviceActivations>
</serviceHostingEnvironment>
<behaviors>
<serviceBehaviors>
<behavior name="MyTesting">
<!-- Other options would go here -->
<useRequestHeadersForMetadataAddress>
<defaultPorts>
<add scheme="https" port="443" />
</defaultPorts>
</useRequestHeadersForMetadataAddress>
<serviceMetadata httpsGetEnabled="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="CARetrieverInterface.CARetriever" behaviorConfiguration="MyTesting">
<endpoint address="https://sspumptest.dhr.state.ga.us/testcode/CARetriever.svc" binding="basicHttpBinding" contract="CARetrieverInterface.ICARetriever" bindingConfiguration="secureHttpBinding">
<identity>
<dns value="sspumptest.dhr.state.ga.us" />
</identity>
</endpoint>
<!--<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />-->
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="secureHttpBinding">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
My client configuration is given below.
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ICARetriever">
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://sspumptest.dhr.state.ga.us/testcode/CARetriever.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICARetriever"
contract="CARetrieverRef.ICARetriever" name="BasicHttpBinding_ICARetriever" />
</client>
</system.serviceModel>
</configuration>
我将客户端配置绑定部分更改为服务配置。我更改了客户端配置,如下所示。
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ICARetriever">
<security mode="Transport">
</security>
</binding>
</basicHttpBinding>
</bindings>
一旦我这样做了,我就得到了访问被拒绝的异常。然后我将应用程序池标识从 NetworkService 更改为 LocalSystem。它就像一个魅力,我得到了回应。我再次尝试在应用程序池中将 NetworkService 更改为 Defaultappoolidentity 然后它也起作用了。但是,如果我从客户端配置中删除,它会给出类似 "provided URI scheme 'https' is invalid; expected 'http'." 的错误。如果你们对此有任何其他想法,请告诉我。
您好,我尝试了 stack over flow 中提供的所有解决方案。我收到 "The provided URI scheme 'https' is invalid; expected 'http'. Parameter name: via" 错误。 IIS7 中的服务运行良好,每当我尝试使用此服务时都会收到此错误 service.Please 请参阅我的 wcf 服务配置和客户端配置。
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation targetFramework="4.0"/>
<httpRuntime/>
</system.web>
<system.serviceModel>
<serviceHostingEnvironment >
<serviceActivations>
<add factory="System.ServiceModel.Activation.ServiceHostFactory" relativeAddress="./CARetriever.svc" service="CARetrieverInterface.CARetriever"/>
</serviceActivations>
</serviceHostingEnvironment>
<behaviors>
<serviceBehaviors>
<behavior name="MyTesting">
<!-- Other options would go here -->
<useRequestHeadersForMetadataAddress>
<defaultPorts>
<add scheme="https" port="443" />
</defaultPorts>
</useRequestHeadersForMetadataAddress>
<serviceMetadata httpsGetEnabled="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="CARetrieverInterface.CARetriever" behaviorConfiguration="MyTesting">
<endpoint address="https://sspumptest.dhr.state.ga.us/testcode/CARetriever.svc" binding="basicHttpBinding" contract="CARetrieverInterface.ICARetriever" bindingConfiguration="secureHttpBinding">
<identity>
<dns value="sspumptest.dhr.state.ga.us" />
</identity>
</endpoint>
<!--<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />-->
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="secureHttpBinding">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
My client configuration is given below.
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ICARetriever">
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://sspumptest.dhr.state.ga.us/testcode/CARetriever.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICARetriever"
contract="CARetrieverRef.ICARetriever" name="BasicHttpBinding_ICARetriever" />
</client>
</system.serviceModel>
</configuration>
我将客户端配置绑定部分更改为服务配置。我更改了客户端配置,如下所示。
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ICARetriever">
<security mode="Transport">
</security>
</binding>
</basicHttpBinding>
</bindings>
一旦我这样做了,我就得到了访问被拒绝的异常。然后我将应用程序池标识从 NetworkService 更改为 LocalSystem。它就像一个魅力,我得到了回应。我再次尝试在应用程序池中将 NetworkService 更改为 Defaultappoolidentity 然后它也起作用了。但是,如果我从客户端配置中删除,它会给出类似 "provided URI scheme 'https' is invalid; expected 'http'." 的错误。如果你们对此有任何其他想法,请告诉我。