2013-10-07 122 views
0

我使用的网站包含.svc文件并作为其余api托管在https上。我的问题是: 我的网站已经SVCUTIL.exehttps://XXXXXXX但是当我以https叫它请求失败,但以http request.And我不想使用SSL证书 感谢无法通过https请求呼叫

这是我的webconfig的设置工作正常:

<serviceBehaviors> 
    <behavior name="Mybehaviour"> 
     <serviceMetadata httpsGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> 
<services> 
    <service behaviorConfiguration="Mybehaviour" name="PBUIService"> 
    <endpoint address="https://XXXXXXXXXXXXXXX" behaviorConfiguration="PBBehaviour" binding="webHttpBinding" bindingConfiguration="wsHttpBindingSettings" contract="PBUIService"> 
    </endpoint> 
    <endpoint address="mex" binding="mexHttpsBinding" 
contract="IMetadataExchange" /> 
    </service> 
</services> 
+0

您可以启用跟踪(http://msdn.microsoft.com/en-us/library/ms733025.aspx )在你的WCF服务上看看使用SSL时发生了什么。 – Rajesh

回答

0

我已经添加了以下几行,以使其以https工作:

<system.serviceModel> 
    <bindings> 
     <webHttpBinding> 
      <binding name="webBinding"> 
       <security mode="Transport"> 
       </security> 
      </binding> 
     </webHttpBinding>   
    </bindings> 
+0

你是对的,但在这种情况下,我不得不在客户端使用SSL证书,但我不想,因为我把这作为一个Web API。 –

+0

<的WebHttpBinding> <绑定名称= “wsHttpBindingSettings” bypassProxyOnLocal = “真” maxReceivedMessageSize = “2147483647”>