我正在尝试使用 mono 2.10.8 在 CentOS 上托管 WCF 服务,并将其作为 REST 或 SOAP 服务器进行访问。
我在包含我的 web.config 的文件夹中使用 mod-mono-server-4 启动了一个应用程序:
<configuration>
<system.serviceModel>
<services>
<service behaviorConfiguration="WebBehavior" name="Services.Hello">
<clear/>
<endpoint address="http://DOMAIN/service" behaviorConfiguration="HelloBehavior" binding="webHttpBinding" contract="Services.IHello" />
<endpoint address="http://DOMAIN/web" binding="basicHttpBinding" bindingConfiguration="" contract="Services.IHello" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="HelloBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="WebBehavior">
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
如果我现在调用DOMAIN/web?wsdl
或DOMAIN/service/hello
(/hello
是 IHello 中方法的 WebGetAttribute 的 UriTemplate),我只会得到 404:
“/”应用程序中的服务器错误
找不到资源。
我还有一个Service.svc
文件包含:
如果我打电话DOMAIN/Service.svc/hello
,我会收到一个 SOAP 错误:
请求消息的目标为“http://DOMAIN/Service.svc/hello”,操作为“”,在此服务合同中无法访问
如果我在执行以下操作的服务器上启动控制台应用程序:
WebServiceHost sh = new WebServiceHost(typeof(Hello), new Uri("http://localhost:681/service"));
sh.Open();
我可以在端口 680 上访问该服务,因此 mono 应该能够运行该服务,但我需要它与 mod_mono 一起运行(在端口 80 上)。
我需要什么不同的配置?
最后,我试图托管一个 SyndicationFeed 来提供 RSS/Atom-Feed。