我想用下面的方法獲取數據,我得到空響應,並找不出原因。我只是嘗試了一種使用Silverlight的wcf服務的不同方式,我不明白我應該做的。我希望有人會看到什麼錯誤在這裏:)Silverlight服務回調返回null
這是我的服務代理類:
Private Shared m_service As New DataServiceClient
Public Shared Sub GetSiteLogin(ByVal user As String, ByVal pass As String, callback As System.EventHandler(Of GetSiteLoginCompletedEventArgs))
AddHandler m_service.GetSiteLoginCompleted, callback
m_service.GetSiteLoginAsync(user, pass)
End Sub
這是呼叫:
Dim em As New DataService.Employee
Dim pass As String = CustomSecurity.Hash.GetSHA1Hash(txtPassword.Password)
' Try to get the employee with the login information
SettingsServiceAgent.GetSiteLogin(txtUsername.Text, pass, Sub(s, r) em = r.Result)
Employee對象將保持爲空。如果我在服務調用中插入一段時間,並按照代碼執行,它會從數據庫中找到正確的記錄,並且return語句顯示具有正確數據的對象,但silverlight方中的僱員對象仍然爲空。
有些幫助,請:)而且謝謝!
您是否嘗試過啓動提琴手或開發人員工具並捕獲請求?響應機構是否有你想要的內容? – Aligned
這兩個都是我的新主題,但我會試着去研究那些。謝謝。 – japesu