WebGET属性を使用してGET要求を受信できるメソッドを使用してWCfサービスを作成しました。同じメソッドで、Soap呼び出しも受信する必要があります(プログラマーがWCFへのサービス参照を行うと、メソッドを呼び出すことができます)。
私のインターフェースは:
[ServiceContract]
public interface IService1
{
[OperationContract]
[WebGet(UriTemplate = "GetData?value={value}")]
string GetData(int value);
}
私の構成は次のとおりです。
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="WebBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="WCFTestingGetService.Service1" behaviorConfiguration="MyServiceBehavior" >
<endpoint address="" binding="webHttpBinding" contract="WCFTestingGetService.IService1" behaviorConfiguration="WebBehavior"></endpoint>
</service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
WebメソッドGetDataをHTTPGETおよびSOAPメソッドにすることはできますか?
構成に何を追加する必要がありますか?