- IGenericService は、"ABC.Server.Common" (ABC.Server.Common.dll) という名前のアセンブリに存在します。
- MyType は、"ABC.Server.Modules.X" (ABC.Server.Modules.X.dll) という名前のアセンブリに存在します。
コード:
public class ABC.Server.Modules.XService :
ABC.Server.Common.IGenericService<ABC.Server.Module.X.MyType>
{
ABC.Server.Common.GenericResponse<ABC.Server.Module.X.MyType> DoFoo(ABC.Server.Common.GenericRequest<ABC.Server.Module.X.MyType> request)
{
//Do Stuff Here
}
}
要約コード:
public class XService :
IGenericService<MyType>
{
GenericResponse<MyType> DoFoo(GenericRequest<MyType> request)
{
//Do Stuff Here
}
}
Web.config:
私は SVC ファイルを使用しません。代わりに、その情報は Web.config で処理されます。
<add factory="System.ServiceModel.Activation.ServiceHostFactory"
relativeAddress="Services/X.svc"
service="ABC.Server.Modules.X.XService"/>
<service name="ABC.Server.Modules.X.XService"
behaviorConfiguration="StandardBehavior">
<endpoint bindingConfiguration="StandardBinding"
binding="basicHttpBinding"
contract="?" />
</service>
実際に機能させるには、コントラクト名に何を入力すればよいですか?