我正在關注一個教程來創建一個使用datagrid並從表中提取數據的silverlight web應用程序,但我一直收到的服務器錯誤只是NotFound而沒有進一步的細節。不知道如何跟蹤錯誤。silverlight應用程序 - 服務器錯誤沒有找到
Imports System.ServiceModel
Imports System.ServiceModel.Activation
Public Class Service2
<OperationContract()>
Public Function DoWork() As List(Of RealTimeCount)
Try
Dim df As New DataClasses2DataContext
Dim counts = (From record In df.RealTimePostCounts Order By record.pollDate, record.boxFeed, record.boxCount Select record)
Dim list As New List(Of RealTimeCount)
For Each d In counts
list.Add(New RealTimeCount With {.getDate = d.pollDate, .boxItem = d.boxFeed, .boxSum = d.boxCount})
Next
Return list
Catch ex As Exception....
end try
end function
end class
Public Class MainPage
Inherits UserControl
Private WithEvents mservice As New ServiceReference1.Service2Client()
Public Sub New()
InitializeComponent()
End Sub
Private Sub btnLoad_Click
(ByVal sender As System.Object,
ByVal e As System.Windows.RoutedEventArgs) Handles btnLoad.Click
mservice.DoWorkAsync()
End Sub
Private Sub mservice_DoWorkCompleted
(ByVal sender As Object,
ByVal e As ServiceReference1.DoWorkCompletedEventArgs)
Handles mservice.DoWorkCompleted
DataGrid1.ItemsSource = e.Result
DataGrid1.Visibility = Windows.Visibility.Visible
End Sub
End Class
右鍵單擊YourService.svc並選擇在瀏覽器中查看。發生了什麼? – Nario 2011-04-15 22:55:24
要測試此服務,您需要創建一個客戶端並使用它來調用該服務。您可以使用命令行中的svcutil.exe工具使用以下語法執行此操作:..出現在瀏覽器中 – vbNewbie 2011-04-16 13:51:14