2016-11-11 108 views
0

我正在尝试将旧的.asmx Web服务添加到基于南希的应用程序。每对其他SO岗位的建议,我已经添加了在.NET 4.5.2中向Nancy添加.asmx - 在HttpRequest.GetBufferlessInputStream后不支持

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

但无济于事,我仍然得到

服务器无法处理运行已扩展的例外规定在配置文件中。 ---> System.Web.HttpException:在调用HttpRequest.GetBufferlessInputStream后,不支持此方法或属性 。 在System.Web.HttpRequest.get_InputStream() 在System.Web.Services.Protocols.SoapServerProtocol.Initialize() ---内部异常堆栈跟踪的结尾--- 在System.Web.Services.Protocols.SoapServerProtocol .Initialize() 在System.Web.Services.Protocols.ServerProtocolFactory.Create(类型类型, HttpContext的背景下,要求的HttpRequest,HttpResponse对象响应, 布尔& abortProcessing)

如果我注释掉app.UseNancy(options)的ASMX作品再次。事实上,它甚至没有useClassicReadEntityBodyMode。我怎样才能使asmx与南希合作?对于启动,我

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); 

更新的SOAP客户端是.NET 3.5,可这是什么问题?

回答

0

问题不是南希,它是我删除的app.UseStageMarker(PipelineStage.MapHandler);。这是一个欧文问题,所以我正在关闭。