尝试更新或 remove/add 时出现服务参考错误
Service Reference Error when trying to update or remove/add
几天来我一直在寻找我的服务参考错误的答案,但没有任何改变。几个月前,我对该 Web 应用程序进行了一些更改,并且能够毫无问题地更新服务参考。现在,我最近做了几乎相同的更改,但无法在没有错误的情况下更新解决方案中的服务引用:
出现错误
downloading 'http://localhost:57903/CreateServiceCall.xamlx/_vti_bin/ListData.svc/$metadata'.
The request failed with the error message:
....
The remote server returned an error: (500) Internal Server Error.
If the service is defined in the current solution, try building the solution and adding the service reference again.
或
The service reference is invalid. The .svcmap file ('C:\Projects_2010...') cannot be loaded. It may be corrupted or in a bad format: The service reference is invalid, because the .svcmap file.
此错误似乎引用了我的本地主机端口,因此我检查该端口是否正在使用 cmd > netstat -anb 进行侦听。看起来这个端口正在监听这个命令。我收到的一些错误消息要求我删除和添加服务引用,所以我做了,我收到了一条更详细的错误消息,但它仍然无助于找到解决方案:
Metadata contains a reference that cannot be resolved: 'http://localhost:57903/CreateServiceCall.xamlx'.
An error occurred while receiving the HTTP response to http://localhost:57903/CreateServiceCall.xamlx. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.
The underlying connection was closed: An unexpected error occurred on a receive.
Unable to read data from the transport connection: An established connection was aborted by the software in your host machine.
An established connection was aborted by the software in your host machine
If the service is defined in the current solution, try building the solution and adding the service reference again.
这个web应用自上次更新以来没有任何变化,所以我很困惑为什么这个服务引用会突然失效。这是我的 web.config 服务器和绑定信息:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IApplicationService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"
messageEncoding="Text">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<binding name="BasicHttpBinding_IService" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://"actual_url"/CreateServiceCall.xamlx"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IApplicationService"
contract="Application.IApplicationService" name="BasicHttpBinding_IApplicationService" />
<endpoint address="http://"actual_url"/CreateServiceCall.xamlx"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
contract="CreateServiceCall.IService" name="BasicHttpBinding_IService" />
<!--<endpoint address="http://localhost:57903/CreateServiceCall.xamlx"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IApplicationService"
contract="Application.IApplicationService" name="BasicHttpBinding_IApplicationService" />
<endpoint address="http://localhost:57903/CreateServiceCall.xamlx"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
contract="CreateServiceCall.IService" name="BasicHttpBinding_IService" />-->
</client>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<!--<sqlWorkflowInstanceStore connectionStringName="WF4Persistence" />-->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
Web 应用程序设置为使用与 web.config 中相同的开发服务器。
我现在很迷茫为什么这个错误一直在发生。我什至在 TFS 中回滚到以前的版本几个月,并尝试在我的其他虚拟机上打开该项目,但错误仍然存在。我将不胜感激任何帮助。
谢谢,
好吧,经过大量研究后,我不得不从一位更有经验的同事那里得到一些帮助。我们能够通过在此解决方案中创建另一个项目来解决错误。之前项目还好好的,为什么突然就出问题了,还是有点迷,不过这次改动好像解决了问题。
据我了解,问题已解决,因为我们摆脱了客户端绑定,而是通过新项目的 web.config 使用服务器绑定。 xamlx 文件的新位置使其可以作为新服务引用添加,并且似乎解决了最终确定时的错误。不确定这是否对任何人有帮助,但我会保留它以防万一。
Picture of the solution and where we moved the projects
几天来我一直在寻找我的服务参考错误的答案,但没有任何改变。几个月前,我对该 Web 应用程序进行了一些更改,并且能够毫无问题地更新服务参考。现在,我最近做了几乎相同的更改,但无法在没有错误的情况下更新解决方案中的服务引用: 出现错误
downloading 'http://localhost:57903/CreateServiceCall.xamlx/_vti_bin/ListData.svc/$metadata'.
The request failed with the error message:
....
The remote server returned an error: (500) Internal Server Error.
If the service is defined in the current solution, try building the solution and adding the service reference again.
或
The service reference is invalid. The .svcmap file ('C:\Projects_2010...') cannot be loaded. It may be corrupted or in a bad format: The service reference is invalid, because the .svcmap file.
此错误似乎引用了我的本地主机端口,因此我检查该端口是否正在使用 cmd > netstat -anb 进行侦听。看起来这个端口正在监听这个命令。我收到的一些错误消息要求我删除和添加服务引用,所以我做了,我收到了一条更详细的错误消息,但它仍然无助于找到解决方案:
Metadata contains a reference that cannot be resolved: 'http://localhost:57903/CreateServiceCall.xamlx'.
An error occurred while receiving the HTTP response to http://localhost:57903/CreateServiceCall.xamlx. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.
The underlying connection was closed: An unexpected error occurred on a receive.
Unable to read data from the transport connection: An established connection was aborted by the software in your host machine.
An established connection was aborted by the software in your host machine
If the service is defined in the current solution, try building the solution and adding the service reference again.
这个web应用自上次更新以来没有任何变化,所以我很困惑为什么这个服务引用会突然失效。这是我的 web.config 服务器和绑定信息:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IApplicationService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"
messageEncoding="Text">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<binding name="BasicHttpBinding_IService" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://"actual_url"/CreateServiceCall.xamlx"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IApplicationService"
contract="Application.IApplicationService" name="BasicHttpBinding_IApplicationService" />
<endpoint address="http://"actual_url"/CreateServiceCall.xamlx"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
contract="CreateServiceCall.IService" name="BasicHttpBinding_IService" />
<!--<endpoint address="http://localhost:57903/CreateServiceCall.xamlx"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IApplicationService"
contract="Application.IApplicationService" name="BasicHttpBinding_IApplicationService" />
<endpoint address="http://localhost:57903/CreateServiceCall.xamlx"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
contract="CreateServiceCall.IService" name="BasicHttpBinding_IService" />-->
</client>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<!--<sqlWorkflowInstanceStore connectionStringName="WF4Persistence" />-->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
Web 应用程序设置为使用与 web.config 中相同的开发服务器。 我现在很迷茫为什么这个错误一直在发生。我什至在 TFS 中回滚到以前的版本几个月,并尝试在我的其他虚拟机上打开该项目,但错误仍然存在。我将不胜感激任何帮助。 谢谢,
好吧,经过大量研究后,我不得不从一位更有经验的同事那里得到一些帮助。我们能够通过在此解决方案中创建另一个项目来解决错误。之前项目还好好的,为什么突然就出问题了,还是有点迷,不过这次改动好像解决了问题。
据我了解,问题已解决,因为我们摆脱了客户端绑定,而是通过新项目的 web.config 使用服务器绑定。 xamlx 文件的新位置使其可以作为新服务引用添加,并且似乎解决了最终确定时的错误。不确定这是否对任何人有帮助,但我会保留它以防万一。
Picture of the solution and where we moved the projects