2015-10-16 63 views
0

我一直在尋找對我的服務參考錯誤的答案,現在幾天沒有變化。幾個月前,我對這個網絡應用進行了一些更改,並且我能夠更新服務參考而沒有任何問題。現在,我最近做了幾乎相同的變化,但沒有一個錯誤不能更新的解決方案服務參考: 出現錯誤嘗試更新或刪除/添加時服務參考錯誤

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. 

這個錯誤似乎refence我的本地端口,所以我檢查端口是否正在用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中回滾了很多個月前的版本,並嘗試在其他虛擬機上打開該項目,但錯誤仍然存​​在。我將不勝感激任何幫助。 謝謝,

+0

爲什麼這個標記爲c#和asp-classic?你的意思是asp.net嗎? – Dijkgraaf

回答

0

好吧,經過大量的研究,我不得不從一個更有經驗的同事那裏得到一些幫助。我們能夠通過在此解決方案中創建另一個項目來解決錯誤。至於爲什麼這個項目之前運行良好,然後突然出現問題,仍然有點神祕,但是這一改變似乎解決了這個問題。
據我所知,問題解決了,因爲我們擺脫了客戶端綁定,而是通過新項目的web.config來使用服務器綁定。 xamlx文件的新位置使其可以添加爲新的服務參考,並且在完成時似乎解決了錯誤。不知道這是否會對任何人有所幫助,但我會保留以防萬一。 Picture of the solution and where we moved the projects