0
votes

I am trying add an old .asmx web service to Nancy-based app. Per suggestions on other SO posts, I have already added

<add key="wcf:serviceHostingEnvironment:useClassicReadEntityBodyMode" value="true" />

but to no avail, I still get

System.Web.Services.Protocols.SoapException: There was an exception running the extensions specified in the config file. ---> System.Web.HttpException: This method or property is not supported after HttpRequest.GetBufferlessInputStream has been invoked. at System.Web.HttpRequest.get_InputStream() at System.Web.Services.Protocols.SoapServerProtocol.Initialize() --- End of inner exception stack trace --- at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)

If I comment out app.UseNancy(options) the asmx works again. In fact, it even works without the useClassicReadEntityBodyMode. How can I make asmx work with Nancy? For Startup, I

var bootstrapper = new CustomNinjectNancyBootstrapper(resolver.Kernel);
var options = new NancyOptions
{
    Bootstrapper = bootstrapper,
    PerformPassThrough = c => c.Request.Path.EndsWith(".asmx"),
};
options.PassThroughWhenStatusCodesAre(HttpStatusCode.NotFound);
app.UseNancy(options);
app.UseStageMarker(PipelineStage.MapHandler);

Update, the SOAP client is .NET 3.5, could this be the problem?

1

1 Answers

0
votes

The problem was not Nancy, it was app.UseStageMarker(PipelineStage.MapHandler); which I removed. This is an Owin question so I'm closing.