2011-10-08 32 views
0

我一整天都在與WCF RIA Domainservice爭執一個問題。WCF RIA在使用WP7訪問時給Azure中的EndpointNotFoundException

我在寫一個WCF RIA服務庫,它部署在Windows Azure上。我通過SilverlightWindows Phone 7客戶端訪問它。在我的雲應用程序中,我有兩個ASP.NET項目作爲兩個Web角色,它們充當兩個不同的端點。

第一個通過SSL爲Silverlight客戶端提供訪問。

第二個是一個簡單的端點,沒有對WP7客戶端進行身份驗證。它在端口8080上運行。

在我的本地卡西尼一切正常。我可以與兩個客戶端訪問該服務。 在雲中,我只能使用Silverlight客戶端。當我試着使用WP7的應用程序,以達到服務我得到:

System.ServiceModel.EndpointNotFoundException wurde nicht behandelt. Message=There was no endpoint listening at http://myapp.cloudapp.net:8080/Services/MyRIAServiceLib-Web-MyService.svc/soap that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

的內部異常的類型System.Net.WebException的說:

The remote server returned and error: NotFound

我添加了一個自動的服務引用到我的WP7應用程序連接到WCF服務。當我這樣做時,VS2010 成功識別服務並生成使其可用的代碼。這意味着服務是可用的,可以找到,對吧?當我通過瀏覽器訪問http://myapp.cloudapp.net:8080/MyRIAServiceLib-Web-MyService.svc時,我可以看到通常的「您已經創建了一項服務。」 - Page。

我已經將所有dll添加爲本地副本設置爲true,這可能會在雲中丟失,但也許我錯過了一些。 我的web.config看起來是這樣的:

<configSections> 
    <sectionGroup name="system.serviceModel"> 
    <section name="domainServices" type="System.ServiceModel.DomainServices.Hosting.DomainServicesSection, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
    </sectionGroup> 
</configSections> 
<system.serviceModel>  
<domainServices> 
    <endpoints> 
    <add name="soap" type="Microsoft.ServiceModel.DomainServices.Hosting.SoapXmlEndpointFactory, Microsoft.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
    </endpoints> 
</domainServices> 
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> 
</system.serviceModel> 
<system.webServer> 
<validation validateIntegratedModeConfiguration="false" /> 
    <modules runAllManagedModulesForAllRequests="true"> 
    <add name="DomainServiceModule" preCondition="managedHandler" 
     type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
    </modules> 
</system.webServer> 
<system.web> 
    <customErrors mode="Off"/> 
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0"/> 
    <httpModules> 
    <add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
    </httpModules> 
</system.web> 

任何幫助嗎?我被卡住了幾個小時,並且閱讀並搜索了這個問題。

我可以使用RDP訪問Azure計算機。我如何調試/追蹤這個問題?我很樂意使用Fiddler/WCF Traces,如果有人能夠讓我走向正確的道路。

回答

0

這似乎是一個隨機錯誤,這可能是由於沒有檢索到服務的連接(儘管它是可到達的)。最終重新刷新連接幾次(這可能需要幾分鐘到一整天)。

1

檢查2個東西:

1)確保代理安裝正確。

2)如果您使用的是SSL,請確保您已在電話/模擬器上安裝證書。

您看到的錯誤是通用的wcf說不能建立網絡連接。

+0

這似乎是一個隨機錯誤,因爲它本身消失而不更改設置或代碼。就像我在問題中所描述的那樣,我確實通過VS中的服務嚮導連接到服務。而且我沒有爲手機使用SSL(並且我還安裝了不使用SSL的端點)。 – Torsten

相關問題