Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The provided URI scheme 'https' is invalid; expected 'http'. Parameter name: via

Tags:

c#

https

wcf

I am trying to make a WCF service over basicHttpBinding to be used over https. Here's my web.config:

<!-- language: xml --> <service behaviorConfiguration="MyServices.PingResultServiceBehavior"          name="MyServices.PingResultService">     <endpoint address=""                binding="basicHttpBinding"                bindingConfiguration="defaultBasicHttpBinding"               contract="MyServices.IPingResultService">         <identity>             <dns value="localhost" />         </identity>     </endpoint>     <endpoint address="mex"                binding="mexHttpBinding"                contract="IMetadataExchange" /> </service> ... 
<bindings>   <basicHttpBinding>     <binding name="defaultBasicHttpBinding">       <security mode="Transport">         <transport clientCredentialType="None"/>       </security>     </binding>   </basicHttpBinding> </bindings> ... <behaviors>   <serviceBehaviors>     <behavior name="MyServices.UpdateServiceBehavior">       <serviceMetadata httpsGetEnabled="true" />       <serviceDebug includeExceptionDetailInFaults="true" />     </behavior>   </serviceBehaviors> </behaviors> 

I am connecting using WCFStorm which is able to retrieve all the meta data properly, but when I call the actual method I get:

The provided URI scheme 'https' is invalid; expected 'http'. Parameter name: via

like image 793
isg Avatar asked Mar 12 '10 20:03

isg


1 Answers

Try adding message credentials on your app.config like:

<bindings>  <basicHttpBinding>  <binding name="defaultBasicHttpBinding">    <security mode="Transport">      <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>      <message clientCredentialType="Certificate" algorithmSuite="Default" />   </security>  </binding>  </basicHttpBinding>  </bindings>  
like image 120
Jojo Sardez Avatar answered Oct 10 '22 18:10

Jojo Sardez