开发者

The provided URI scheme 'https' is invalid; expected 'http' - basicHttpBinding with HTTPs not working

开发者 https://www.devze.com 2023-03-31 03:19 出处:网络
I\'ve a wcf config as shown below and I\'m trying the run the service on https. <system.serviceModel>

I've a wcf config as shown below and I'm trying the run the service on https.

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
          <binding name="basicHttps">
            <security mode="TransportWithMessageCredential">
              <transport clientCredentialType="Username" />
              <message />
            </security>
          </binding>
        </basicHttpBinding>
    </bindings>

    <services>
       <service behaviorConfiguration="serviceBehavior" name="MyService">
        <endpoint address="mex" binding="mexHttpsBinding" bindingConfiguration=""
          bindingNamespace="http://mydomain.com" contract="IMetadataExchange" />

        <endpoint binding="basicHttpBinding" bindingConfiguration="basicHttps"
          name="basicTest" bindingNamespace="http://mydomain.com"
          contract="IMyContract" />
      </service>
    </services>

    <behaviors>
      <serviceBehaviors>
        <behavior name="serviceBehavior">
          <serviceMetadata httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceCredentials>
            <userNameAuthentication userNamePasswordValidationMode="MembershipProvider"
              membershipProviderName="MySqlMembershipProvider" />
          </serviceCredentials>
        </behavior>
        <behavior>          
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
    </serviceBehaviors>
      </behaviors>

    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

WCFSTORM error out with this: *

The provided URI scheme 'https' is invalid; expected 'http'.

  • Could someone please help me point out my bug on above config please?

I also tried with this but same error:

<basicHttpBinding>
          <binding name="basicHttps">
            &l开发者_如何学Got;security mode="Transport">
              <transport clientCredentialType="None" />
              <message />
            </security>
          </binding>
        </basicHttpBinding>

My Service Class looks like below:

namespace Service
{
    [ServiceBehavior(AddressFilterMode = AddressFilterMode.Any, Namespace = "http://mydomain.com")]
    class MyService : IMyContract
    {

    }

}


Thank you all who put some comments on my question. finally I figured out myself. The config was all OK.

The problem was with WCF Storm, the Authentication Type should be set to NONE on Config dialog (WCF STORM).

Thank you again.


or use wsHttpBinding instead of basicHttpBinding and no need to change something on WCFStorm side

0

精彩评论

暂无评论...
验证码 换一张
取 消