こんにちは、私は WCF を使用するのに非常に慣れていません (半日経過)。ローカルホスト経由で表示できるサービスを作成しました
http://localhost:[ポート]/Service1.svc ? -いいえ404!
ただし、アプリケーションを介してこのサービスに接続する前に、サービスが実際に意図したものを返すかどうかを確認したいと考えています。(データベース接続がOKであることを確認するだけなど)
私はこれを私のIServiceに持っています(残念ながらVB.Netにありますが、C#は知っています..)
<OperationContract>
<WebGet(UriTemplate:="/method/{parameter}")>
Function getData(ByVal parameter As Integer) As String
もちろん、これは service1.svc クラスのメソッド getData を起動します (または起動する必要があります)。
それで、Webサービスを起動して、これをやろうとしました...
と
しかし、何もありません。(コードのデバッグも行いません)
周りを見回すと、私が触れていない私のWeb構成ファイルで行うことができます。
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<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" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
私が見逃しているのは何ですか?
ありがとう