指定された URI スキーム「https」は無効です。「http」が期待されます。パラメータ名: 質問する

指定された URI スキーム「https」は無効です。「http」が期待されます。パラメータ名: 質問する

私は、https 経由で使用できるように、basicHttpBinding 経由の WCF サービスを作成しようとしています。これが私の 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>

すべてのメタデータを適切に取得できる WCFStorm を使用して接続していますが、実際のメソッドを呼び出すと次のようになります。

指定された URI スキーム 'https' は無効です。'http' が期待されます。パラメータ名: via

ベストアンサー1

次のように、app.config にメッセージ資格情報を追加してみてください。

<bindings> 
<basicHttpBinding> 
<binding name="defaultBasicHttpBinding"> 
  <security mode="Transport"> 
    <transport clientCredentialType="None" proxyCredentialType="None" realm=""/> 
    <message clientCredentialType="Certificate" algorithmSuite="Default" />
  </security> 
</binding> 
</basicHttpBinding> 
</bindings> 

おすすめ記事