尝试更新或删除/添加时出现服务参考错误 [英] Service Reference Error when trying to update or remove/add

查看:115
本文介绍了尝试更新或删除/添加时出现服务参考错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天来我一直在寻找我的服务参考错误的答案,没有任何变化.几个月前,我对该Web应用程序进行了一些更改,并且能够毫无问题地更新服务参考.现在,我最近做了几乎相同的更改,但是不能在没有错误的情况下更新解决方案中的服务引用: 发生错误

I have been searching for an answer to my service reference error for days now with no change. I made some changes to this web app a few months ago and I was able to update the service reference without any issue. Now, I made pretty much identical changes recently, but cannot update the service reference in the solution without an error: There was an error

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进行监听.看起来该端口正在侦听此命令.我收到一些错误消息,要求我删除并添加服务引用,所以我这样做了,但我得到了一条错误消息,但有更多详细信息,但它仍然无助于找到解决方案:

This error seems to refence my localhost port so I check to see if the port is listening with cmd > netstat -anb. It looks like this port is listening as it should with this command. Some of the error messages that I was getting asked me to remove and add the service reference, so I did and I got a error message with a little more detail but it still did not help find a solution:

 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服务器和绑定信息:

No changes have been made to this web application since the last time it was update, so I am confused as to why this service reference would be invalid all of a sudden. Here is my web.config server and binding info:

<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上回滚了许多个月以前的版本,并尝试在其他虚拟机上打开该项目,但是错误仍然存​​在.我将不胜感激任何帮助. 谢谢,

The web app is set to use the same dev server as is in the web.config. I am very lost right now as to why this error keeps happing. I even rolled back many months to a previous version in TFS and tried opening the project on my other virtual machine, but the error still persists. I would appreciate any help. Thanks,

推荐答案

好吧,经过大量研究,我不得不从经验更丰富的同事那里获得一些帮助.通过在此解决方案中创建另一个项目,我们能够解决该错误.关于为什么该项目之前运行良好,然后突然出现问题,仍然是一个谜,但是这种更改似乎已经解决了问题.
据我了解,该问题得以解决,因为我们摆脱了客户端绑定,而是通过新项目的web.config使用服务器绑定. xamlx文件的新位置使其可以作为新服务引用添加,并且似乎可以解决最终确定时的错误.不知道这是否会对任何人有帮助,但我会保留以防万一. 解决方案的图片以及我们将项目移至何处

Well, after much research I had to get some help from a much more experienced co-worker. We were able to solve the error by creating another project within this solution. It is still a bit of a mystery as to why the project worked fine before and then had issues suddenly, but this change seems to have solved the problem.
From what I understand, the issue was solved because we got rid of the client side bindings and use a server binding through the web.config of the new project instead. The new location for the xamlx file made it available to be added as a new service reference and it seemed to solve the error when finalizing. Not sure if this will help anyone, but I will leave it up just in case. Picture of the solution and where we moved the projects

这篇关于尝试更新或删除/添加时出现服务参考错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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