WCFサービスを構成していて、ルーティングを使用して構成しています。404メッセージの本文に次のように記載されていることを除いて、すべてが希望どおりに機能しています。Service Endpoint not found.
404の応答本文を空にします。
これが私のルート登録です:
public class Global : HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
private void RegisterRoutes(RouteCollection routes)
{
routes.Add(new ServiceRoute("RootService", new WebServiceHostFactory(), typeof(ServiceProvider)));
}
これが私のサービスクラスです:
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
[ServiceContract]
public class ServiceProvider
{
[WebGet]
public Test ValidUrl()
{
return new Test();
}
}
このURLhttp:// localhost / RootServiceの応答に空の404本文を含めるにはどうすればよいですか?