locked
swashbuckle returns blank swagger RRS feed

  • Question

  • User-1577735185 posted

    I've created a web api with a soap service (service1) then a second rest service (service2) that refers to the soap service. I've added swashbuckle to create a swagger interface for end users and it is installed and running BUT will not report anything on the rest portion of the api.  It shows the title, as specified in Swaggerconfig.cs but that is all but nothing from the service2 xml markup. 

    /// <summary>
            /// Gets a list of applciations based on operation ("AppID", "AppName", "AppDesc", or "AppOwner","AppHCAOwner") and paramater
            /// </summary>
            ///<param name="operation">"AppID", "AppName", "AppDesc", or "AppOwner","AppHCAOwner"</param>
            ///<param name="paramater">What you are looking for </param>
            /// <returns>List of applications</returns>
            public Application GetApplication(string operation, string paramater)
            {
                //Service1 Service1Instance = new Service1();
                Application adApplicationDetails = new Application();
                adApplicationDetails = Service1Instance.ApplicationDetails(operation, paramater);
                return adApplicationDetails;
            }

    If anyone could give any pointers please let me know.  Is it because there is a soap service and swashbuckle does not work with soap, is there a way to point swashbuckle at service2.cs?

    Thursday, May 7, 2020 7:28 PM

All replies

  • User1686398519 posted

    Hi,  nashken

    I need to confirm a few things with you.

    First of all, what version of your WebAPI? Is it ASP.NET or ASP.NET Core?

    Second, what is your swagger version?

    I've created a web api with a soap service (service1) then a second rest service (service2) that refers to the soap service. 

    Third, I do not understand this sentence, can you describe it more clearly?

    Best Regards,

    YihuiSun

    Friday, May 8, 2020 9:58 AM
  • User-1577735185 posted

    Thank  you. Sorry I was trying to not add a book

    I am developing in VS 2019 and use .net 4.6.1 and  Swashbuckle version 5.6.0 so whatever version of swagger that comes with it.

    To be more clear on what I did I created a wcf soap service (service1) then added a rest api (service2) 

    public Service1 Service1Instance = new Service1();
            /// <summary>
            /// Gets a list of applciations based on operation ("AppID", "AppName", "AppDesc", or "AppOwner","AppHCAOwner") and paramater
            /// </summary>
            ///<param name="operation">"AppID", "AppName", "AppDesc", or "AppOwner","AppHCAOwner"</param>
            ///<param name="paramater">What you are looking for </param>
            /// <returns>List of applications</returns>
            public Application GetApplication(string operation, string paramater)
            {
                //Service1 Service1Instance = new Service1();
                Application adApplicationDetails = new Application();
                adApplicationDetails = Service1Instance.ApplicationDetails(operation, paramater);
                return adApplicationDetails;
            }

    My swaggerconfig.cs has these settings:

     .EnableSwagger(c =>
                        {
                            c.SingleApiVersion("v1", "Watchmen Swagger ")
                             .Description("How to use the watchment API")
                             .TermsOfService("Use at your own risk")
                             .Contact(cc => cc
                                 .Name("[my name]")
                                 //.Url("http://tempuri.org/contact")
                                 .Email("[me email address]"))
                             .License(lc => lc
                                 .Name("Just use it"));
                                // .Url("http://tempuri.org/license"));
    c.IncludeXmlComments(string.Format(@"{0}\bin\WatchMenService.XML", System.AppDomain.CurrentDomain.BaseDirectory));
    c.DescribeAllEnumsAsStrings();})
                    .EnableSwaggerUi(c =>
    
    

    Friday, May 8, 2020 1:23 PM
  • User-1577735185 posted

    OK it looks like I can not do what I want to do I am using wcf and swashbuckle does not appear to like wcf.   I forked my project. If I am wrong let me know and I'll explain further and try that fork because it looked like I was very close. Working with swaggerwcf which is also not behaving and posting a question on that in the wcf forums. Thank you again.

    Friday, May 8, 2020 2:44 PM