degnome
degnome

Reputation: 253

How can you hide the fact your server has a WCF service located at MyService.svc

Is there a way to serve up a custom "Sorry not found" page from a direct access request to a WCF Service (.svc file) on a server running IIS 6.0, and .NET 3.5 SP1.

I have a requirement that my service in a Production environment is not discoverable. The requirement states that WSDL publishing should be off, and the request also states that when directly accessing the MyService.svc file via a HTTP Get Request that a "Sorry Not found" page is displayed instead.

I have no problem disabling the metadata in the config file.

<serviceMetadata httpGetEnabled="false" />

But I can't figure out a way to not show the default .svc page.

SERVICE
This is a Windows© Communication Foundation service.

Metadata publishing for this service is currently disabled.

If you have access to the service, you can enable metadata publishing by completing the following steps to modify your web or application configuration file: ...

** Also posted at ServerFault.

Upvotes: 0

Views: 2129

Answers (2)

Alvaroma
Alvaroma

Reputation: 101

Try setting http[s]HelpPageEnabled to false in Web.config. Example:

    <system.serviceModel>
      <behaviors>
         <serviceBehaviors>
            <behavior>
               <serviceMetadata httpGetEnabled="false" />
               <serviceDebug httpHelpPageEnabled="false"/>
            </behavior>
         </serviceBehaviors>
      </behaviors>
    </system.serviceModel>

Upvotes: 1

Darin Dimitrov
Darin Dimitrov

Reputation: 1038780

in web.config:

<httpHandlers>
    <remove verb="*" path="*.svc" />
    <add path="*.svc" verb="POST" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false"/>
</httpHandlers>

Upvotes: 1

Related Questions