none
Missing description in help page for task based WCF service RRS feed

  • Question

  • I'm currently hosting a few web services from within a WPF application. I also have enabled automatic help pages to simplify the service documentation. Every OperationContract is decorated with a Description attribute, containing information about the method.

    However, whenever I take a look at my help pages, I realize that only methods with a return type of void will correctly display their Description attribute here. Methods returning Task or Task<t> will only say "Service at localhost:XXXXX/ServiceEndpoint".

    As this pattern is used for IPC, I rely a lot on async operation contracts, so most of them will return a Task or Task<t>. Is there any way to fix this issue so the help gets displayed correctly?

    namespace App
    {
        [ServiceContract]
        public interface IMainService
        {
            [OperationContract]
            [WebGet(UriTemplate = "visibility")]
            [Description("Gets the main window visibility.")]
            Task<bool> GetVisibilityAsync();
    
            [OperationContract]
            [WebInvoke(UriTemplate = "visibility", Method = "PUT")]
            [Description("Sets the main window visibility.")]
            Task SetVisibilityAsync(bool isVisible);
    
            [OperationContract]
            [WebInvoke(UriTemplate = "menu", Method = "PUT")]
            [Description("Navigates to the main menu.")]
            void NavigateToMainMenu();
    
            [OperationContract]
            [WebInvoke(UriTemplate = "shutdown", Method = "PUT")]
            [Description("Requests the application to shutdown.")]
            void RequestApplicationShutdown();
        }
    }

    <system.web>
        <compilation debug="false" targetFramework="4.5" />
      </system.web>
    
      <system.serviceModel>
        <services>
    
          <service name="App.MainService" behaviorConfiguration="rpcServiceBehavior">
            <endpoint binding="webHttpBinding" 
                      contract="App.IMainService"
                      behaviorConfiguration="webHttpBehavior" 
                      name="RpcEndpoint"/>
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:25565/main"/>
              </baseAddresses>
            </host>
          </service>
    
        </services>
    
        <behaviors>
          <serviceBehaviors>
            <behavior name="rpcServiceBehavior" >
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
          </serviceBehaviors>
          <endpointBehaviors>
            <behavior name="webHttpBehavior">
              <webHttp helpEnabled="true" automaticFormatSelectionEnabled="true"/>
            </behavior>
          </endpointBehaviors>
        </behaviors>
      </system.serviceModel>
    
    
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
      </system.webServer>



    • Edited by lohr.c Tuesday, October 4, 2016 1:48 PM
    Tuesday, October 4, 2016 1:47 PM

All replies

  • Hi lohr,

    I made a test based on your description, and I could reproduce your issue. In my option, with built-in help page, I am afraid we could not achieve your requirement.

    For a workaround, I would suggest you create custom help page. In other words, set helpEnabled as false, and create your own help endpoint.

    You could refer the link below for more information.

    # Customize the WebHttp Help Output in WCF

    http://stackoverflow.com/questions/7005187/customize-the-webhttp-help-output-in-wcf

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, October 6, 2016 5:14 AM
  • Hi Edward, thank you very much for taking your time and getting back to me. By now, I am sure that it's not able to include the Description content in the automatic generated help pages. 

    I only wonder, is this a design by choice or have I stumbled upon a bug?


    • Edited by lohr.c Thursday, October 6, 2016 7:28 AM
    Thursday, October 6, 2016 7:28 AM
  • Hi lohr,

    I tried to find any document to check whether it is by design or a bug, but I failed. I also tried to find any information which could share us how help page implements in WCF, but I found nothing. I only get information about using help

    For this issue, I would suggest you custom your own help page.

    Sorry for less help.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, October 7, 2016 5:31 AM
  • I have created a bug report over at connect.microsoft.com. It hasn't been confirmed yet, but for anyone who's interested: https://connect.microsoft.com/VisualStudio/feedback/details/3105900/missing-description-on-auto-generated-help-pages-in-task-based-wcf-service
    Friday, October 7, 2016 7:55 AM
  • Hi lohr,

    Thanks for your feedback, and I have voted it.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, October 7, 2016 8:10 AM