変な質問になりますが、
現在、自分の Web サイトで wcf サービスを実行しています (Visual Studio 2012 - .scv ファイルで作成)。組み込みのwcfテストクライアントに加えて、接続をテストしようとするコンソールクライアントがあります。テスト クライアントは正常に動作し、関数を呼び出すことができますが、サイト/テスト クライアントの実行を停止しても (これは拡張機能によるホストを意味するはずですよね?)、コンソール クライアントは引き続き実行され、サービスと対話することができます。大丈夫。
また、ブラウザーで実行されていない WCF サービス ページにアクセスすることもできます。コンソールで WCF を作成したとき、ホストが実際に実行されていない間は、これらのことを行うことができませんでした。このため、私が見ていないコードに何か問題があるのではないかと思っています。
サーバーでウェブサイトをオンラインにしようとすると、これが問題に発展するのを見ることができました(テストクライアントがサービスと同じマシンに配置されないためです。実行していないときでもファイル)。
どうすればいいですか / 何が問題なのですか?
お時間をいただきありがとうございます。
関連する web.config コード:
<system.serviceModel>
<services>
<!-- ICanHasGamez=solution that holds the webpage&wcfservice -->
<service name="ICanHasGamez.APIHost" behaviorConfiguration="behavior">
<endpoint address="" binding="basicHttpBinding" contract="ICanHasGamez.IAPIHost">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name ="behavior">
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
</system.serviceModel>
コンソール クライアントからの app.config コード:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IAPIHost" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:2105/APIHost.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IAPIHost" contract="ServiceReference1.IAPIHost"
name="BasicHttpBinding_IAPIHost" />
</client>
</system.serviceModel>
</configuration>