2010-11-19 9 views
6

VS2010(Premium)で新しいWCFサービスアプリケーションプロジェクトを作成しました。すぐに使用できますが、web.configファイルを開いたときには存在する終点。アプリケーションは正常に動作し、ブラウザでアドレス(http:// localhost:50639/Service1.svc?wsdl)を開くことができます。契約書を見ることができます。既定のwcfサービスアプリケーションにはエンドポイントが定義されていません

私の質問は、デフォルトのプロジェクトがweb.configに情報を置くのではなく、別のアプローチを使用しているかどうかです。私はコードの中の何も見ることができません。

これはweb.configファイルに含まれているすべてである私のポイントを表示するには:

<?xml version="1.0"?> 
<configuration> 

    <system.web> 
    <compilation debug="true" targetFramework="4.0" /> 
    </system.web> 
    <system.serviceModel> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <!-- To avoid disclosing metadata information, set the value below to false  and remove the metadata endpoint above 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" /> 
    </system.serviceModel> 
<system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 

</configuration> 

そして、まだこのサービスの作品と私は()などのGetData()デフォルトのメソッドを接続して呼び出すことができます両方

答えて

8

それは「異なる」アプローチではありません。これは、simplified configurationと呼ばれるWCF 4.0の新しいアプローチです。 .NET 4.0でプロジェクトを作成すると、この単純化されたモードが得られます。 .NET 3.5でプロジェクトを作成すると、古いchatty設定が取得されます。

+0

これはHTTPSでも当てはまりますか?私は参照を見つけることができませんでした。 – Spock

+0

申し訳ありません、自分で試しました。はい、それもHTTPsのために動作します:) – Spock

+0

@ SpockどのようにこれはHTTPSのために働くようになったのですか? – Arj

関連する問題