SQLサーバーに接続してデータを取得し、オブジェクトを構築してから返すWCFサービスがあります。私は単純なバインド、.NET 4.0 を使用します。WCF サービスを作成するときに、テンプレートから既定の設定だけを特別な設定は追加していません。
サービスはローカル db を使用してローカルで正常に実行されますが、サーバーにデプロイしたときに時間を確認すると、処理に 7 マイクロ秒かかります(最初の処理にはもう少し時間がかかります)。コードの最初の行に到達する前にリクエストを送信しましたが、その理由がわかりません。
<endpoint address="http://localhost/Service.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IService" contract="Local.IService"
name="BasicHttpBinding_IService" />
ありがとう!
サービスの動作:
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
バインディング:
<bindings>
<basicHttpBinding>
<binding name="BasicBinding" maxReceivedMessageSize="10485760" />
</basicHttpBinding>
</bindings>