WindowsサービスによってホストされるWCFアプリケーションをセットアップしました。私はこれが正しく動作するようにして、私はhttp://127.0.0.1:1214に行くことでそれにナビゲートすることができます。ここでの設定は以下のとおりです。httpsを通じてWCFサービスにアクセスできない
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service name="NetworkPrintClient.PrintWebService" behaviorConfiguration="PrintServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://127.0.0.1:1214/"/>
</baseAddresses>
</host>
<endpoint address="" binding="wsHttpBinding" contract="NetworkPrintClient.IPrintWebService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="PrintServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="False"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
今、私はhttps://127.0.0.1:1214でこれにアクセスできるようにしたいと思います。これについていくつかの記事を読んだら、私は以下の設定で終わります。しかし、私はもうアプリケーションを参照することはできません。 Chromeで「このサイトにアクセスできません」というエラーが表示されるだけです。
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service name="NetworkPrintClient.PrintWebService" behaviorConfiguration="PrintServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="https://127.0.0.1:1214/"/>
</baseAddresses>
</host>
<endpoint address="" binding="webHttpBinding" contract="NetworkPrintClient.IPrintWebService" behaviorConfiguration="HttpBehavior" bindingConfiguration="PrintServiceHttpsBinding"/>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="PrintServiceBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="False"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="HttpBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="PrintServiceHttpsBinding">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</webHttpBinding>
</bindings>
<protocolMapping>
<add binding="webHttpBinding" scheme="https"/>
</protocolMapping>
</system.serviceModel>
</configuration>
私は、これははるかにhereで取得するために使用品。私は、証明書を作成し、それを私のIPとポートにマッピングすることについて、一番下の部分を行った。私もこれを "localhost"と私の実際のIPアドレスで動作させようとしました。誰かが私が間違っているのを見ることができますか?証明書を作成するための
WCFテストクライアントでサービスにアクセスしようとしましたか? https://docs.microsoft.com/en-us/dotnet/framework/wcf/wcf-test-client-wcftestclient-exe - 場合によっては役立つことがわかりました。また、上記の作業バージョンからやり直してから、残りのすべてを糊付けして、すべてのステップがまだ動作していることを確認することをお勧めします。 – dnickless