我已经为asp.net 3.5网站配置了wcf服务。我也从脚本访问该服务。 http中的所有配置都可以正常工作。现在,我在开发环境中转换正常后,转换为https。在通过ssl认证托管环境中,
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="mex" maxReceivedMessageSize="2147483647">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" />
</security>
</binding>
<binding name="soap" maxReceivedMessageSize="2147483647" />
</basicHttpBinding>
<webHttpBinding>
<binding name ="REST SSL">
<security mode ="Transport">
<transport clientCredentialType= "None" />
</security>
</binding>
</webHttpBinding>
</bindings>
<client>
<endpoint address="https://192.168.5.222/webpoint/wcCommonService.svc" binding="basicHttpBinding" bindingConfiguration="SecureTransportOnly" contract="ServiceReference1.IwcCommonService" name="soap">
<identity>
<dns value="192.168.5.222" />
</identity>
</endpoint>
</client>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
<baseAddressPrefixFilters>
<add prefix="https://sitename.com/webpoint/"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
<behaviors>
<serviceBehaviors>
<behavior name="wcMobService.webpoint.Service1Behavior">
<serviceMetadata httpsGetEnabled="true" httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
<behavior name="wcMobService.webpoint.wocMobSearchBehavior">
<serviceMetadata httpsGetEnabled="true" httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="JsonBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="wcMobService.webpoint.Service1Behavior" name="wcMobService.webpoint.Service1">
<endpoint name="rest" address="" binding="webHttpBinding" bindingConfiguration="REST SSL" contract="wocMobService.webpoint.wcMobIServiceJson" behaviorConfiguration="JsonBehavior" />
</service>
<service behaviorConfiguration="wcMobService.webpoint.wcMobSearchBehavior" name="wcMobService.webpoint.wcMobSearch">
<endpoint name="rest" address="" binding="webHttpBinding" bindingConfiguration="REST SSL" contract="wcMobService.webpoint.wcMobISearch" behaviorConfiguration="JsonBehavior" />
</service>
<service name="wcCommonWCF.webpoint.wcCommonService" behaviorConfiguration="wcMobService.webpoint.Service1Behavior">
<endpoint name="rest" address="" binding="webHttpBinding" bindingConfiguration="REST SSL" contract="wcCommonWCF.webpoint.IwcCommonService" behaviorConfiguration="JsonBehavior" />
<endpoint address="mex" binding="mexHttpsBinding" contract="wocCommonWCF.webpoint.IwcCommonService" />
<endpoint name="soap" address="soap" binding="mexHttpsBinding" contract="wcCommonWCF.webpoint.IwcCommonService" />
</service>
</services>
</system.serviceModel>
由于编译期间发生异常,因此无法激活服务“ /wbpoint/wcCommonService.svc”。异常消息是:此集合已经包含一个带有方案http的地址。该集合中每个方案最多可以有一个地址。