2012-04-05 85 views
0

對不起,如果標題有點模糊,但事實是我不明白我的問題,我從來沒有遇到過這個,我沒有做任何事情的普通。與我的WCF服務SL4應用程序通信異常

右鍵我有一個使用業務應用程序模板的基本Silverlight 4應用程序。我還創建了一個WCF服務應用程序項目,用於簡單地返回我的數據庫中的某些條目的Observable集合,

我將其發佈到我的本地計算機,然後在我的SL4應用程序中引用,並且我得到此異常

[System.ServiceModel.CommunicationException: The remote server returned an error:  NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound. --->  System.Net.WebException: The remote server returned an error: NotFound. 
at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) 
at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5. <EndGetResponse>b__4(Object sendState) 
at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__0(Object sendState) 
--- End of inner exception stack trace --- 
at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state) 
at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) 
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest. CompleteGetResponse(IAsyncResult result) 
--- End of inner exception stack trace --- 
at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result) 
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) 
at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result) 
at RMServiceRIA.rService.Service1Client.Service1ClientChannel.EndgetBuildings(IAsyncResult result) 
at RMServiceRIA.rService.Service1Client.RMServiceRIA.rService.IService1.EndgetBuildings(IAsync Result result) 
at RMServiceRIA.rService.Service1Client.OnEndgetBuildings(IAsyncResult result) 
at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)} 

我有一個CLIENTACCESS政策,這對於測試的目的設置爲允許任何訪問跨域策略,

Client Access Policy

Cross Domain

關於如何解決這個問題的任何想法,我調試了我的WCF服務,它接收到調用,執行的方法達到了它的返回語句,但是我的SL4從來沒有收到結果,只要我的WCF服務有結果我得到了一個在我的SL4應用程序中拋出的異常,對我來說,似乎只是連接關閉了,但我不知道,我試圖研究,但是你從哪裏開始並沒有完全理解?我發現很多人都有同樣的錯誤信息,但是WCF太神祕了......我嘗試並啓用了我的webconfig中的調試信息。我也曾嘗試舉辦我的Web服務器,但沒有運氣的WCF服務,我必須對運行幾個WCF服務的一組類似,所以我不能確定爲什麼這心不是工作

Web Config for WCF Service

client config

感謝在看看,如果你需要任何更多的信息只是問我會很樂意爲您提供它,

+0

原來,這個問題是通過追蹤解決的,爲我自己學到了一些新的東西,所以在將來我不會再遇到這個問題! – 2012-04-05 23:17:36

回答

1

最好的辦法是打開WCF跟蹤,所以你可以看到正在發生的事情。

http://software.intel.com/en-us/blogs/2010/02/03/adventures-with-silverlight-and-wcf-the-remote-server-returned-an-error-notfound/

最可能的原因是序列化的東西的問題。未找到僅僅是500錯誤的Silverlight版本。

+0

感謝科比,我將看看, – 2012-04-05 22:54:15

+0

感謝科比問題出在我的DataContext被處置,但在後期訪問,仍然試圖解決,但幸運的是,我知道在哪裏尋找答案 – 2012-04-05 23:07:42

+1

這是一個有趣的一。 :) – Bryant 2012-04-05 23:09:19

相關問題