賢い皆さん、こんにちは。
そこで、あえて WCF サービスにしました。WCFテストユーティリティで実行すると、正常に動作します。
しかし、次のステップでは、いくつかの問題に遭遇しました。IIS で WCF サービスをホストします。
前述のとおり、このサービスはテスト ユーティリティと連携します。
私の解決策:
IIS でサービスをホストするために、ソリューションでわかるように「HostIISTcp」というフォルダーを作成し、「bin」フォルダーの下に dll と pdb を追加しました。私が理解できるように、IIS は app.config ファイルを操作できないため、web.config ファイルを作成しました。ここで、クラス ライブラリの app.config ファイルからコピー/貼り付けするだけです。
web.config :
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
<system.serviceModel>
<services>
<service name="MyWCFServices.RealKursusService.KursistService">
<endpoint address="" binding="basicHttpBinding" contract="MyWCFServices.RealKursusService.IKursistService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080/MyWCFServices/RealKursusService/KursistService/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
問題は web.config ファイルにあると思いますが、初心者であることをお許しください。
要約すると、私は正しい軌道に乗っていますか? IIS で wcf サービスをホストするための別の (より良い) ソリューションはありますか? また、web.config ファイルに何か欠けているものがあるかどうかを指摘できれば、それは素晴らしいことです。
Visual Studio 2012、IIS 8 .net Framework 4.5 を使用しており、革張りの椅子に座っています。