Question

I am trying to create wcf service using wshttpbinding but whenever i change the securitymode it always getting error not matter how i modify it with the sample from google

<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
  <serviceActivations>
    <add relativeAddress="General.svc" service="SMJ.Services.GeneralService" />
  </serviceActivations>
</serviceHostingEnvironment>
<bindings>
  <wsHttpBinding>
    <binding closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
      allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
   maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
      messageEncoding="Text" textEncoding="utf-8" 
      useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="16348"
        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None"
          realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
<services>
  <service name="SMJ.Services.GeneralService" behaviorConfiguration="ServiceBehaviors" >
    <endpoint contract="SMJ.Services.IGeneralService" binding="wsHttpBinding"></endpoint>
  </service>
</services>
<behaviors>
  <serviceBehaviors >
    <behavior name="ServiceBehaviors"  >
      <serviceMetadata httpGetEnabled="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

and when i change the security mode to another it will show this error Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding. Registered base address schemes are [http].

The server is IIS 7 but the problem is when i am under development

Please help me

Was it helpful?

Solution

ok I found the solution with using IIS Express and at the web project at the properties windows set the SSL Enabled to true. Thanks's for the advice

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top