none
WCF WebService: Showing a custom help page doesn't work!?

    Question

  • Hi folks,

    I have a WCF web service and I need to show a custom help page when the service's address is accessed within a browser.

    This worked fine with the old ASP.NET web service using <wsdlHelpGenerator href="helppage.aspx"/>. But now with WCF I'm going nuts. Here is what I've done so far within my web.config:

    <system.serviceModel>
    	<behaviors>
    		<serviceBehaviors>
    			<behavior name="MyServiceTypeBehaviors" >
    				<serviceMetadata httpGetEnabled="true" />
    				<serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" httpHelpPageUrl="helppage.aspx" />
    			</behavior>
    		</serviceBehaviors>
    	</behaviors>
    	<services>
    		<service name="MyWebService" behaviorConfiguration="MyServiceTypeBehaviors">
    			<endpoint binding="basicHttpBinding" contract="IMyWebService" bindingNamespace="http://mywebservices.com/"/>
    			<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex"/>
    		</service>
    	</services>
    </system.serviceModel>

    I thought with help of httpHelpPageEnabled & httpHelpPageUrl it's possible to show my custom help page, but when I access my service's endpoint, I get directly to the WSDL definition, not even the default help page is displayed. Exactly the oposite of what I want to realize!!

    Why in ____ doesn't this work? What am I doing wrong? And how can I show my custom help page?

    Thanks for your help,
    Dante

     

    Tuesday, May 11, 2010 3:40 PM

Answers

  • Hi Dante,

    It seems the <serviceDebug httpHelpPageUrl /> provides you a way to choose a custom location to put the helper page, however, it won't automatically replace the one at the service baseAddress. To replace the baseAddress page with your own content, you can add a custom endpoint at the location and return the help page content. The following threads has discussed on the same topic:

    #Custom HTML Help Page for httpGet for an IIS6 Hosted WCF Service
    http://social.msdn.microsoft.com/Forums/en/wcf/thread/5778651a-b212-438a-b3e8-f7029775d52a


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by Mog Liang Wednesday, May 19, 2010 6:31 AM
    Wednesday, May 19, 2010 6:30 AM

All replies

  • Hi Dante,

    It seems the <serviceDebug httpHelpPageUrl /> provides you a way to choose a custom location to put the helper page, however, it won't automatically replace the one at the service baseAddress. To replace the baseAddress page with your own content, you can add a custom endpoint at the location and return the help page content. The following threads has discussed on the same topic:

    #Custom HTML Help Page for httpGet for an IIS6 Hosted WCF Service
    http://social.msdn.microsoft.com/Forums/en/wcf/thread/5778651a-b212-438a-b3e8-f7029775d52a


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by Mog Liang Wednesday, May 19, 2010 6:31 AM
    Wednesday, May 19, 2010 6:30 AM
  • First of all, thanks for your answer.

    Actually I already encountered this thread, but this seems to be a complex solution for a quite simple problem. Everyone just uses phrases like "it seems ...", "I believe ..." or "probably ...". Nobody seems to know with certainty how these attributes work.

    With normal ASP.NET the solution was so easy. It would be very sad to realise that there is no similar functionality for WCF!

    Ciao,
    Dante

    Wednesday, May 19, 2010 6:56 PM