2

我在 Windows 虚拟机上构建了一个 WCF 服务,并通过在我的浏览器上键入以下内容使用 WCF 测试客户端对其进行了测试:

http://localhost/Service1.svc/getAllCustomers

...而且效果很好。现在的问题是我想在我的真实计算机(而不是虚拟机)上做同样的测试。

我在 VM 上使用 XAMPP,我在htdocs文件夹中设置了项目,然后在浏览器上输入:

http://10.211.55.3/WCFWebService/Service1.svc.cs/getAllCustomers

问题是它不返回调用的结果getAllCustomers,而是返回Service1.svc.cs纯文本。

我希望它在 VM 上做同样的事情 - 有人可以告诉我问题是什么吗?我认为这是因为在 VM 上它可以与 WCF 测试客户端一起使用,并且由于我的计算机是 Mac,我无法运行 WCF 测试客户端。

4

2 回答 2

0

I found this with a Google query.

I kept the tab open, but continued exploring the other search results.

One I found particularly interesting was this one: WCF acting as Web Service without IIS

It appears WCF gives options other than IIS to host the web service (Console Application, Windows Application, Windows Services).

The Windows Service link is provided here: How to: Host a WCF Service in a Managed Windows Service

I have not done this, so I cannot elaborate on what problems you will run into.

I just want others that may run into this (like I did) to know that the one answer posted last year may not actually be the end of the road.

于 2014-07-24T16:36:46.653 回答
0

WCF 服务不能在 Apache Web 服务器上运行,您应该在 VM 上安装 IIS 服务器以测试该服务。请参阅:http: //msdn.microsoft.com/en-us/library/ms733766.aspx

于 2013-02-20T22:26:32.460 回答