我安装了 mono-2.6.7 和 WCF 服务:
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="RestB"><webHttp/></behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<services>
<service name="Rest">
<endpoint address="" behaviorConfiguration="RestB" binding="webHttpBinding" contract="Rest" />
</service>
</services>
</system.serviceModel>
有效。
我想使用多个端点,但一旦指定地址,我就不断收到错误,因此我决定尝试 mono 2.8.2。安装 2.8.2 后(添加 mono 抱怨的 serviceBehavior 后),我开始得到:
"HttpListenerContext does not match any of the registered channels"
System.InvalidOperationException: HttpListenerContext does not match any of the registered channels
at System.ServiceModel.Channels.Http.HttpListenerManager.ProcessNewContext (System.ServiceModel.Channels.Http.HttpContextInfo ctxi) [0x00000] in :0
at System.ServiceModel.Channels.SvcHttpHandler.ProcessRequest (System.Web.HttpContext context) [0x00000] in :0
at System.Web.HttpApplication+c__Iterator2.MoveNext () [0x00000] in :0
at System.Web.HttpApplication.Tick () [0x00000] in :0
当尝试访问在 mono-2.6.7 中工作的 url 时。
我尝试了 mod-mono-server2 和 mod-mono-server4。
我试图查找这个问题,但我找不到任何东西。
有人可以向我展示具有多个端点的 mono-2.8.2 或 mono-2.6.7 配置中的 WCF 服务的工作示例吗?
更新:恢复到 mono-2.6.7 后,上面显示的我的服务“Rest”再次工作。
先谢谢各位高手了
谢谢
泰梅克
问题(也影响 2.10)是 UriTemplate/{var1}/{var2} 在 2.8 和 2.10.1 中不起作用。我用 UriTemplate?x={var1}&y={var2} 替换它们。不太理想,但现在对我来说就可以了。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)