Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Re-style default asmx color scheme

Tags:

asp.net

asmx

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 :-|

like image 913
Matt Frear Avatar asked Nov 24 '09 23:11

Matt Frear


2 Answers

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.

like image 89
David Hall Avatar answered Nov 11 '22 09:11

David Hall


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

Stephen Toub: ASP.NET Web Services Test Page

like image 3
Justin Niessner Avatar answered Nov 11 '22 11:11

Justin Niessner