私はWCFを新しくしていますので、私にご負担ください。WCFスターターキットを使用してSOAPエンドポイントを公開するにはどうすればよいですか?
最新バージョンのWCF RESTスターターキットを使用して、Androidアプリケーションから呼び出されているWebサービスを作成しました。 RESTfulエンドポイントは正常に動作していますが、.NETクライアントがそれを使用して必要なクラスをすべて生成できるようにSOAPエンドポイントを作成したいと考えています。
私はまだデフォルト設定ファイルを使用していますが、私は何をする必要があるのか少し混乱しています。
ここでは、私は、configファイルの中にどこかに以下を追加する必要がありますが、私は正しい道の上だ場合、それが属しているか、どこがわからないと思う
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</modules>
</system.webServer>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<standardEndpoints>
<webHttpEndpoint>
<!--
Configure the WCF REST service base address via the global.asax.cs file and the default endpoint
via the attributes on the <standardEndpoint> element below
-->
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true"/>
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
</configuration>
です。
<endpoint name="mex" address="mex" binding="mexHttpBinding" contract="Service1"/>
<endpoint name="soap" address="soap" binding="basicHttpBinding" contract="Service1"/>
私はクラスが1つしかなく、それはService1.csです。私はいくつかの変更を加えようとしましたが、私は成功しませんでした。
私は何を追加しなければならないのか、それがなぜ必要なのかを説明したいと思います。
- 更新 - 私は、サービスタグを挿入した後
、私は、Visual Studioで作業する機能「サービス参照の追加」を取得してトラブルを抱えていました。私は 'HttpGetEnabled'が真である必要があることを知ったので、サービスメタデータをhttpに公開します。
これを追加して、動作しているようです。
<behaviors>
<serviceBehaviors>
<behavior name="Service1Behavior">
<serviceMetadata httpGetEnabled="true" policyVersion="Policy15"/>
</behavior>
</serviceBehaviors>
</behaviors>
さらにサービスを追加すると、そのサービス用にさらに2つのエンドポイントを作成する必要がありますか?
ありがとうございました。