I am trying to migrate a webservice from WCF to WCF Core. I want to add the help menu, but I don't see that it is the same as the WCF one.
I want it to look like this enter image description here
But it looks like this now enter image description here
public void ConfigureServices(IServiceCollection services)
{
services.AddTransient<IService,Service>();
services.AddServiceModelServices();
services.AddServiceModelMetadata();
services.AddSingleton<IServiceBehavior, UseRequestHeadersForMetadataAddressBehavior>();
SetCacheConnectionString();
SetAdministratorUser();
}
public void Configure(IApplicationBuilder app)
{
app.UseServiceModel(serviceBuilder =>
{
serviceBuilder.AddService<Service>(o =>
{
o.DebugBehavior.HttpHelpPageEnabled = true;
o.DebugBehavior.HttpsHelpPageEnabled = true;
o.DebugBehavior.IncludeExceptionDetailInFaults = false;
});
serviceBuilder.AddServiceEndpoint<Service,IService>(new BasicHttpBinding(CoreWCF.Channels.BasicHttpSecurityMode.None), "/Custom");
});
var sMB = app.ApplicationServices.GetRequiredService<ServiceMetadataBehavior>();
sMB.HttpGetEnabled = true;
sMB.HttpsGetEnabled = true;
}
[ServiceContract]
public interface IService
{
/// <summary>
/// Creates trips using the provided information.
/// </summary>
/// <param name="importRequest"></param>
/// <returns></returns>
[OperationContract(AsyncPattern = false)]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
UriTemplate = "addcustom")]
ImportResponse AddCustom(Stream stream);
}
Here you can see the current result enter image description here