Metro App调用IIS中托管的WCF服务 [英] Metro App calling WCF service hosted in IIS

查看:47
本文介绍了Metro App调用IIS中托管的WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个WCF服务,我在IIS中设置了我尝试在Metro应用程序中使用。



我的应用程序在我的本地计算机上工作并使用模拟器。此外,我可以使用我的Web浏览器从远程计算机测试服务。



问题是当我将Metro App部署到远程计算机时出现以下错误:



********************************** *************

mscorlib.dll中发生未处理的System.ServiceModel.EndpointNotFoundException类型异常



附加信息:http://e6420/Service1.svc上没有可以接受该消息的端点。这通常是由错误的地址或SOAP操作引起的。有关详细信息,请参阅InnerException(如果存在)。

******************************** ***************



e6420是在IIS中托管WCF服务的机器名。

I created a WCF service that I setup in IIS that I am trying to use in my Metro App.

My application works on my local machine and using the simulator. Also, I can test the service using my web browser from a remote machine.

Problem is when I deploy the Metro App to a remote machine I get the following error:

***********************************************
An unhandled exception of type ''System.ServiceModel.EndpointNotFoundException'' occurred in mscorlib.dll

Additional information: There was no endpoint listening at http://e6420/Service1.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
***********************************************

e6420 is the machine name hosting the WCF service in IIS.

推荐答案

你能ping e6420并获得回复吗?如果可以的话,你能telnet e6420 80并建立连接吗?



你收到的错误消息表明你无法连接到机器。事实上,错误消息并没有说机器主动拒绝它通常意味着它甚至无法找到机器首先连接。



如果你不能在你的浏览器中点击http://e6420/Service1.svc,你将无法用代码命中它(在大多数情况下)。
Can you ping e6420 and get a response? If you can, can you telnet e6420 80 and establish a connection?

The error message you got suggests that you couldn''t connect to the machine. The fact that the error message didn''t say that the machine actively refused it generally means it couldn''t even find the machine to connect to in the first place.

If you can''t hit http://e6420/Service1.svc in your browser, you won''t be able to hit it with code (in most cases).


在MSDN上查看这篇文章。



http://msdn.microsoft.com/en-us/library/hh556233.aspx [ ^ ]



具体说明以下部分:

要使Windows应用商店应用程序进行跨机器调用,您必须启用另一个称为Home / Work Networking的功能。此设置也位于Capabilities选项卡下的Package.appmanifest文件中。选择Home / Work Networking复选框。这使您的应用程序可以对用户信任的地方(如家庭和工作)的网络进行入站和出站访问。始终阻止入站关键端口。要访问Internet上的服务,还必须启用Internet(客户端)功能。
Take a look at this article on MSDN.

http://msdn.microsoft.com/en-us/library/hh556233.aspx[^]

Specifically the section that states the following:
In order for Windows Store applications to make cross machine calls you must enable another capability called "Home/Work Networking". This setting is also in the Package.appmanifest file under the Capabilities tab. Select the Home/Work Networking checkbox. This gives your application inbound and outbound access to the networks of the user’s trusted places like home and work. Inbound critical ports are always blocked. For accessing services on the internet you must also enable Internet (Client) capability.


这篇关于Metro App调用IIS中托管的WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆