tags:

views:

87

answers:

2

When you create a web service using .NET 2.0 (or 3.5), it generates a .asmx file for you. When this .asmx is rendered in a web browser it shows up with a dark blue border at the top and the name of the web service, like so: web service screenshot

Is it possible to restyle this page? I need to change the dark blue color to match the client's colors. Seems pointless to me but that's what the customer wants :-|

+3  A: 

Good news - 'tis possible. Check out this blog post for the full rundown.

Stephen Toub: ASP.NET Web Services Test Page

Justin Niessner
+2  A: 

As mentioned in the blog post provided by Justin, it is possible to restyle the Wsdl help page by modifying the DefaultWsdlHelpGenerator.aspx page that can be found at C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\

There is more that can be done, however - the blog post only mentions directly altering this file and changing where it can be found in the machine.config file. This has the limitation that it applies for all web services that are hosted on a server.

It is possible to provide a customised help page for individual web services.

To do this all you need to do is add a copy of the file mentioned above to your web service's project and then reference that new file from your web.config file.

The config section you need to add is shown below:

<configuration>
    <system.web>
        <webServices>
          <wsdlHelpGenerator href="MyCustomWsdlHelpGenerator.aspx"/>
        </webServices>
     </system.web>
</configuration>

Navigate to the asmx in the browser and you will see the specified help page instead of the default one.

David Hall