连接尝试失败,因为一段时间后被连接方未正确响应 [英] A connection attempt failed because the connected party did not properly respond after a period
问题描述
我已经创建了Windows服务,并将该服务引用添加到我的Metro应用程序中.
我已经创建了一个程序包,并将该程序包安装在另一个系统以及Windows服务中.该应用程序已成功安装.现在,我尝试运行该应用程序.调用服务时抛出以下异常.
在"http://localhost:8732/Design_Time_Addresses/TFSClientWindowsService/TFSCClientWindowsService/上没有侦听终结点的端点可以接受消息.这通常是由于地址或SOAP操作不正确引起的.
InnerException:连接尝试失败,因为一段时间后连接方未正确响应,或者建立连接失败,因为连接的主机未能在127.0.0.1:8732响应
以下是我在服务级别上的配置设置:
Hi,
I have created a windows service and added that service reference to my metro application.
I have created a package and installed the package in another system and also the windows service. The application has installed successfully. Now I try to run the application. the below exception is thrown while calling the service.
There was no endpoint listening at "http://localhost:8732/Design_Time_Addresses/TFSClientWindowsService/TFSCClientWindowsService/ that could accept the message. This is often caused by incorrect address or SOAP action.
InnerException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host failed to respond at 127.0.0.1:8732
Below is my config settings at service level:
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="MyBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="TFSClientWindowsService.TFSCClientWindowsService" behaviorConfiguration="MyBehavior">
<endpoint address="" binding="basicHttpBinding" contract="TFSClientWindowsService.ITFSCClientWindowsService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/Design_Time_Addresses/TFSClientWindowsService/TFSCClientWindowsService/"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
</configuration>
当我安装软件包并访问服务时,它运行正常.但是当我将其安装在另一个系统中时,此操作仍为nto.
when I install the package and access the service it is functioning correctly. but nto when I install it in another system.
推荐答案
以下是您的提示:
http:// localhost :8732/Design_Time_Addresses/TFSClientWindowsService/TFSCClientWindowsService/
你知道什么是本地主机"吗?这是本地机器.您正在告诉您的Web服务客户端去在同一台机器上找到服务!当然,它可以在您的开发机器上运行,而不是在您尝试将其安装在其他地方时起作用!
您需要用托管可见的已部署服务提供商的位置替换localhost:8732.
Here''s your clue:
http://localhost:8732/Design_Time_Addresses/TFSClientWindowsService/TFSCClientWindowsService/
Do you know what ''localhost'' is? It''s the local machine. You''re telling your web service client to go and find a service on the same machine! Of course that works on your dev machine and not when you try installing it somewhere else!
You need to replace localhost:8732 with wherever the visible, deployed service provider is hosted.
嗨Bobjanova,
感谢您的回复.
我基本上创建了Windows服务设置和Metro应用程序包.
现在,我在另一台计算机上安装了服务和软件包.因此,该服务应在该计算机上是本地的.
我还删除了端口,并将基本地址指定为
http://localhost/TFSClientWindowsService/TFSCClientWindowsService/ [
我再次遇到相同的问题.
当我浏览地址时,我在那台机器上得到了wsdl.无法找出问题出在哪里
Hi Bobjanova,
Thanks for your response.
I basically created a windows service setup and metro application Package.
Now I install both service and package in other machine . So service should be local for that machine.
I have also removed the port and gave the base address as
http://localhost/TFSClientWindowsService/TFSCClientWindowsService/[
I again get the same issue.
I''m getting the wsdl in that machine when I browser the address. Couldn''t figure out what went wrong
这篇关于连接尝试失败,因为一段时间后被连接方未正确响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!